{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\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. \u003cbr\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-strings as 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\u003cbr\u003eA combination of a cranberry and a boysenberry would therefore be called a \"boysecranberry\" or a \"craboysenberry\", for example. \u003cbr\u003e\u003cbr\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. \u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"Each line of the input 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\u003cbr\u003eInput is terminated by end of file. \u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For 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.\u003cbr\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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"}}]}