{"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\"\u003eIn this problem, you are given several strings that contain only digits from \u00270\u0027 to \u00279\u0027, inclusive.\u003cbr\u003eAn example is shown below.\u003cbr\u003e101\u003cbr\u003e123\u003cbr\u003eThe set S of strings is consists of the N strings given in the input file, and all the possible substrings of each one of them.\u003cbr\u003eIt\u0027s boring to manipulate strings, so you decide to convert strings in S into integers.\u003cbr\u003eYou can convert a string that contains only digits into a decimal integer, for example, you can convert \"101\" into 101, \"01\" into 1, et al.\u003cbr\u003eIf an integer occurs multiple times, you only keep one of them. \u003cbr\u003eFor example, in the example shown above, all the integers are 1, 10, 101, 2, 3, 12, 23, 123.\u003cbr\u003eYour task is to calculate the remainder of the sum of all the integers you get divided by 2012.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are no more than 20 test cases.\u003cbr\u003eThe test case starts by a line contains an positive integer N.\u003cbr\u003eNext N lines each contains a string consists of one or more digits.\u003cbr\u003eIt\u0027s guaranteed that 1≤N≤10000 and the sum of the length of all the strings ≤100000.\u003cbr\u003eThe input is terminated by EOF.\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"An integer between 0 and 2011, inclusive, for each test case."}},{"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\u003e5\r\n101\r\n123\r\n09\r\n000 \r\n1234567890\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e202\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}