a=[input()] for*s,in a:a+=a[-1][1:]or map(print,sorted(a)),