import zipfile,urllib2,tempfile,sys data=[[] for _ in range(20)] for i in range(1,21): response = urllib2.urlopen('http://yukicoder.me/problems/no/%d/testcase.zip'%i) temp = tempfile.TemporaryFile() temp.write(response.read()) temp.seek(0) with zipfile.ZipFile(temp) as zf: for zi in zf.infolist(): data[i-1].append(zf.read(zi)[:20]) temp.close() n = sys.stdin.read()[:20] print " ".join([str(i) for i in range(1,21) if any([n==j for j in data[i-1]])])