for(c<-" "*50;s=readLine;a=s split c map(t=>t map(t indexOf _))if a(0)==a(1))println(s)