{"trustable":false,"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\u003e\nSameep is interested in combinatorics. He likes to count the number of different ways to form a string with certain restrictions. \n\u003c/p\u003e\n\u003cp\u003e\nToday he is looking at a specific problem. First, he numbers \u003cb\u003ea-z\u003c/b\u003e from \u003cb\u003e1 to 26\u003c/b\u003e and \u003cb\u003eA-Z\u003c/b\u003e from \u003cb\u003e27-52\u003c/b\u003e. He then takes the first m characters and wants to count the number of strings of length \u003cb\u003en\u003c/b\u003e that can be formed using these \u003cb\u003em\u003c/b\u003e characters. This problem was too easy so he decided to add \u003cb\u003ek\u003c/b\u003e restrictions. Each restriction is a pair of characters which means that these two characters can’t be a substring of the desired string. Count the number of desired string modulo \u003cb\u003e10\u003csup\u003e9\u003c/sup\u003e+7\u003c/b\u003e\n\u003c/p\u003e\n"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\nThe first line contains \u003cb\u003e3\u003c/b\u003e integers \u003cb\u003en,m,k (1\u0026le;n\u0026le;10\u003csup\u003e15\u003c/sup\u003e, 1\u0026le;m\u0026le;52, 0\u0026le;k\u0026le;m\u003csup\u003e2\u003c/sup\u003e)\u003c/b\u003e as described above.\n\nThe next \u003cb\u003ek\u003c/b\u003e lines contain a string of length \u003cb\u003e2\u003c/b\u003e that is restricted to be a substring in the desired string.\n\u003c/p\u003e\n"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint a single integer — the sought number modulo \u003cb\u003e\u003cspan class\u003d\"tex-span\"\u003e1000000007\u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e(10\u003csup class\u003d\"upper-index\"\u003e9\u003c/sup\u003e + 7)\u003c/span\u003e.\u003c/b\u003e\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3 3 2\u003cbr\u003eab\u003cbr\u003eba\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e17\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3 3 0\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e27\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e2 1 1\u003cbr\u003eaa\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e0\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the third sample test case, the only possible string is \u003cb\u003eaa\u003c/b\u003e but it is restricted. Hence the answer is \u003cb\u003e0\u003c/b\u003e \u003c/p\u003e"}}]}