from random import randint while True: a,b = (randint(0,1000) for _ in range(2)) if a%2 and b%2: ans=a**2,b**2 else: ans=a+b