python template for codejam; solved contest 351101 A