import sys, random print '\n'.join(l.strip() for l in random.sample(open(sys.argv[1]).readlines(), int(sys.argv[2])))