#include <bits/stdc++.h>
using namespace std;
int data[2][50];
int answer[2][50];

int gcd(int a,int b){
    int c;
    if(a<b){
        a+=b;
        b=a-b;
        a-=b;
    }
    while(b!=0){
        c=a%b;
        a=b;
        b=c;
    }
    return(a);
}

int main(){
    for(int i=0;i<50;i++){
        cin>>data[0][i]>>data[1][i];
    }
    for(int i=0;i<50;i++){
        answer[0][i]=gcd(data[0][i],data[1][i]);
        answer[1][i]=data[0][i]*data[1][i]/answer[0][i];
    }
    for(int i=0;i<50;i++){
        cout<<answer[0][i]<<answer[1][i];
    }
    cout<<endl;
}