Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtoi ...
func Sliceconvtoi() []int {
	strs := strings.Split(sc.Text(), " ")

	var ints []int
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		ints = append(ints, x)
	}

	return ints
}

//Min .
func Min(a, b int) int {
	switch a < b {
	case true:
		return a
	default:
		return b
	}
}

//GCDandLCM .
func GCDandLCM(i []int) (int, int) {
	a := i[0]
	b := i[1]

	for {
		if a == b {
			break
		} else {
			a, b = Min(a, b), int(math.Abs(float64(a-b)))
		}
	}

	return a, i[0] * i[1] / a
}

func main() {
	for sc.Scan() {
		i := Sliceconvtoi()
		g, _ := GCDandLCM(i)
		fmt.Println(g)
	}

}

C++: #include <iostream>
using namespace std;

int main(){
    int a,b,c;
    while(cin >> a >> b){
        while(1){
            if(a < b){
                c = b % a;
            }
            else if(a > b){
                c = a % b;
            }
            else {
                cout << b << endl;
                break;
            }
            if(c != 0){
                a = b;
                b = c;
            }
            else {
                if(a > b){
                    cout << b << endl;
                    break;
                }
                else {
                    cout << a << endl;
                    break;
                }
            }
        }
    }
}

C++: #include<iostream>
using namespace std;

int gcd(int a,int b){
  int tmp;
  if(a>b){
    tmp = a;
    a = b;
    b = tmp;
  }
  if(a == 0)return b;
  else return gcd(b%a,a);
}

int main()
{
  int a,b;

  while(cin >> a >> b){
    cout << gcd(a,b) << endl;
  }

  return 0;
}

C++: #include <iostream>

int eucgcd(int m, int n)
{
	int p = m%n;
	
	while( p > 0 )
	{
		m = n;
		n = p;
		p = m%n;
	}
	
	return n;
}


int main()
{
	int m,n;
	
	while( std::cin >> m >> n && m && n )
	{
		if( m >= n )
			std::cout << eucgcd(m, n) << std::endl;
		else
			std::cout << eucgcd(n, m) << std::endl;
	}
	
	return 0;
}

C++: #include <iostream>

using namespace std;

int gcd(int a, int b)
{
    return b == 0 ? a : gcd(b, a % b);
}

int main()
{
    int a, b;

    while (cin >> a >> b) 
        cout << gcd(a, b) << endl;
        

    return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <memory>
#include <memory.h>
#include <fstream>
#include <cmath>
#include <math.h>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <map>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<double, double> Pd;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const int INF = 1 << 29;
const double EPS = 1E-10;

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)
#define repD(i, m, n) for(int i = m; i >= n; i--)

int gcd(int u, int v){
	while(u > 0){
		if(u < v) swap(u, v);
		u %= v;
	}
	return v;
}
int main(){
	int a, b;
	while(cin >> a >> b){
		cout << gcd(a, b) << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

int main(void){
	int a,b;
	while(cin>>a>>b)
	cout<<__gcd(a,b)<<endl;
}

C++: #include <iostream>
using namespace std;

template <typename T>
T gcd(T a, T b){
	T r;
	while(b > 0){
		r = a % b;
		a = b;
		b = r;
	}
	return a;
}

int main(){
	int a,b;
	
	while( cin >> a >> b, a , b ){
		cout << gcd(a,b) << endl;
	}
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

int main() {
	vector<int>a(2);
	while (cin>>a[0]>>a[1]) {
		while (1) {
			sort(a.begin(), a.end());
			if (a[1] % a[0] == 0) { cout << a[0] << endl; break; }
			int d = a[0];
			a[0] = a[1] % a[0];
			a[1] = d;
		}
	}
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

int gcdf(int a,int b)
{
	return(b==0?a:gcdf(b,a%b));
}
int gcd(int a,int b){
	return(a>b?gcdf(a,b):gcdf(b,a));
}

int main(){
	
	int a,b;
	
	while(cin>>a>>b)
		cout<<gcd(a,b)<<endl;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main()
{
	int a, b;
	while (scanf("%d %d", &a, &b) != EOF){
		printf("%d\n", __gcd(a, b));
	}
}

C++: #include <stdio.h>
int gcd(int a,int b){
if(b==0)return a;
return gcd(b,a%b);
}
int main(){
int a,b;
while(scanf("%d%d",&a,&b)!=EOF){
printf("%d\n",gcd(a,b);
}
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(void){
  int x,y,z;
  while(cin >> x >> y){
    if(x<y) swap(x,y);
    while((z=x%y)!=0){
      x=y;
      y=z;
    }
    cout << y << endl;
  }
}

C++: #include <iostream>
#include <cstdio>

using namespace std;

void swap(int *x, int *y){
	int tmp=*x;
	*x=*y;
	*y=tmp;
}

int main(){
	long a, b;
	while( scanf(" %ld %ld", &a, &b) != EOF ){
		if(a<b) swap(a,b);
		
		if(b!=0){
			while(b!=0){
				long r=a%b;
				a=b;
				b=r;
			}
		}
		printf("%ld\n", a);
	}
	
	return 0;
}

C++: 
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

int gcd(int a,int b){
    if(b == 0)return a;
    else return gcd(b,a%b);
}
int main() {
    int a,b;
    while(cin >> a >> b){
        cout << gcd(a, b) << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;


int pgcd(int a,int b)
{
    return a==0?b:pgcd(b%a,a);
}

int main()
{
    int a,b;
    while(cin>>a>>b)
    {
        cout<<pgcd(a,b)<<endl;
    }
    return 0;
}

C++: #include<algorithm>
using namespace std;
int main(){
	int a,b;
	while(cin>>a>>b)cout<<__gcd(a,b)<<endl;
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <iomanip>
#include <stack>
#include <set>
#include <cstdio>
#include <bitset>
#include <functional>
#include <tuple>
#include <list>
#include <deque>
using namespace std;
typedef pair<int, int> P;

#define FOR(i, a, n) for (ll i = (ll)a; i<(ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef vector<int> VI;
int GCD(int a, int b){
    if(b==0) return a;
    return GCD(b, a%b);
}

int main() {
    int x, y;
    while(cin >> x >> y){
        if(x<y) swap(x, y);
        cout << GCD(x, y) << endl;
    }
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int gcd(int a,int b)
{
	if (a%b==0)
	{
		return(b);
    }
	else
	{
		return(gcd(b,a%b));
    }
}

int main(){

  int a,b;

  while(cin>>a>>b){
    if(a<b)swap(a,b);
    cout << gcd(a,b);
  }
  return 0;
}

C++: #include <iostream>
#include <string>



using namespace std;


int main(){
  int a,b;
  while (std::cin >> a>>b) {
    if(b>a){
      int t=b;
      b=a;
      a=t;
    }
    while (a%b!=0) {
      int p=a%b;
      a=b;
      b=p;
    }
    std::cout << b << '\n';
  }
}

C++: #include<iostream>
#include<algorithm>
using namespace std;

int main(){
	int n, m;

	while(cin >> n >> m){
		if(n < m) swap(n, m);

		while(n % m != 0){
			int d = n % m;
			n = m;
			m = d;
		}
		cout << m << endl;
	}
}

C++: #include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b){
if(a<b)swap(a,b);
while(b){
a=a%b;
swap(a,b);
}
cout<<a<<endl;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int *a, *b, s, t, c;
	int p, q;
	a = &p;
	b = &q;
	while(cin >> p >> q){
		s = *a;
		t = *b;
		c = 1;
		for(int tmp = (*a > *b)? *b : *a, i = 2; i <= tmp; i++){
			while(s%i == 0 && t%i == 0){
				s /= i;
				t /= i;
				tmp /= i;
				c *= i;
			}
		}
		cout << c << " " << endl;
	return 0;
}