Buggy python submission (verdict: Time Limit Exceeded):
import itertools

while 1:
    try:
        a, b= map(int, raw_input().split())
        GCD = a * b
        LCM = 0
        # GCD
        for i, j in itertools.product(range((a if a > b else b) / 2), repeat=2):
          if a * (i+1) == b * (j+1) and GCD > a * (i+1):
            GCD = a * (i+1)
        # LCM 
        for i in range(a if a > b else b, 1, -1):
            if a % i == 0 and b % i == 0:
                LCM = i
                break
        print str(GCD) + " " + str(LCM)
    except:
        break

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

ans_list = []

while 1:
    try:
        a, b= map(int, raw_input().split())
        GCD = a * b
        LCM = 0
        # GCD
        for i, j in itertools.product(range((a if a > b else b) / 2), repeat=2):
            if a * (i+1) == b * (j+1) and GCD > a * (i+1):
                GCD = a * (i+1)
        # LCM
        for i in range(a if a > b else b, 1, -1):
            if a % i == 0 and b % i == 0:
                LCM = i
                break
        ans_list.append(str(GCD) + " " + str(LCM))
    except:
        for s in ans_list:
            print s
        break

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

ans_list = []

while 1:
    ab = raw_input()
    if ab != "":
        a, b= map(int, ab.split())
    else:
        for s in ans_list:
            print s
        break
    GCD = a * b
    LCM = 0
    # GCD
    for i, j in itertools.product(range((a if a > b else b) / 2), repeat=2):
        if a * (i+1) == b * (j+1) and GCD > a * (i+1):
            GCD = a * (i+1)
    # LCM
    for i in range(a if a > b else b, 1, -1):
        if a % i == 0 and b % i == 0:
            LCM = i
            break
    ans_list.append(str(GCD) + " " + str(LCM))

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import sys

ans_list = []

while 1:
    ab = raw_input()
    if ab != "":
        a, b= map(int, ab.split())
    else:
        for s in ans_list:
            print s
        break
    GCD = a * b
    LCM = 0
    # GCD
    for i, j in itertools.product(range((a if a > b else b) / 2), repeat=2):
        if a * (i+1) == b * (j+1) and GCD > a * (i+1):
            GCD = a * (i+1)
    # LCM
    for i in range(a if a > b else b, 1, -1):
        if a % i == 0 and b % i == 0:
            LCM = i
            break
    ans_list.append(str(GCD) + " " + str(LCM))

sys.exit()

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

while 1:
    try:
      a, b= map(int, raw_input().split())
    except:
      break
    GCD = a * b
    LCM = 0
    # GCD
    for i, j in itertools.product(range((a if a > b else b) / 2), repeat=2):
        if a * (i+1) == b * (j+1) and GCD > a * (i+1):
            GCD = a * (i+1)
    # LCM
    for i in range(a if a > b else b, 1, -1):
        if a % i == 0 and b % i == 0:
            LCM = i
            break
    print "{} {}".format(str(GCD), str(LCM))

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

while 1:
    try:
      a, b= map(int, raw_input().split())
    except:
      break
    GCD = a * b
    LCM = 0
    # GCD
    for i, j in itertools.product(range((a if a > b else b) / 2), repeat=2):
        if a * (i+1) == b * (j+1) and GCD > a * (i+1):
            GCD = a * (i+1)
    # LCM
    for i in range(a if a > b else b, 1, -1):
        if a % i == 0 and b % i == 0:
            LCM = i
            break
    print "{} {}".format(str(GCD), str(LCM))

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

while 1:
    try:
      a, b= map(int, raw_input().split())
    except:
      break
    GCD = a * b
    LCM = 0
    # GCD
    for i, j in itertools.product(range((a if a > b else b) / 2), repeat=2):
        if a * (i+1) == b * (j+1) and GCD > a * (i+1):
            GCD = a * (i+1)
    # LCM
    flag = 0
    for i in range(a if a > b else b, 1, -1):
        if a % i == 0 and b % i == 0 and flag == 0:
            LCM = i
            flag += 1
    print "{} {}".format(str(GCD), str(LCM))

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

while 1:
    try:
      a, b= map(int, raw_input().split())
      GCD = a * b
      LCM = 0
      # GCD
      for i, j in itertools.product(range((a if a > b else b) / 2), repeat=2):
          if a * (i+1) == b * (j+1) and GCD > a * (i+1):
              GCD = a * (i+1)
      # LCM
      flag = 0
      for i in range(a if a > b else b, 1, -1):
          if a % i == 0 and b % i == 0 and flag == 0:
              LCM = i
              flag += 1
      print "{} {}".format(str(GCD), str(LCM))
    except:
      break

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Runtime Error):
while True:
  a,b = map(int, raw_input().split())
  GCD = a if a > b else b
  LCM = a * b
  tmp = GCD
  #GCD 最大公約数
  #LCM 最小公倍数
  for i in range(tmp, 0, -1):
    if a % i == 0 and b % i == 0: GCD = i
  tmp = LCM
  for i in range(tmp, 0, -1):
    if i % a == 0 and i % i == 0: LCM = i
  print str(GCD) + " " + str(LCM)

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Runtime Error):
while True:
  a,b = map(int, raw_input().split())
  GCD = a if a > b else b
  LCM = a * b
  tmp = GCD
  for i in range(tmp, 0, -1):
    if a % i == 0 and b % i == 0: GCD = i
  tmp = LCM
  for i in range(tmp, 0, -1):
    if i % a == 0 and i % i == 0: LCM = i
  print str(GCD) + " " + str(LCM)

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Runtime Error):
while True:
  try:
    a,b = map(int, raw_input().split())
    GCD = a if a > b else b
    LCM = a * b
    tmp = GCD
    for i in range(tmp, 0, -1):
      if a % i == 0 and b % i == 0: GCD = i
    tmp = LCM
    for i in range(tmp, 0, -1):
      if i % a == 0 and i % i == 0: LCM = i
    print str(GCD) + " " + str(LCM)
  except EOFError:
    break

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break

Buggy python submission (verdict: Runtime Error):
while True:
  try:
    a,b = map(int, raw_input().split())
    GCD = a if a > b else b
    LCM = a * b
    tmp = GCD
    for i in range(tmp, 0, -1):
      if a % i == 0 and b % i == 0: GCD = i
    tmp = LCM
    for i in range(tmp, 0, -1):
      if i % a == 0 and i % i == 0: LCM = i
    print str(GCD) + " " + str(LCM)
  except EOFError:
    break

Fixed submission:
def get_gcd(a,b):
	if a > b: a, b = b, a
	if b % a == 0:
		return a
	else:
		return get_gcd(a, b % a)

def get_lcm(a,b,g):
	return a * b / g

while True:
	try:
		a,b = map(int, sorted(raw_input().split()))
		GCD = get_gcd(a,b)
		LCM = get_lcm(a,b,GCD)
		print "{} {}".format(GCD, LCM)
	except EOFError:
		break