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 <bits/stdc++.h>
using namespace std;

//left is greater
void swp(int* i, int* j){
  if(*i < *j){
    int tmp = *i;
    *i = *j;
    *j = tmp;
  }
}

int main(void){
  int n1, n2;
  while(cin >> n1 >> n2){
    swp(&n1, &n2);
    while(n2 > 0){
      n1 = n1 % n2;
      swap(n1, n2);
    }
    cout << n1 << endl;
  }
  return 0;
}

C++: using namespace std;

int main(void){
  int a,b,tmp;

  while(cin>>a>>b){
    if(a<b) swap(a,b);

    while(1){
      if(a%b==0) break;

      tmp = a%b;
      a = b;
      b = tmp;
    }
    cout<<b<<endl;
  }

  return 0;
}

C++: #include<iostream>
using namespace std;
int gcd( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd
int main(){
  int m,n;
  while(cin>>m>>n) cout << gcd(m,n) << endl;
  return 0;
}

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

int GCD(int a,int b){
    int tmp;
    
    if(!(a >= b)){
        tmp = a;
        a = b;
        b = tmp;
    }
    
    
    
    for(;;){
        if(!b) break;
        a %= b;
        tmp = a;
        a = b;
        b = tmp;
    }
    
    return a;
}

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

C++: //include
//------------------------------------------
#include <bits/stdc++.h>

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)

//repetition
//------------------------------------------
#define loop(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  loop(i,0,n)

//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

// output vector
// ------------------------------------------
namespace std {
    template<typename T> ostream & operator<<(ostream& os, vector<T> const& v){
        for(auto it=v.begin(); it!=v.end(); ++it){
            os << *it << (it+1==v.end() ? "" : ",");
        }
        return os;
    }
}

//clear memory
#define clr(a) memset((a), 0 ,sizeof(a))
 
int lcm(int a,int b){
   return a*b/__gcd(a,b);
}
 
bool prime_number(int n){
   if(n==0||n==1) return false;
   vb a(n+1);
   fill(all(a),true);
   loop(i,2,n/2+1){
      if(!a[i]) continue;
      for(int j=2;i*j<=n;j++){
         a[i*j]=false;
      }
   }
   return a[n];
}

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

C++: #include <bits/stdc++.h>

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

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

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

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

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


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

C++: #include <iostream>

using namespace std;

int gcd(int, int);

int main(void){
    for(int a, b; cin >> a >> b; cout << gcd(a, b) << endl);

    return 0;
}

int gcd(int a, int b){
    int r;
    while((r = a % b) != 0){
        a = b;
        b = r;
    }
    
    return b;
}

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

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

int main(void){
  unsigned int a,b;
  while(scanf("%u %u",&a,&b)) cout<<euclid(a,b)<<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(void)
{
	int a,b;
	while(cin >> a >> b){
		if(a>b) cout << gcd(a,b) << endl;
		else cout << gcd(b,a) << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

vector<ll> divisor(ll n) {
    vector<ll> res;
    for(ll i = 2; i*i <= n; i++) {
        if(n % i == 0) {
            res.push_back(i);
            if(i != n/i) res.push_back(n/i);
        }
    }
    return res;
}

int main() {
    int a,b;
    while(cin >> a >> b) {
        map<int,int> m;
        m[a]++;
        m[b]++;

        vector<ll> v = divisor(a);
        rep(i,v.size()) {
            m[v[i]]++;
        }

        v = divisor(b);
        rep(i,v.size()) {
            m[v[i]]++;
        }

        int ans = 1;
        map<int,int>::iterator ite;
        for(ite = m.begin(); ite != m.end(); ite++) {
            if(ite->second == 2) {
                ans = max(ans, ite->first);
            }
        }

        cout << ans << endl;
    }

    return 0;
}

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

using namespace std;

int main()
{
	int a, b;

	cin >> a >> b;

	cout << max(a, b) - min(a, b) << endl;

	return (0);
}

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

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

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;

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

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