def part1(numbers):
for i in range(len(numbers)):
a = numbers[i]
b = 2020 - a
if b in numbers[i:]:
print(a * b)
def part2(numbers):
for i in range(len(numbers)):
for j in range(i, len(numbers)):
a = numbers[i]
b = numbers[j]
c = 2020 - a - b
if c in numbers[j:]:
print(a * b * c)
with open('input.txt') as fh:
numbers = [int(l.strip()) for l in fh.readlines()]
part1(numbers)
part2(numbers)