for(s in strsplit(readLines("stdin"),"")){for(x in(1+0:length(s))[!1:0])cat(sort(s[x-0:1])[1]);cat(" ")}