I have data like below
ABCB9
rs11057374
rs7138100
rs11057375
rs12309481
END
ABCC10
rs1214748
END
ABCC2
rs928578
rs10883039
END
ABCC4
rs12428035
rs9561933
rs9302086
rs3848077
rs3099362
END
by using this data, I want to make the output like below
rs11057374 ABCB9
rs7138100 ABCB9
rs11057375 ABCB9
rs12309481 ABCB9
rs1214748 ABCC10
rs928578 ABCC2
rs10883039 ABCC2
rs12428035 ABCC4
rs9561933 ABCC4
rs9302086 ABCC4
rs3848077 ABCC4
rs3099362 ABCC4
It is not necessary whether there are blank and "END"
How make the this output in R or linux?