a=" "..io.read"*a"for l in a:gfind"%a+"do i=""repeat i=l:sub(1,#i+1)_,c=a:gsub("%s"..i,1)until c<2 print(i)end