print the last K lines of an input file