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>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<cmath>
#include<complex>
#include<iomanip>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)
#define pi 3.14159265358979

int g(int x,int y){
	int a=max(x,y),b=min(x,y);
	if(a%b==0) return b;
	else return g(b,a%b);
}

int main(void){

	int x,y;
	while(cin >> x >> y){

		cout << g(x,y) << endl;

	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
//#define int long long
using namespace std;

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

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

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

int main() {
    int m, n;
    while (cin >> m >> n) {
        if (n < m) {
            int temp = m;
            m = n;
            n = temp;
        }
        while (m > 0) {
            int temp = m;
            m = n % m;
            n = temp;
        }
        cout << n << endl;
    }
}

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

int gcd(int x, int y) {
	if (y == 0) return x;
	else return gcd(y, x % y);
}

int main(){
    int a, b;
    while( scanf("%d %d", &a, &b) != EOF ){
        cout<<gcd(a,b)<<endl;
    }
    return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif

#define int long long
#define FILE_IO freopen("input.txt","r",stdin)/#define int long long
#define f first
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
#define bp __builtin_popcount
#define debug(x) cerr << #x << " = " << x << endl;

const int MOD = 1e9 + 7;
const int INF = 1e18;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>void print(T t){for (auto &it : t) cout << it << " ";}
inline int powerexp(int a, int b, int m = MOD){ int res = 1;while(b){if(b&1)res = res * a % m;a = a * a % m,b >>= 1;}return res % m;}
inline int modinv(int a){ return powerexp(a,MOD-2,MOD);}
inline int lcm(int a, int b){ int g = __gcd(a,b);return a/g*b;}
inline int add(int x, int y){ x += y; if (x >= MOD) x -=  MOD; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % MOD;}
inline int sub(int x, int y){ x -= y; if (x<0) x += MOD; return x ;}

//-------------------< start here >-------------------------// 

void solve(){
    int a, b;
    while (cin >> a >> b){
      while (a != b){
		  a > b ? a -= b : b -= a;  
		}
	cout << a << endl;
   }
}

//-----------------------------
//comment from here for TOPCODER 
int32_t main(){
   IOS;
   solve();
   //find();
   #ifdef LOCAL_DEFINE
   cerr << "time elapsed " << (double)clock()/CLOCKS_PER_SEC << endl;
   #endif
}

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

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

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

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

int main(){
  int a, b;
  while( scanf("%d %d", &a, &b ) != 2 ){
    while( a != b ){
      if( a > b )
	a -= b;
      else
	b -= a;
    }
    printf("%d\n", a);
  }
  return 0;
}

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

using namespace std;

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

int main() {
  int a, b;
  while (scanf("%d%d", &a, &b) == 2) {
    if (a < b) swap(a, b);
    printf("%d\n", gcd(a, b));
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 1000000
int GCD(int x,int y){
    return y ? GCD(y,x%y) : x;
}
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b){
        cout << GCD(a,b) << endl;
    }
    return 0;
}

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

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 != EOF && n != EOF) )
	{
		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 main() { 
  int a, b;
  while(cin >> a >> b) { 
    while(a!=b) {  
      if(a > b) a-=b;   
      else b-=a; 
    } 
   cout << a << endl; 
  } 
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b;
    while (cin>>a>>b) {
        while (a%b!=0) {
            int tmp=b;
            b=a%b;
            a=tmp;
        }
        cout<<b<<endl;
    }
}

C++: ??????

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

int main(){
    int x,y;
    
    while(cin >> x >> y){
        int tmp;
        
        if(x < y){
            tmp = x;
            x = y;
            y = tmp;
        }
        
        while(y){
            x %= y; tmp = x;
            x = y; y = tmp;
        }
        cout << x << endl;
    }
    
    return 0;
}

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

int main(){
	int x,y;
	while(cin >> x >> y){
		if(x < y){
			x^=y;
			y^=x;
			x^=y;
		}
		while(y){
			x %= y;
			if(x < y){
				x^=y;
				y^=x;
				x^=y;
			}
		}
		cout << x << endl;
	}
}

C++: main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",__gcd(a,b));}

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

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

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

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

    return 0;
}

C++: #include <iostream>

int main(){

int x,y;

cin >> x >> y;

while(x != y){
if(x > y)x = x - y;
if(y > x)y = y - x;
}
cout << x;
}

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

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

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

C++: #include <stdio.h>

int main(void)
{
	int x, y;
	int a, b;
	int tmp;
	
	while (scanf("%d %d", &x, &y) != EOF){
		a = x;
		b = y;
		while (a % b != 0){
			tmp = a % b;
			a = b;
			b = tmp;
		}
		printf("%d\n", b);
	}
	return (0);
}

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;

int a,b;

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

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