target_steps = 10000
meet_target = False
total_steps = 0
while total_steps < target_steps:
    command = input()
    if command == 'Going home':
        last_steps = int(input())
        total_steps += last_steps
        break
    current_steps = int(command)
    total_steps += current_steps
difference = abs(target_steps - total_steps)
if total_steps > target_steps:
    print(f'Goal reached! Good job!')
    print(f'{difference} steps over the goal!')
else:
    print(f'{difference} more steps to reach goal.')
target_steps = 10000
meet_target = False
total_steps = 0
while total_steps < target_steps:
    command = input()
    if command == 'Going home':
        last_steps = int(input())
        total_steps += last_steps
        break
    current_steps = int(command)
    total_steps += current_steps
difference = abs(target_steps - total_steps)
if total_steps > target_steps:
    print(f'Goal reached! Good job!')
    print(f'{difference} steps over the goal!')
else:
    print(f'{difference} more steps to reach goal.')