{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n\t\u003cp\u003eThe company \"21st Century Fruits\" has specialized in creating new sorts of fruits by transferring genes from one fruit into the genome of another one. Most times this method doesn\u0027t work, but sometimes, in very rare cases, a new fruit emerges that tastes like a mixture between both of them.\u003c/p\u003e\r\n\u003cp\u003eA big topic of discussion inside the company is \"How should the new creations be called?\" A mixture between an apple and a pear could be called an apple-pear, of course, but this doesn\u0027t sound very interesting. The boss finally decides to use the shortest string that contains both names of the original fruits as sub-sequences of the new name. For instance, \"applear\" contains \"apple\" and \"pear\" (APPLEar and apPlEAR), and there is no shorter string that has the same property. \u003cbr\u003e A combination of a cranberry and a boysenberry would therefore be called a \"boysecranberry\" or a \"craboysenberry\", for example.\u003c/p\u003e\r\n\u003cp\u003eYour job is to write a program that computes such a shortest name for a combination of two given fruits. Your algorithm should be efficient, otherwise it is unlikely that it will execute in the alloted time for long fruit names.\u003c/p\u003e\r\n\u003ch3\u003eInput Specification\u003c/h3\u003e\r\n\u003cp\u003eEach line of the input file contains two strings that represent the names of the fruits that should be combined. All names have a maximum length of 100 and only consist of alphabetic characters.\u003cbr\u003e Input is terminated by end of file.\u003c/p\u003e\r\n\u003ch3\u003eOutput Specification\u003c/h3\u003e\r\n\u003cp\u003eFor each test case, output the shortest name of the resulting fruit on one line. If more than one shortest name is possible, any one is acceptable.\u003c/p\u003e\r\n\u003ch3\u003eExample\u003c/h3\u003e\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eapple peach\r\nananas banana\r\npear peach\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eappleach\r\nbananas\r\npearch\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c/div\u003e"}}]}