get;$/=lines>>.words;put join " ",grep({.[1]ne.[2]},list ^$0+1 Z$0 Z$1)