this is a job for `awk`

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

edit: I was mislead by sed instruction in OP.