m,n=map(int,input().split(',')) c=a%b while c!=0 : a=b b=c c=a%b print("GCD:{}, LCM:{}".format(b,m*n//b))