#include"stdio.h"
int main()
{
int a,b,r,s,v,t;
scanf("%d,%d",&a,&b);
v=a;
t=b;
do
{
r=a%b;
a=b;
b=r;
}
while(r!=0);
s=v/a*t;
printf("%d,%d",a,s);
return 0;
}
10-31
168