{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\n In this problem, you are given several strings that contain only digits from \u00270\u0027 to \u00279\u0027, inclusive.\u003cbr\u003e\n An example is shown below.\u003cbr\u003e\n 101\u003cbr\u003e\n 123\u003cbr\u003e\n The 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\u003e\n It\u0027s boring to manipulate strings, so you decide to convert strings in S into integers.\u003cbr\u003e\n You 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\u003e\n If an integer occurs multiple times, you only keep one of them. \u003cbr\u003e\n For example, in the example shown above, all the integers are 1, 10, 101, 2, 3, 12, 23, 123.\u003cbr\u003e\n Your task is to calculate the remainder of the sum of all the integers you get divided by 2012.\u003cbr\u003e\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are no more than 20 test cases.\u003cbr\u003e\nThe test case starts by a line contains an positive integer N.\u003cbr\u003e\nNext N lines each contains a string consists of one or more digits.\u003cbr\u003e\nIt\u0027s guaranteed that 1≤N≤10000 and the sum of the length of all the strings ≤100000.\u003cbr\u003e\nThe 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\u003e\u003cpre\u003e5\r\n101\r\n123\r\n09\r\n000 \r\n1234567890\r\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e202\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}