#!/usr/bin/env python3

import sys

if len(sys.argv)<3:
	sys.exit("You have to provide EXACTLY TWO argument")

filename = sys.argv[1]
n = int(sys.argv[2])
allcnt=0
cnt=0
with open(filename,"r") as f:
	for line in f:
		if line.startswith("#"):
			allcnt += 1
	f.seek(0,0) # go back to the first line
	for line in f:
		if line.startswith("#"):
			cnt += 1
			if allcnt - n == cnt - 1:
				print(line.rstrip())
				break
	for line in f:
		print(line.rstrip())
