while True:
  try:
    m,n = map(int, input().split())
  except EOFError:
    break
  LCM = m * n
  if m < n:
    m,n = n,m

  # calculating GCD
  while True:
    if m % n == 0:
      GCD = n
      break
    else:
      m, n = n, m % n

  # calculating LCM
  LCM = LCM // GCD

  print(GCD,LCM) while True:
  try:
    m,n = map(int, input().split())
  except EOFError:
    break
  LCM = m * n
  if m < n:
    m,n = n,m

  # calculating GCD
  while True:
    if m % n == 0:
      GCD = n
      break
    else:
      m, n = n, m % n

  # calculating LCM
  LCM = LCM // GCD

  print(GCD,LCM) True try:
    m,n = map(int, input().split())
  except EOFError:
    break
   except EOFError:
    break
   break m,n = map(int, input().split()) m map(int, input().split()) map int input().split() ().split () input split n LCM = m * n LCM m * n m n if m < n:
    m,n = n,m

  # calculating GCD
   m < n m n m,n = n,m m n n m while True:
    if m % n == 0:
      GCD = n
      break
    else:
      m, n = n, m % n

  # calculating LCM
   True if m % n == 0:
      GCD = n
      break
    else:
      m, n = n, m % n

  # calculating LCM
   m % n == 0 m % n m n 0 GCD = n GCD n break m, n = n, m % n m n n m % n m n LCM = LCM // GCD LCM LCM // GCD LCM GCD print(GCD,LCM) print GCD LCM n = map(int, input().split()) map(int, input().split()) n m,n = n,m n m m, n = n, m % n n m GCD = n n GCD LCM = m * n m * n LCM n = n, m % n m % n n n = n,m m n LCM = LCM // GCD LCM // GCD LCM m,n = map(int, input().split()) map(int, input().split()) m
while True:
  try:
    m,n = map(int, input().split())
  except EOFError:
    break
  LCM = m * n
  if m < n:
    m,n = n,m

  # calculating GCD
  while True:
    if m % n == 0:
      GCD = n
      break
    else:
      m, n = n, m % n

  # calculating LCM
  LCM = LCM // GCD

  print(GCD,LCM)
