#!/usr/bin/env python from itertools import permutations report = [] with open("input01.txt","r") as f: report = [int(i) for i in f.readlines()] for p in permutations(report, 3): if sum(p) == 2020: print(p[0]*p[1]*p[2]) break;