{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"Section1\"\u003e\r\n\t\u003cp class\u003d\"MsoNormal\"\u003e\r\n\t\t\u003cspan style\u003d\"color: windowtext;\"\u003eGiven two strings of lowercase letters, \u003c/span\u003e\u003cb style\u003d\"color: windowtext;\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: windowtext;\"\u003e and \u003c/span\u003e\u003cb style\u003d\"color: windowtext;\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: windowtext;\"\u003e, print the longest string \u003c/span\u003e\u003cb style\u003d\"color: windowtext;\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: windowtext;\"\u003e of lowercase letters such that there is a permutation of \u003c/span\u003e\u003cb style\u003d\"color: windowtext;\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: windowtext;\"\u003e that is a subsequence of \u003c/span\u003e\u003cb style\u003d\"color: windowtext;\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: windowtext;\"\u003e and there is a permutation of \u003c/span\u003e\u003cb style\u003d\"color: windowtext;\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: windowtext;\"\u003e that is a subsequence of \u003c/span\u003e\u003cb style\u003d\"color: windowtext;\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: windowtext;\"\u003e.\u003c/span\u003e\u003c/p\u003e\r\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003eInput file contains several lines of input. Consecutive two lines make a set of input. That means in the input file line\u0026nbsp;\u003c/span\u003e\u003cb style\u003d\"color: rgb(0, 0, 0);\"\u003e1\u003c/b\u003e\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003e\u0026nbsp;and\u0026nbsp;\u003c/span\u003e\u003cb style\u003d\"color: rgb(0, 0, 0);\"\u003e2\u003c/b\u003e\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003e\u0026nbsp;is a set of input, line\u0026nbsp;\u003c/span\u003e\u003cb style\u003d\"color: rgb(0, 0, 0);\"\u003e3\u003c/b\u003e\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003e\u0026nbsp;and\u0026nbsp;\u003c/span\u003e\u003cb style\u003d\"color: rgb(0, 0, 0);\"\u003e4\u003c/b\u003e\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003e\u0026nbsp;is a set of input and so on. The first line of a pair contains\u0026nbsp;\u003c/span\u003e\u003cb style\u003d\"color: rgb(0, 0, 0);\"\u003e\u003ci\u003ea\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003e\u0026nbsp;and the second contains\u0026nbsp;\u003c/span\u003e\u003cb style\u003d\"color: rgb(0, 0, 0);\"\u003e\u003ci\u003eb\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003e. Each string is on a separate line and consists of at most\u0026nbsp;\u003c/span\u003e\u003cb style\u003d\"color: rgb(0, 0, 0);\"\u003e1000\u003c/b\u003e\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003e\u0026nbsp;lowercase letters.\u003c/span\u003e\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003eFor each set of input, output a line containing\u0026nbsp;\u003c/span\u003e\u003cb style\u003d\"color: rgb(0, 0, 0);\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003e. If several\u0026nbsp;\u003c/span\u003e\u003cb style\u003d\"color: rgb(0, 0, 0);\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/b\u003e\u003cspan style\u003d\"color: rgb(0, 0, 0);\"\u003e\u0026nbsp;satisfy the criteria above, choose the first one in alphabetical order.\u003c/span\u003e\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\npretty\r\nwomen\r\nwalking\r\ndown\r\nthe\r\nstreet\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\r\ne\r\n\u003cspan data-scayt_word\u003d\"nw\" data-scaytid\u003d\"3\"\u003enw\u003c/span\u003e\r\net\u003c/pre\u003e"}}]}