{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eOne day Maria Ivanovna found a Sasha\u0027s piece of paper with a message dedicated to Olya. Maria Ivanovna wants to know what is there in a message, but unfortunately the message is ciphered. Maria Ivanovna knows that her students usually cipher their messages by replacing each letter of an original message by some another letter. Replacement works in such way that same letters are always replaced with some fixed letter, and different letters are always replaced by different letters. \u003c/p\u003e\u003cp\u003eMaria Ivanovna supposed that the message contains answers to the final exam (since its length is equal to the number of final exam questions). On the other hand she knows that Sasha\u0027s answer are not necessary correct. There are \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eK\u003c/i\u003e\u003c/span\u003e possible answers for each questions. Of course, Maria Ivanovna knows correct answers.\u003c/p\u003e\u003cp\u003eMaria Ivanovna decided to decipher message in such way that the number of Sasha\u0027s correct answers is maximum possible. She is very busy now, so your task is to help her.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eFirst line contains length of both strings \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eN\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 2 000 000\u003c/span\u003e) and an integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eK\u003c/i\u003e\u003c/span\u003e\u0026nbsp;— number of possible answers for each of the questions (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003eK\u003c/i\u003e ≤ 52\u003c/span\u003e). Answers to the questions are denoted as Latin letters \u003cspan class\u003d\"tex-font-style-tt\"\u003eabcde...xyzABCDE...XYZ\u003c/span\u003e in the order. For example for \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eK\u003c/i\u003e \u003d 6\u003c/span\u003e, possible answers are \u003cspan class\u003d\"tex-font-style-tt\"\u003eabcdef\u003c/span\u003e and for \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eK\u003c/i\u003e \u003d 30\u003c/span\u003e possible answers are \u003cspan class\u003d\"tex-font-style-tt\"\u003eabcde...xyzABCD\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eSecond line contains a ciphered message string consisting of Latin letters.\u003c/p\u003e\u003cp\u003eThird line contains a correct answers string consisting of Latin letters.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIn the first line output maximum possible number of correct Sasha\u0027s answers.\u003c/p\u003e\u003cp\u003eIn the second line output cipher rule as the string of length \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eK\u003c/i\u003e\u003c/span\u003e where for each letter from the students\u0027 cipher (starting from \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027a\u0027\u003c/span\u003e as mentioned above) there is specified which answer does it correspond to.\u003c/p\u003e\u003cp\u003eIf there are several ways to produce maximum answer, output any of them.\u003c/p\u003e"}},{"title":"Examples","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\u003e10 2\naaabbbaaab\nbbbbabbbbb\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e7\nba\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e10 2\naaaaaaabbb\nbbbbaaabbb\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6\nab\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e9 4\ndacbdacbd\nacbdacbda\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e9\ncdba\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}