2 of 2 added 51 characters in body

this is a job for awk

awk '(NR%50==15) || (NR%50==25)' inputfile

edit: I was mislead by sed instruction in OP.