Itertools Product Hackerrank Solution Python