print sort map{sub{map{push@_,shift;"@_\n"}@_}->(split)}<>