Needed shellscript for the following

hi all,
i need the shell script for he below requirement
i had the input file as
a_20121217_035120( frmat is a_date_hhmmss)
a_20121217_035128
a_20121217_035456
a_20121217_035767
a_20121217_035178
a_20121217_035189
a_20121217_035220

my output should be
a_20121217_035456
a_20121217_035767
a_20121217_035178
a_20121217_035189
a_20121217_035220

i should have the last five versions of the file as my output...

thanks in advance
hemanth saikumar.