Leet Code #1793

1793. Maximum Score of a Good Subarray

Link to Problem.

Lessons will be learned, and things will get easier

Iteration One

Goals

  • Working Solution for all edge cases

Notes

from typing import List

# pre: nums are all positive numbers
class Solution:
    def scoreSubarray(self, nums: List[int], i: int, j: int) -> int:
        if i == j:
            return nums[i]
        else:
            return min(nums[i:j]) * (j - i)
    
    def maximumScore(self, nums: List[int], k: int) -> int:
        n : int = len(nums)
        res : int = self.scoreSubarray(nums, k, k)

        for i in range(k,-1,-1):
            for j in range(k + 1,n+1,1):
                tmp = self.scoreSubarray(nums, i, j)
                if tmp > res:
                    res = tmp
                res = max(res, self.scoreSubarray(nums, i, j))
                
        return res


# Lets test the solution defined above
inputs = [
    {"nums" : [1,4,3,7,4,5], "k" : 3, "output" : 15},
    {"nums" : [8182,1273,9847,6230,52,1467,6062,726,4852,4507,2460,2041,500,1025,5524], "k" : 8, "output" : 9014},
    {"nums" : [6569,9667,3148,7698,1622,2194,793,9041,1670,1872], "k" : 5, "output" : 9732},
    {"nums" : [529,7655,4113,7929,7745,6149,2691,435,7858,978,5467,8761,2881,4175,359,9711,7157,1740,5214,7660,1113,614,4077,2859,2954,1170,3997,4526,2771,4046,3174,7126,3866,7603,5596,9587,1826,9228,9983,2487,7018,1130,1299,1389,5914,2926,5679,5781,5770,8705,9053,3449,9893,6042,4349,2008,2959,9730,5639,8813,5206,747,460,149,2553,4006,2012,8966,2245,2635,9089,7962,5879,9785,1069,7122,7926,9546,4557,5719,6926,2353,1887,2744,2240,472,7559,824,4320,8267,7210,4764,8368,3071,8973,7849,8704,2375,5130,5092,8311,6147,7692,6794,8280,4863,4932,4863,946,4243,7307,5061,3752,426,6352,1978,818,5604,3306,9034,9805,7900,8462,4473,1914,8449,113,8566,7671,9518,693,730,8064,2004,9584,8725,4392,468,3013,502,6472,4185,6380,471,4258,3424,8435,7470,5109,7228,486,8925,3130,1574,4454,9048,5824,679,5364,3804,5143,6714,5695,2806,7653,9153,26,3195,2856,4303,6914,270,9011,3325,7835,1770,8668,3395,1756,6702,743,2618,6841,7492,6068,9150,8852,5004,9610,6716,7053,4937,6209,2772,4454,3988,432,8097,9400,3194,5565,6266,2821,4769,5019,164,443,8620,695,8173,7705,5081,1376,6573,9364,7328,2513,8020,2361,4915,5346,7410,2379,5538,7560,9431,1049,9069,9616,9368,3998,3240,8006,3177,4380,794,8668,4685,3456,2257,2645,7269,2424,5209,4198,3086,6821,7598,3764,7505,6191,9018,7019,338,5606,1484,1962,1415,8423,6988,9140,8305,6196,2299,3397,8634,3855,2139,4924,7102,4662,6713,1056,5418,5982,940,3149,9245,637,8873,7651,2975,6447,5539,291,9119,7773,9287,4286,858,9111,5012,9499,1595,4408,918,5742,5134,9475,8427,9556,8422,4825,9747,522,266,9267,7351,5413,7374,8556,8014,6194,6076,3011,1612,217,6101,7673,5623,6757,5038,2615,3711,8296,7453,408,868,4090,1038,6549,7307,7886,3571,6450,1947,5236,8943,5827,1325,1278,9292,1930,7778,6039,3935,623,7886,256,1194,833,4219,3641,1047,2543,4442,9242,150,8148,1460,9650,5882,9647,431,7709,714,6345,6104,3240,6151,6310,7220,216,6452,3271,3368,1247,7870,8492,2124,1932,3524,5515,2911,8798,7242,1019,8154,3942,5654,5994,8323,449,1914,5680,2821,8399,1904,6356,8538,298,7418,2339,1672,2948,584,4877,2702,36,8044,1528,3815,799,8865,7043,5846,3204,4238,3012,2060,8169,9422,8049,8871,1517,819,6066,4821,7262,6131,9774,9210,9683,338,3573,3812,4398,5022,1313,9705,792,3644,3397,529,8340,2683,524,5635,6653,9852,8619,39,6060,4273,3026,7680,6861,4470,8,4094,4720,388,9344,7749,394,3603,8406,8713,9328,4423,3074,9966,694,4094,3627,6926,3558,4322,1720,3814,7277,5770,7077,9871,7872,4016,1196,7425,8843,8631,2500,142,991,9472,1603,7433,2955,5213,3083,9960,3993,8940,2675,5442,8308,6653,2105,4640,2020,8924,8918,2949,4949,5442,9580,2811,5205,7078,9779,5049,4455,3420,5586,6315,1629,101,5384,4917,7629,2731,8121,2852,9260,8445,2896,8075,4667,2164,7085,3616,3177,9104,5318,8728,2332,3943,2388,4352,8537,199,1655,3881,7058,3912,7027,5721,9737,6031,3265,2699,8285,7835],
     "k" : 314,
     "output" : 36150 },
    {"nums" : [5,5,4,5,4,1,1,1], "k" : 0, "output" : 20}
]

tmp = Solution()

for input in inputs:
    output = tmp.maximumScore(nums = input["nums"], k = input["k"])
    assert output == input["output"], f'Test failed for:\nnums = {input["nums"]},\nk = {input["k"]}\nExpected = {input["output"]}, Returned = {output}'

Results

Not sure I really learned much here. Clearly dynamic programming is an area of growth for me, but this problem was tricky in how you used a deque and contructed the solution.

If it isn’t clear, I copied this solution from a refernce answer. I was getting close, but this solution is so elegant.

Summary

  • Time Limit Exceeded
  • 23/72 testcases passed

Clearly this is an O(n^2) solution, so lets work on getting something a little more eficient

Iteration Two

Goals

All testcases passing with no time limit exceeded.

Open Question: How can I enforce time-limit constraints on my testcases?

from typing import List

# pre: nums are all positive numbers
class Solution:
    def scoreSubarray(self, nums: List[int], i: int, j: int) -> int:
        if i == j:
            return nums[i]
        else:
            return min(nums[i:j]) * (j - i)
    
    def maximumScore(self, nums: List[int], k: int) -> int:
        n : int = len(nums)
        res : int = self.scoreSubarray(nums, k, k)
        max_j : int = n

        # res starts as nums[k]
        curr_min : int = res
        new_ele : int = 0

        for i in range(k,-1,-1):
            for j in range(k + 1,max_j + 1,1):

                # If we are adding a new minimum, 
     
                new_ele = nums[j - 1]
                if (new_ele < curr_min):
                    curr_min = new_ele
                    # and it's not possible to beat prev max
                    if new_ele * max_j < res:
                        # Cap j here for future iterations
                        max_j = j
                        break

                res = max(res, self.scoreSubarray(nums, i, j))

            # If we are adding a new minimum, 
            # and it's not possible to beat prev max
            new_ele = nums[i]
            if new_ele < curr_min:
                curr_min = new_ele
                if new_ele * max_j < res:
                    break

            res = max(res, self.scoreSubarray(nums, i, j))
                
        return res


# Lets test the solution defined above
inputs = [
    {"nums" : [1,4,3,7,4,5], "k" : 3, "output" : 15},
    {"nums" : [8182,1273,9847,6230,52,1467,6062,726,4852,4507,2460,2041,500,1025,5524], "k" : 8, "output" : 9014},
    {"nums" : [6569,9667,3148,7698,1622,2194,793,9041,1670,1872], "k" : 5, "output" : 9732},
    {"nums" : [529,7655,4113,7929,7745,6149,2691,435,7858,978,5467,8761,2881,4175,359,9711,7157,1740,5214,7660,1113,614,4077,2859,2954,1170,3997,4526,2771,4046,3174,7126,3866,7603,5596,9587,1826,9228,9983,2487,7018,1130,1299,1389,5914,2926,5679,5781,5770,8705,9053,3449,9893,6042,4349,2008,2959,9730,5639,8813,5206,747,460,149,2553,4006,2012,8966,2245,2635,9089,7962,5879,9785,1069,7122,7926,9546,4557,5719,6926,2353,1887,2744,2240,472,7559,824,4320,8267,7210,4764,8368,3071,8973,7849,8704,2375,5130,5092,8311,6147,7692,6794,8280,4863,4932,4863,946,4243,7307,5061,3752,426,6352,1978,818,5604,3306,9034,9805,7900,8462,4473,1914,8449,113,8566,7671,9518,693,730,8064,2004,9584,8725,4392,468,3013,502,6472,4185,6380,471,4258,3424,8435,7470,5109,7228,486,8925,3130,1574,4454,9048,5824,679,5364,3804,5143,6714,5695,2806,7653,9153,26,3195,2856,4303,6914,270,9011,3325,7835,1770,8668,3395,1756,6702,743,2618,6841,7492,6068,9150,8852,5004,9610,6716,7053,4937,6209,2772,4454,3988,432,8097,9400,3194,5565,6266,2821,4769,5019,164,443,8620,695,8173,7705,5081,1376,6573,9364,7328,2513,8020,2361,4915,5346,7410,2379,5538,7560,9431,1049,9069,9616,9368,3998,3240,8006,3177,4380,794,8668,4685,3456,2257,2645,7269,2424,5209,4198,3086,6821,7598,3764,7505,6191,9018,7019,338,5606,1484,1962,1415,8423,6988,9140,8305,6196,2299,3397,8634,3855,2139,4924,7102,4662,6713,1056,5418,5982,940,3149,9245,637,8873,7651,2975,6447,5539,291,9119,7773,9287,4286,858,9111,5012,9499,1595,4408,918,5742,5134,9475,8427,9556,8422,4825,9747,522,266,9267,7351,5413,7374,8556,8014,6194,6076,3011,1612,217,6101,7673,5623,6757,5038,2615,3711,8296,7453,408,868,4090,1038,6549,7307,7886,3571,6450,1947,5236,8943,5827,1325,1278,9292,1930,7778,6039,3935,623,7886,256,1194,833,4219,3641,1047,2543,4442,9242,150,8148,1460,9650,5882,9647,431,7709,714,6345,6104,3240,6151,6310,7220,216,6452,3271,3368,1247,7870,8492,2124,1932,3524,5515,2911,8798,7242,1019,8154,3942,5654,5994,8323,449,1914,5680,2821,8399,1904,6356,8538,298,7418,2339,1672,2948,584,4877,2702,36,8044,1528,3815,799,8865,7043,5846,3204,4238,3012,2060,8169,9422,8049,8871,1517,819,6066,4821,7262,6131,9774,9210,9683,338,3573,3812,4398,5022,1313,9705,792,3644,3397,529,8340,2683,524,5635,6653,9852,8619,39,6060,4273,3026,7680,6861,4470,8,4094,4720,388,9344,7749,394,3603,8406,8713,9328,4423,3074,9966,694,4094,3627,6926,3558,4322,1720,3814,7277,5770,7077,9871,7872,4016,1196,7425,8843,8631,2500,142,991,9472,1603,7433,2955,5213,3083,9960,3993,8940,2675,5442,8308,6653,2105,4640,2020,8924,8918,2949,4949,5442,9580,2811,5205,7078,9779,5049,4455,3420,5586,6315,1629,101,5384,4917,7629,2731,8121,2852,9260,8445,2896,8075,4667,2164,7085,3616,3177,9104,5318,8728,2332,3943,2388,4352,8537,199,1655,3881,7058,3912,7027,5721,9737,6031,3265,2699,8285,7835],
     "k" : 314,
     "output" : 36150 },
    {"nums" : [3135,245,9277,2315,2945,7091,281,1242,6725,1544,2364,7756,7908,3272,3358,1851,3096,8914,1835,5922,1479,6028,2541,2284,4979,571,1700,6434,62,5378,9973,3997,2880,9307,277,8486,2374,6135,7181,5942,3870,1986,2382,9229,1429,3274,4933,8707,3151,6328,6374,3921,8578,260,7540,304,7441,6931,4160,7894,7486,572,6882,7664,887,4945,2517,7416,2258,5316,1078,9260,9866,9741,8001,1146,5318,2397,1808,4934,3480,3992,6079,1545,764,6841,6900,9452,9575,3076,9535,5559,9289,192,124,7681,6602,1979,3867,8333,3049,3739,1812,1795,7687,5635,4624,7012,913,9680,3012,1286,9490,4001,1238,7961,1492,2559,5897,3661,1665,2976,1448,6901,9761,5762,4156,3341,8422,2810,3574,3751,8130,8719,4145,7881,9438,2332,25,8968,676,4668,1108,8456,4335,4627,6961,8516,7091,9051,6092,9834,2732,3623,5324,2043,6833,5639,4004,1780,2946,3501,60,3395,9217,3304,7444,616,6929,6576,724,4138,6198,8560,638,9182,7067,4431,7138,8623,98,9259,3379,8451,6353,4599,1990,5979,5802,9079,8500,5795,194,6180,68,2157,8181,5961,9229,7840,2645,8624,1112,5115,5146,6301,1202,4813,8123,8005,799,9593,3700,3178,7775,4141,4908,7944,4617,6401,2743,9803,9092,8303,3705,9195,6594,9755,3687,6797,507,8679,2077,4597,2287,7658,5964,5487,9429,4648,836,7128,3295,1030,5782,8829,4700,5287,8155,3356,8283,5881,88,4196,5108,4551,6153,9088,4594,6358,5537,8300,4002,333,9792,6861,8098,7262,7663,2517,4023,726,4036,4711,8529,5610,8088,408,143,2227,2526,8651,7918,4747,7283,599,6717,3426,1149,9063,1243,815,3145,2751,4639,413,6607,6700,7102,1559,3911,8077,900,7035,1025,7278,6835,7413,8743,7598,3347,6002,3644,4171,9132,5199,6822,3531,6499,7653,1797,6960,3358,3508,1082,7217,1136,2561,8878,7968,6292,2419,4412,2790,3472,1299,9502,8683,3884,1757,2812,7986,2932,8056,6798,7043,3556,2001,2306,585,511,7680,7973,5934,1519,4203,3232,7724,9619,4934,9866,3046,5755,1637,4709,6935,5095,4746,430,4568,4865,2085,4528,2480,6035,8693,2862,9894,5058,1190,3860,9664,4704,514,5775,4851,6029,941,104,428,6859,9759,9206,7749,670,5661,9032,855,957,6636,8864,6320,2488,9585,194,5352,7224,4197,4509,8311,8188,9072,1998,8117,1097,4229,2878,3638,3649,3503,7591,8391,5579,9863,2074,1711,9725,6628,8432,2603,519,5654,3709,2207,6495,7253,5108,1868,6546,9414,8191,7970,9928,5387,4961,3428,6480,9465,7879,2844,741,6613,5743,3004,3486,4517,7113,6868,7717,1242,9030,6578,9138,2630,5704,7045,9650,5506,9544,5875,2364,2483,8957,6823,8705,4145,7628,2382,9381,4178,5277,6323,7292,6782,7147,7032,4691,4242,52,424,6754,9593,2274,735,1638,3514,5510,2537,2775,8064,2111,1232,9090,6265,9750,7263,247,7184,1273,761,4605,9283,4302,4169,2338,3786,6029,9243,6093,9875,7110,3074,8735,8104,3297,5565,7784,7797,8757,2056,1346,6658,4878,9409,9656,8444,2785,7681,379,7575,7819,366,5206,7734,951,9744,2063,7775,8048,7634,8553,9339,4710,1870,1839,6745,344,3099,453,9065,8066,6632,9913,4556,4666,5394,1849,7716,5321,9727,3652,2340,1264,4562,9690,7183,5823,8395,8196,5910,8080,8309,6599,1475,7063,5161,4698,5726,3971,7788,1092,8527,9565,8063,9759,5597,3286,5623,206,9149,3803,1066,2018,2439,9598,6791,6509,5173,845,1152,3494,4792,8811,4416,8019,2033,9350,6536,7345,808,1807,8276,2377,4588,8603,5331,9468,5663,9249,4997,2963,7717,9259,8085,8132,271,9713,1013,277,421,6122,420,4682,8017,3029,1415,7755,1421,9961,237,4411,4627,7895,1027,2316,3441,7867,9000,273,8471,8743,8002,5213,9896,4536,5576,6009,1752,6508,6786,9410,8248,3963,245,9068,4968,1513,6055,7128,3294,4431,1832,9327,1897,6065,4889,8725,979,7244,2937,4121,7568,5363,4788,2495,5785,8991,1327,6730,5931,3010,41,5468,6774,5925,7371,7943,6058,1948,4325,4202,9461,6293,124,8849,3288,5880,1904,5329,1672,1576,1862,5221,4430,8550,352,9149,6707,9426,3852,6388,132,4586,2243,697,9454,8983,4364,9189,3909,7312,7454,7796,9570,2452,2495,9527,6927,7032,5911,8172,1634,2997,6923,4962,9583,5118,1391,6836,9540,883,7076,8095,1622,4672,6592,7617,9987,8477,6981,5393,2471,1517,6620,706,2323,6763,3744,8217,8682,2301,4875,2473,9446,610,2169,2527,4583,1050,6901,3495,1269,1794,702,2355,3627,2645,9724,3422,7950,2206,3336,5242,4547,9773,51,9481,8834,2596,1535,9365,438,2162,3791,7470,5298,4055,6696,7885,6951,614,1519,4117,7778,1768,1485,4679,9496,8940,9237,6553,5725,5308,2928,9188,2838,1340,7994,659,8944,6633,2764,3430,5994,8771,2585,2792,4022,7036,1672,1885,9983,748,7559,3328,5970,2283,3495,7246,3296,3402,5162,6617,9752],
     "k" : 400,
     "output" : 29725 },
    # New test case takes for-ever to run... Basically does not complete
    # {"nums" : [8311,7569,293,5428,4351,5433,4365,1555,852,9225,8589,3603,8275,6077,9758,7639,8633,9612,1555,8567,6819,8425,8061,7273,5917,3142,1828,5895,3109,1533,3449,2081,3189,704,7929,4288,5179,6244,9360,1621,1210,4829,4034,5053,5857,8862,1193,5336,5268,751,5969,7737,780,113,8397,2048,4854,862,1109,4008,4798,8350,1460,7095,5648,926,7601,6122,7759,9375,7163,5707,7516,9694,3430,2953,544,6199,3665,7486,3578,20,3420,6931,2029,7084,2041,8387,2960,2794,1425,4001,5154,3697,9368,8355,2489,7242,929,1877,511,5917,8940,2651,1463,5577,9332,4032,133,125,8966,1220,7705,157,6990,6515,4428,3858,9342,8721,2453,5464,5385,3329,1640,3301,5482,7802,8750,2286,7575,8463,8248,6459,6555,184,7243,4905,7638,2434,1758,5499,3243,4466,2197,5465,7267,3825,7464,3410,3493,2040,5007,4701,3545,499,5131,4302,6275,7685,6795,4219,7157,3355,2096,1947,3718,7495,5325,4561,8767,3101,9774,4823,9592,1883,9822,9635,2669,7437,9268,7650,7232,2073,9490,739,5196,8470,4495,9689,2683,5942,1811,4189,6063,6213,2557,3083,858,764,2941,1414,2392,7393,8685,7444,8431,4248,4226,2348,3755,9060,3687,5284,8691,8696,4136,4540,1922,717,3911,7385,5419,9559,9478,4535,7248,5869,3824,9509,8720,469,4440,8133,4630,6034,5412,1440,7966,3255,7625,4859,3404,2546,5809,6676,4147,4880,5301,5764,1548,5229,4378,9471,6149,4999,6194,1466,7731,126,3325,9151,9743,9905,9676,1154,1830,3523,680,9592,8829,3882,4689,533,9897,3211,8263,2117,346,5391,306,1941,4653,2018,6978,5493,2984,398,8137,3259,3522,6964,947,6672,6919,9523,6962,5756,4051,8592,5862,4556,9909,3807,7635,1407,8394,9099,8564,2177,4319,6624,1499,1232,2238,4659,339,2824,4628,5406,7093,1432,1640,5245,5856,5061,9409,6614,9512,3057,6999,3303,6552,5264,7038,6758,304,1296,6150,3714,7026,4030,6641,8869,1931,5485,975,3536,6928,449,1938,7249,6938,8491,1431,4674,2318,4237,4868,3889,750,6028,6937,2660,7811,3662,6879,589,8193,1306,7220,7408,2979,2403,8194,9768,3113,1930,8736,5276,1523,8431,2010,5583,9404,2895,5799,9742,1165,9356,5740,6250,9744,3801,1752,5387,3057,9843,277,2410,235,1240,6925,5706,4382,1672,1511,3796,4035,9517,7628,4295,6059,4942,5935,4671,8991,1469,225,3391,3065,3730,2989,1115,8034,5069,3056,9958,8084,4158,3718,4167,6269,7625,6207,3812,9052,6243,2117,5911,9324,2811,3149,8539,7972,1040,8793,2060,8050,9763,1952,4821,3004,8851,516,6087,2241,165,203,3792,3443,5507,1491,5239,6877,879,9765,1676,8331,5244,4082,8742,8720,820,8163,895,7426,3846,9835,9763,9652,5918,2341,3863,738,1249,7208,805,2803,2301,9494,2941,7845,1950,9427,8334,7120,2287,3266,6924,6233,9233,7420,5351,1879,2412,8678,3134,7967,6388,8011,512,6876,7774,488,5188,8177,21,4200,4079,2459,4439,3019,2655,7069,8115,2954,2522,6860,6821,5497,7605,9651,945,9465,7426,138,555,5808,4738,945,4077,1453,693,3397,10000,1100,4994,4435,2868,1794,8039,941,5251,1988,6119,4905,1823,470,2426,9043,1960,4290,754,2920,4087,5863,263,4182,2298,1586,5458,5016,9674,8543,3392,5676,4684,831,9307,6389,1444,5327,9168,3956,2751,3749,8051,6423,9350,115,9177,5217,1793,6538,5109,6105,2694,9387,8616,497,5227,2212,6264,1017,5839,8131,7947,5583,3610,1677,6827,160,2612,911,7085,6776,7310,1166,2841,1362,71,9326,5831,7239,3655,7544,4204,5166,8995,1788,2665,4532,7990,7176,2166,1557,8652,7563,160,7069,9749,2278,5280,4111,1919,9609,8324,845,8739,9584,2796,4722,1777,898,3947,4375,9217,9484,228,2360,4661,1690,3298,1307,6889,4348,7139,6159,4512,4187,9237,6515,9648,5377,4491,4145,8472,848,8014,8764,3039,7930,885,8890,3955,7715,874,6421,3165,2640,3916,4323,1794,7266,594,6655,3782,8589,6382,5467,4954,3441,2944,7002,1623,9489,3412,1887,9918,8502,9497,3093,4021,8257,7539,3055,2840,1898,3514,4311,9880,6513,4335,9245,1702,8183,4896,6894,8756,1049,4784,4819,2029,4213,4170,9897,3019,6358,9988,839,1213,5991,9327,1832,9186,8616,7143,2385,9180,2502,4973,8670,1819,7457,2553,2681,5130,8143,4208,7537,9628,6853,4460,3818,5222,18,3671,1595,5007,1738,6986,8557,1194,8984,3641,4600,9013,3318,1116,7445,60,6685,7991,3957,6145,4056,989,5000,2663,8378,5279,3325,6351,8812,5431,1386,5640,9498,3372,8060,9403,2445,7960,8322,464,4485,1196,8585,9146,8635,5118,7623,5084,6691,8075,2879,8414,2283,4367,4058,3406,5275,9733,7467,8699,6906,1717,8914,8596,3505,3951,8314,8638,9950,3675,381,288,6312,3999,2573,5978,4303,4575,7787,9263,6022,7246,1312,3170,6399,3658,3449,571,7432,6103,3071,9562,7731,9156,8211,1995,1532,954,7939,2377,4022,7342,1186,2597,7559,7956,9118,3209,9640,2226,638,7438,4914,7818,3912,707,3125,2722,5666,5033,7907,3547,4749,543,961,1625,5258,6556,6693,8688,5535,7878,757,9956,6362,3546,2584,2056,7119,6235,6438,1827,8451,9636,7226,3923,2895,3113,5078,1462,6111,6303,9827,6386,3277,7024,5848,8347,2306,4845,8145,3420,8837,9644,4150,5949,4876,7351,8875,304,511,5816,5168,7529,2548,7435,3163,7771,4961,5634,3018,9306,5687,1523,7225,3346,4600,241,3425,1493,1958,2906,4393,8913,3602,3696,5642,1263,369,5987,8347,622,3865,7238,133,6534,8551,1929,1000,9556,8328,9848,9484,3337,4981,7321,773,4397,9513,8150,8960,2101,1358,834,7147,1360,5814,5890,6269,284,3059,4807,8457,8944,6203,3852,5042,1646,6980,4924,6768,3273,2493,5421,7414,9026,4120,7053,6318,548,1178,14,1799,71,6336,2846,9774,1815,3962,7201,1508,4610,2536,2720,2911,8146,8481,2548,5844,8589,6523,2568,9937,3730,9689,1803,8870,4317,4795,2219,6300,9074,3275,1644,1028,4493,1323,8038,2825,3493,8747,6438,6476,6816,1297,8338,8753,79,1809,1048,3282,9175,1816,1647,1363,5465,1825,6987,5362,8638,2066,8375,9122,5633,5476,3820,9410,5927,5869,2904,8091,3542,1215,4360,3526,7128,6727,3152,8264,9515,5198,1660,357,5914,6228,5053,1016,8125,9995,5127,5123,2748,8041,6143,9582,584,375,4762,1557,3947,1704,505,4676,1400,6002,8351,8192,1080,2341,9829,548,9994,8062,301,4784,1091,7960,4080,4182,2091,7208,6098,6778,9764,5727,655,6845,4958,9549,7787,4624,797,3124,7566,3581,7733,8588,8777,4000,1650,7766,2499,3078,3738,3168,6858,9348,5947,9461,7203,9551,8854,2456,3141,8867,4255,3404,3687,9380,4825,6315,1238,6476,4593,8906,3178,5617,2395,3887,125,4119,5681,2270,2917,8827,9314,9458,2285,303,3996,4106,9617,1628,4651,1410,4663,6826,3306,1773,4343,4614,6065,6912,7075,4254,9395,6543,2735,6678,1238,6454,4788,6942,9664,2540,8604,6584,5073,8692,1115,1699,2133,4195,459,4571,5631,3853,9457,6050,8833,4795,6782,5925,7756,8358,3809,3626,9083,9263,8504,2154,3193,9121,6070,9915,5781,7843,3708,4455,1509,3873,2509,4572,9593,2188,6380,3494,4533,472,8954,8871,9611,9069,5913,8027,6286,9419,2038,3606,2814,5345,5201,1471,8491,3514,1512,9136,8386,5805,6548,8946,9511,704,1443,9144,5386,7272,7628,7146,1344,5450,9959,2014,8521,5972,56,5598,6842,5500,3190,7967,2414,4772,1311,3562,6776,518,7694,9534,8631,2623,4805,489,8763,4848,248,1206,5549,5349,4732,6824,9440,9200,7133,8514,9199,3441,1686,5360,6545,8507,2726,932,165,7861,1567,7552,1491,4542,2534,1319,5617,9629,5517,8917,3492,4877,1842,4145,5707,5667,4251,793,3090,7073,2333,1890,5533,4190,2485,4378,4288,8208,3443,9829,4921,23,5873,5702,1063,1968,5054,197,3830,5143,3657,2025,6252,4746,8559,1257,4305,3033,3083,4389,31,981,2913,3997,413,8761,6098,4697,6380,5298,560,7565,5471,7221,7754,9698,161,8284,8024,6274,7358,9104,3581,84,7388,7307,5705,3306,8864,4302,2580,5063,7279,1064,17,4217,3723,1221,1991,9159,8131,4438,4959,4155,1793,5407,2676,4349,1396,8802,6767,2424,1558,7395,8663,2497,5771,760,316,972,2743,5612,1362,5634,5419,6566,6382,8899,9989,4786,9386,4852,4930,3567,6232,2363,1656,9190,7605,8050,1084,1075,280,3017,5073,2472,7463,2375,8470,9037,3491,9627,361,9915,7967,1839,6068,1463,7962,5829,9182,5613,1856,8260,6988,2231,4063,4663,9007,5679,6726,5206,4945,8966,4309,8008,6522,3410,9752,137,413,2599,1690,7086,6487,3901,694,3209,7076,3541,7739,7270,1309,1643,2436,2750,1976,2086,9002,2673,7910,6592,684,3328,4213,7645,9719,4595,6153,8186,5829,6997,2610,6948,9116,1524,5150,8594,2389,5674,935,2860,8612,2278,3894,3304,4111,3833,810,3950,7303,1314,1863,9989,3804,1820,6471,2908,3873,9865,5890,5935,3093,204,5728,6508,3496,8740,6490,1606,2071,7893,3646,2892,5086,9642,9661,2775,961,8660,8083,415,7232,7224,4061,9133,365,2596,3152,6355,2590,3713,6920,6127,9216,8902,1686,3280,7820,546,2344,8205,5934,1385,1004,5814,4236,8910,6726,6763,541,4195,6660,9068,2055,396,5551,3352,643,894,4067,2489,4674,7496,5999,5796,6635,8342,4497,4051,7910,824,5998,5519,8956,563,1591,8787,1768,5238,2227,6430,4365,8237,2362,9751,5801,4381,3509,28,9671,9042,8372,6745,9432,5202,1761,4754,5119,395,6408,7930,2620,8107,4892,1663,5679,4258,7646,2806,6925,393,4976,7744,7332,5017,5387,5460,4892,5793,2642,4563,6147,8944,4127,2965,4260,7105,3864,6413,713,3543,6478,2037,2895,3414,6705,4380,9563,3143,1697,2399,6946,2975,4936,6640,5461,2257,6387,2457,2982,9797,8881,4269,553,6859,8782,5764,2790,2834,4368,1927,8401,2314,4761,392,3715,2375,515,4127,8939,9973,1423,7499,7638,3409,5502,9921,8574,2468,9360,9055,4217,6045,2629,3656,2954,7901,9777,7982,3417,3599,9589,697,528,8480,3043,3852,7265,4922,669,1261,4787,9204,411,8115,7598,5268,4565,4329,2748,2249,9829,8122,5442,158,8759,3410,7365,3918,2570,5917,3425,2907,3483,7679,9969,7206,3375,6574,6680,4194,940,8049,3472,5867,8502,3099,9719,7954,2292,3058,8702,3065,7906,3485,3434,9518,8561,5036,4888,8402,7535,4344,8409,1161,5614,8588,8908,9794,9480,4424,3297,2542,3841,5233,3603,4839,363,9690,7137,5972,2066,2312,1353,5045,197,6028,8230,5282,8012,490,720,8054,590,3157,5141,8222,5597,1833,6458,6458,4714,5245,4516,7367,1496,113,2293,4444,9729,8787,9252,8691,9219,142,4712,8700,1856,1059,9724,5836,2039,1281,6287,3642,2926,8504,2680,2766,4353,6657,1065,2179,2089,203,1136,6057,2061,9520,5854,6713,8742,8621,4697,951,541,6653,988,2389,3770,3917,5135,2918,1868,6962,797,7936,9499,3727,7171,1868,8712,6843,3701,9772,226,7959,9774,1713,8640,8016,4648,233,9709,8037,4493,5348,2377,500,1560,3379,8834,2071,2421,1409,6268,6048,4572,3144,8792,7888,5876,536,2397,7515,9043,2195,7998,1414,2670,4279,2917,2672,9902,2945,7811,5613,7008,8665,6525,1402,9623,6849,4203,9799,8639,4519,8795,7669,4481,9666,4394,5881,546,4995,6615,356,5427,1848,7409,1689,1279,4312,4821,7958,551,8117,9669,50,1092,3904,1605,5695,415,3524,5595,8937,3448,5291,1619,8081,2584,4842,4602,2052,633,8951,9316,6258,3476,3746,8514,9417,4067,3849,6377,2682,2042,4377,8814,6821,5844,9299,8639,1489,4988,4281,7764,3982,6248,3268,4094,3740,229,7828,5060,5552,2646,8387,9781,201,1066,2040,7100,1360,7206,431,4215,7437,9431,9541,1209,5258,8420,6298,8032,8794,6689,9240,5738,5777,1198,4299,3577,1821,9477,2639,5369,8765,7398,9467,6876,734,3691,7802,944,6586,6688,3566,1849,4746,7719,1391,2737,6989,2495,55,2561,5615,8552,8925,9648,6686,8389,4597,5561,3433,8324,7804,2084,9916,8777,6435,5683,5431,3759,2686,8475,9557,4474,820,3440,7589,6294,3424,5002,3875,1273,8413,9894,1988,7766,4252,3512,598,8345,9092,7846,2489,7439,676,5930,2577,3098,2894,468,2021,8250,2820,7116,9429,5102,6577,2313,2658,3766,8540,7021,7197,4900,6973,603,6748,2303,9099,9619,7780,1791,8221,9490,2253,8665,8647,4936,7593,1194,1954,8398,2883,3843,3829,7791,5892,5027,3929,7775,3488,4649,9559,8584,9259,556,3690,7902,4622,4857,8058,4369,3449,8702,8809,4134,9798,7241,3477,6373,8933,168,7264,6654,1343,7013,1063,3888,4234,4959,5606,620,7624,4973,6976,7413,9374,2350,1662,2383,2136,6696,1279,3896,8959,7868,7343,2273,5838,6687,3564,336,7384,6856,8091,7469,5727,3840,8848,7416,3789,5608,7770,3733,7400,9970,8382,8362,7351,5033,6265,2378,2948,9431,1643,227,9660,6403,2427,5628,1233,1949,8194,6841,3247,5907,6764,6056,7881,7315,5248,8430,3588,3638,6710,977,3659,3774,3518,6846,172,1638,9497,230,8710,5073,7444,7523,5899,1070,5487,6596,6533,2012,276,6109,1132,6633,502,3756,3383,177,3031,1088,3918,1000,6561,8827,4806,2328,4333,7943,3908,3172,1546,1288,5456,6883,110,1068,5801,1391,6412,4850,892,9467,1747,9992,1209,6540,2226,244,5786,812,5174,1756,2269,689,5448,7331,9031,3416,33,2608,2234,7762,6681,3891,5371,8160,3127,7465,6522,448,9357,3644,1750,5332,136,1606,5965,7736,7696,9167,4848,8773,8848,3276,5190,5925,739,7729,7016,5815,1825,3506,5003,2613,8401,3902,2978,8082,6781,6878,8290,8896,767,4700,9995,2308,4189,643,2693,4047,1912,8130,9586,3566,3530,3913,1570,3537,6724,2649,4407,4374,344,1285,155,7237,3764,402,4164,1885,3475,1326,384,7948,8352,7512,6046,856,6608,1760,5358,9054,7511,3311,3196,6888,9650,6455,2592,8348,1187,1715,4933,6878,2249,6825,626,5799,2649,1133,4362,1343,341,5050,9681,8005,3385,2725,3253,1617,4969,5549,8981,2038,4626,1588,63,7311,3697,7192,6772,6164,3251,542,5339,6334,9942,6336,9607,8208,9413,3764,1886,728,6831,6731,1618,2106,4392,821,6009,8258,9545,8746,5370,4191,8863,6694,8269,780,812,9112,5571,9161,1462,9006,3205,3264,6960,3987,9259,3490,3003,7220,5247,7920,2861,1392,4156,329,2371,7933,6928,9104,358,3268,1522,6303,6547,283,621,9612,9983,8701,7838,6930,207,9579,1778,2475,1944,5987,5330,1169,428,6399,131,5862,8073,7721,5604,9315,1841,9328,1820,9449,7393,7498,3829,7638,2780,3717,8546,4081,7815,5682,8417,7073,5938,3378,7772,2201,6714,3773,9584,7254,531,7356,1350,221,8359,6746,8385,5661,8515,6693,5309,7975,3416,4400,319,9305,5469,7639,5138,6436,8719,3460,8042,470,8429,1813,4440,1846,228,8946,6081,170,6725,1791,541,3849,8050,7008,2836,5579,208,3767,6133,3415,9670,4063,5573,5953,6849,6375,5191,7427,3504,2846,3498,4354,7196,6264,5900,7908,8672,578,4384,2108,799,3404,5452,1285,2558,1544,2260,8319,4531,7010,8867,9413,7414,9372,3424,681,9879,1155,3944,4369,9552,865,2859,5883,1950,5693,4332,6106,6389,4316,4524,8456,4234,7093,6584,3793,3627,5944,3431,1163,4016,4763,3205,1149,4403,6764,3672,1622,2521,712,2755,3301,9512,3382,7944,509,827,7967,5097,613,5642,9391,3109,1193,27,8330,9084,948,2038,1334,4424,559,4933,8341,1063,4266,4448,9184,8697,7272,1207,1169,3219,1114,1541,6733,496,1234,4990,6102,4008,4182,6324,2539,1406,3472,5227,5921,4253,5936,1590,8762,8611,4922,8620,9438,4779,8255,8755,2642,58,1691,1023,6718,7290,8437,6685,2111,783,6194,8780,1078,1682,6135,2895,4501,1056,3669,4893,5104,7523,6710,5542,1048,6149,6973,6730,3553,6421,9685,8363,4327,4652,5998,8883,4105,2649,9724,9480,4500,297,7184,7737,352,6338,3040,9962,7290,4707,951,5047,9530,5725,9265,7148,4140,5353,700,1733,8605,1228,4512,7091,8950,5496,925,7668,9923,2018,5078,2275,6720,4177,6560,3412,9746,8462,9897,9562,7618,6040,9400,1523,1617,7425,701,1205,1468,8567,6214,1497,486,1471,7728,4360,9869,7602,5922,1500,1836,4542,6655,4507,8310,9208,7493,4981,5195,3938,1923,7148,467,6817,4830,7736,5376,9053,9389,1976,5345,8349,940,3643,2041,4402,7453,871,4440,4363,8384,8709,140,1024,3075,3270,6481,8072,9041,7731,6531,8823,6124,3432,5351,3195,2824,1406,4307,5775,9100,1802,9651,5518,986,8330,1269,2068,4475,4728,3318,5749,5332,7714,7554,6741,5634,9707,9442,1797,1150,5420,3,4288,765,5001,2444,6217,805,3482,1275,6046,1180,3348,9167,1657,2626,3776,320,3480,2817,4889,3434,8635,2160,7102,9345,9605,6707,6301,5823,1936,6689,634,3457,5450,7256,3929,3734,9630,6098,2437,3913,2663,9998,6780,8705,5071,5874,9283,2235,8090,8997,4812,4488,1072,7888,73,9403,7344,4741,3287,5201,6406,1757,9822,3006,7656,1411,9520,2364,1000,1929,7190,3201,6808,5639,1240,5961,4587,8900,8468,230,4525,5894,3377,6056,7243,8685,4575,8827,1072,8659,4949,5911,1788,7639,1352,2461,4066,1041,9486,764,4440,9343,269,4728,2902,6145,3871,1873,623,9508,2226,7335,3190,656,1060,8895,4439,2228,9421,8146,1486,3322,7803,4960,6576,2239,5618,1637,237,1919,6400,8828,5284,5095,6194,7954,5663,8522,3810,2139,376,3878,4626,6864,5112,6643,8118,8382,5698,3548,1713,3138,7331,1516,4133,909,270,9532,9657,3445,515,4568,2844,1072,1050,8145,4149,2508,6445,6906,9196,3319,3320,9902,4366,8786,5913,3087,883,5325,495,4474,4294,7004,5191,561,3488,4078,7536,3144,5833,2771,9165,5346,406,1246,5826,5557,4756,1810,5485,9961,1424,2644,2491,3627,6321,8137,9616,2066,4047,6165,1898,8766,9121,1273,5392,5534,2881,3987,7066,8201,7851,2425,2284,2012,5289,6335,4367,8173,8915,6840,5605,7013,6427,5158,3666,148,7859,339,9590,9953,8568,9276,282,4760,4162,9674,2272,6952,2199,9420,1103,2594,7692,7682,5549,4151,8056,3182,6602,901,9650,4225,1732,4235,7758,3027,7397,6242,3423,959,8213,8789,7274,4763,3408,1754,9663,8813,3000,6571,5988,9394,3024,1533,2546,4428,8098,4939,6671,4852,6701,2920,620,2618,9012,7065,1451,9199,8067,5711,4237,4417,3714,1143,5574,4692,7034,1810,8549,5675,4549,7310,2464,3587,5350,6708,5515,1781,3464,8660,1394,1793,1863,315,3240,2902,1425,149,973,4498,5112,7036,6488,3160,8197,666,2944,303,631,4591,8717,935,8959,8182,6803,5039,1072,9380,5037,6582,7080,7260,6609,3637,879,9279,9642,5202,7828,4280,5689,5428,3336,16,3639,4659,6732,3252,2688,3965,181,4815,6513,3111,297,1597,7193,4833,1825,6079,6119,3483,3350,275,2250,3851,3015,1504,8425,8839,6944,4312,7627,3072,5973,3526,2221,2677,4013,5036,9629,2553,7211,5506,4097,1410,5244,7646,9312,2114,7281,9691,2789,6428,8408,9270,7060,7715,3762,5312,3505,1305,5868,7700,2796,5591,2945,1060,8754,2419,2170,8911,1494,5199,6204,2619,379,391,9507,583,7262,3366,8928,4728,8689,2873,4538,522,743,1521,3162,5267,4447,1911,7261,7501,3582,3169,462,6158,112,6239,3837,6605,1872,8984,4755,742,3617,2367,8896,2637,4817,7197,7815,715,3690,9565,6839,9188,303,2524,1168,5042,3191,8408,2235,2606,8605,5510,9273,6282,5932,5554,3308,5834,9465,4550,9809,7231,8714,7106,1475,2693,2216,7951,2511,6611,6959,7065,6785,732,2697,8232,6343,2394,6167,8522,534,7531,5263,6834,3307,393,5933,4357,2683,9624,7579,9761,9168,1236,2773,7123,6996,6257,4558,4883,5548,8463,9321,4738,1225,4389,3555,5817,5674,4762,9683,7140,4609,8614,1209,3521,7270,9806,3635,3115,4925,2773,5197,5017,6533,7249,1950,513,8183,5088,924,6888,6259,3000,8376,3292,833,7351,5102,4138,2423,8005,9939,141,9256,2479,7104,5719,9057,5359,6373,4845,243,3848,5416,5225,1923,9975,9306,3091,5330,5686,4532,7762,1615,6344,7758,7762,2709,6828,9352,6258,8759,3621,4336,7806,8414,3820,2859,6969,9527,6823,4183,4550,971,309,5438,9829,6803,5702,8679,9630,2825,1013,3191,2822,4543,60,8734,318,771,8555,9126,9786,7798,8523,6029,2275,5259,3355,4367,7945,5124,6428,1811,9071,9202,4915,4727,8033,409,4065,7038,2926,3750,2806,3512,8571,7268,9077,4918,4746,4774,1679,2277,8706,1547,6188,8031,7911,8212,6613,6892,6564,21,5971,7287,1724,4664,9565,9916,9728,4160,1906,6733,648,8297,1399,2596,9857,8078,2194,9129,8528,4001,7455,7981,5787,8932,1560,2675,222,674,681,5176,7710,1818,1664,548,8681,3512,6921,7962,4662,2623,797,5554,7426,3511,5210,6359,7728,9320,6897,3599,6091,1446,689,1093,4147,8637,4919,3389,2867,6712,9452,8189,4869,2617,5528,1226,3383,1566,1140,4259,9949,651,1448,6734,5082,1281,9037,8173,4677,2037,6679,1464,7197,5497,9214,9520,6527,8665,7175,337,2365,560,9938,2068,5748,6329,7989,8111,4284,6218,3393,4146,6916,10000,5308,4499,5337,7128,5591,755,7744,7046,7168,9608,943,6223,4697,6919,6289,4634,6302,1801,6205,6888,1381,701,1724,7062,1734,3836,8571,6522,5001,9183,6248,1285,6644,1838,4533,9434,2979,4114,8864,6400,2858,3408,3937,1992,8993,1586,955,2153,609,2334,8229,9460,8636,4295,2801,1054,9122,5065,2062,5338,8730,3584,4284,7688,6865,4560,6337,9250,455,3062,8305,9673,7665,7311,9791,3829,8268,1185,9784,9314,2029,5706,536,2612,9088,5788,585,5859,5583,1756,3118,2094,49,1634,7067,5374,6618,541,1430,6270,3087,2706,3383,1285,8222,1058,3466,8802,2970,2960,4265,4465,9341,6665,2437,7306,7339,4407,3869,8088,3293,8440,3551,6428,1537,234,6674,9876,10,2900,8264,7690,7982,7674,7249,2495,5657,3721,6061,6111,5316,5742,8537,8752,8077,9150,8190,8887,9041,1720,182,2635,2020,4379,5177,4828,3997,1663,8024,2442,8141,9732,1217,1743,3422,7738,6043,5610,1399,8079,6261,2296,1250,8195,6372,2327,8797,5839,3437,2845,6330,8413,6558,1884,7467,8658,7978,9228,6153,8183,2333,2680,4437,1181,1640,9616,6952,4886,283,20,695,4083,7558,1557,2028,4122,9195,1450,1152,2067,5179,378,164,6370,3051,7892,6012,4745,4940,651,3712,7059,3579,8580,9496,1128,5667,1688,6255,7139,1841,3626,8223,3434,2597,6291,4105,4157,3795,7364,3177,2295,6461,7533,4032,9123,203,7050,3135,5033,541,468,6949,6435,4144,5038,3290,7767,3192,8665,8317,7056,9751,1170,5490,9481,3936,2812,1921,6492,5472,5169,9657,6330,7090,2521,2232,551,2783,2466,711,848,7309,1095,4344,3623,3315,6951,3210,2651,8667,6547,2082,1179,1031,9359,7194,8747,4409,7665,1921,4244,3349,2845,678,7971,2105,1279,4672,8989,8674,4314,5949,8244,8454,8258,8400,5908,2205,2343,6655,460,9807,8533,7236,4979,5171,1025,4650,4459,7235,5739,2081,2419,7460,4769,9754,5223,2707,7995,6087,1925,5858,1955,8539,1483,5673,4044,1777,3819,9521,3599,2524,7606,8555,1488,8928,7919,1919,8680,9485,6485,7013,7781,1970,5711,1537,5430,7548,7384,5133,8287,6272,8524,1335,6904,194,6654,6119,2896,6682,9345,288,1616,4606,657,8826,331,6495,4508,385,6021,6201,4270,5664,1060,2772,3543,1895,5356,5435,9246,7604,9572,8026,4902,5863,4249,7616,2845,326,7405,4349,7416,3987,1719,1810,2015,7839,6551,4215,4145,3208,9130,3725,7914,7535,9052,9401,5401,2819,1295,8472,9542,2785,8969,6140,808,7935,5792,9335,3474,7324,5497,9679,3767,9961,2127,1839,4158,5066,4926,1550,2048,81,6865,3674,3612,834,3710,9565,1801,2146,4267,2835,9353,6613,4948,9291,3447,3988,5208,4981,2672,4850,2775,1400,8866,9538,1271,3271,4272,5128,2534,8891,2845,7131,8477,7080,7348,5554,3992,2482,7431,5607,8866,5107,4680,2695,4092,1008,4576,7417,6746,3263,2163,599,4000,125,645,6708,4273,4158,2792,8900,4564,5556,7964,4492,4420,1051,3283,5726,5408,7899,3738,9329,1319,6735,2222,4934,380,1149,7880,8281,3559,2818,3544,7540,1990,160,3814,823,5470,3488,7845,2202,6571,4236,3465,5312,1923,1643,3084,1599,4573,5643,9833,5072,8146,7512,8668,613,2539,1332,8585,3349,5572,4793,4850,545,9599,8229,5896,4949,1288,9060,4374,1356,123,6547,9774,8221,9484,332,7359,9661,5793,782,6160,9041,7079,4338,4510,9830,8592,9408,8218,5186,8178,474,7210,7405,1309,2133,3702,2308,8975,5637,5348,3459,3157,4729,6522,7075,9530,4311,9275,6288,421,7492,4107,5951,4489,5024,9221,7203,8027,7872,4044,4820,5809,2006,2934,2594,6622,3777,4271,6598,3485,5827,1044,8920,7854,1456,3688,7124,6187,9140,3694,8257,710,8868,2814,4502,3501,6099,9816,8888,9546,240,3382,6970,1790,1922,4782,3168,8524,6279,8182,5590,2726,1472,8957,6548,7890,7053,3890,6544,5302,3582,9239,6521,524,8562,3280,8585,2390,5401,8098,5224,3225,8066,2048,4935,7677,7697,2104,293,7148,4826,2072,9741,1784,3976,9267,9850,9318,9649,3303,5957,7489,6384,1986,1724,7595,1695,6297,3286,2560,8284,5174,6493,176,5487,3719,4408,6713,8072,7041,221,6763,6708,696,8711,7170,4192,5953,3215,9451,4100,31,6713,7150,3662,6156,9988,2370,7652,9465,3814,9899,5647,9014,985,434,6032,8361,9681,3163,5721,3079,490,9398,781,7496,1414,9240,7158,1125,3727,7314,5108,6393,8747,8771,1138,9695,7030,9263,7915,7015,4589,1704,7521,5302,7975,67,9875,7182,5121,9549,9085,5062,9223,760,8646,4948,2107,9776,9534,6077,2,6149,370,7661,1291,6144,7900,891,3883,7426,1570,3693,6132,40,309,8071,4451,9450,9148,6928,5739,8275,5008,3367,8700,5857,9227,8339,3704,2977,7565,2856,6618,3054,2265,4386,2844,2488,836,7835,6132,6412,5468,2096,1277,4690,723,463,2166,2852,719,7885,8501,8843,851,4144,1868,5464,6699,2424,608,8714,4488,4559,454,2434,9737,1337,5840,2139,8916,6736,6795,4437,6100,1640,5809,2168,4301,3283,2861,1692,5661,4342,152,6333,5980,1134,6087,5474,5516,9252,6008,6295,3001,7387,9740,4947,9632,485,9569,7009,1405,5142,4159,7517,2633,1854,2042,3776,9375,674,9846,9520,9158,4129,1636,2450,7092,5969,2333,515,6259,9493,1640,2173,2273,4139,8400,13,9192,6706,9974,8408,4461,9471,3083,366,9131,8172,9826,5151,8099,7971,257,7657,5235,1487,3453,9454,9581,1389,9456,3973,7821,1489,2466,6379,8501,1846,6975,2169,8947,2764,3164,8906,4258,9447,8153,7944,2246,9974,6000,7520,3704,4250,4269,6302,9289,7499,2370,7387,1343,2654,1860,8166,2544,683,9368,4678,7199,9739,7117,6786,6698,5441,8489,5626,6486,5098,5361,7700,5321,9433,8156,4597,8013,8423,557,8164,4426,4636,6590,6483,7612,8399,3751,4328,4176,4746,9376,1403,6143,8218,1517,9455,7436,2277,9789,1673,1083,1690,5504,2614,4535,244,3248,6876,5121,3273,4091,4525,1254,9379,5825,9686,7131,4334,3049,294,7691,81,5981,5962,3537,687,1842,2956,7233,6610,1271,7496,287,1803,4092,9027,4693,2945,8115,1261,2826,5609,6734,7561,6302,154,745,8965,6479,5436,3908,6767,1615,4879,4252,4841,3349,3424,3460,1662,2341,1419,13,8432,6779,4439,437,8931,9442,266,9202,7189,858,3781,9539,2543,9596,3348,3011,2139,965,3702,6553,562,572,9083,6631,7088,4939,30,5683,2127,8078,2692,9463,795,233,4615,9055,3901,8262,1193,6557,9081,4811,7643,9510,3690,4336,6079,3584,9214,2205,5043,2137,3759,2146,4080,1108,7706,739,1899,7362,2615,9481,7472,5566,1411,7525,5081,4272,9881,9259,8265,8798,7050,6621,4943,5925,1664,9933,282,8374,5897,5182,8419,1301,6026,6244,8389,3294,5722,2145,9573,2720,7282,6440,1548,648,4981,7428,1956,2007,2550,8159,7252,7720,8293,9939,7117,626,2593,8810,6689,4294,9111,1070,1244,658,2641,903,1654,3460,1492,2673,4727,3441,8197,8076,2623,1103,4432,9383,8334,1703,8805,3902,8961,9765,1661,1939,9334,8697,9337,8640,4444,5163,5219,733,8494,6044,274,7866,7847,9028,3066,9246,7595,9086,1560,4034,1394,1701,7197,1536,663,2679,8443,9632,9405,9164,6111,6160,5790,9650,8344,4467,8066,4236,9107,7738,4128,50,2934,9716,1988,5132,5450,1703,7586,1730,1337,5729,5948,8991,7470,9544,1416,6949,2959,7363,5762,9083,2181,5911,3261,1233,2329,8197,3340,2797,4321,4812,846,1509,3975,353,2087,9717,4688,1560,8847,9410,3380,3383,7636,7310,6042,2669,7120,578,6731,9540,4954,7276,662,2459,6201,9863,5158,9627,3203,9531,5480,1149,3479,5935,9978,9422,4169,7303,4443,5295,2151,5503,5333,5364,8399,9048,7507,4230,9400,1921,4202,6932,9613,4171,1778,8528,7793,4002,2938,1113,5074,7687,6838,8570,8436,6467,6820,1864,5239,8898,24,1285,2376,4717,998,5408,5306,22,7852,5316,1005,9736,6938,9273,7133,3998,5439,6888,4128,354,1499,9252,3197,4504,3103,2375,9023,4404,9333,6077,7779,1066,7,3977,4513,1284,6121,2251,8418,163,6052,8055,7096,155,3045,520,8604,5926,3160,6482,986,7215,9123,1135,3864,5515,4450,655,9309,5487,755,5365,5963,8119,9579,3735,6791,7170,5484,2003,6619,3008,7634,2598,3652,6445,1962,8380,4739,236,4621,3580,6897,906,9442,3216,1613,7342,7710,8631,6852,5177,5450,657,5538,1703,8074,6498,5232,3088,7972,2005,4272,1254,2832,382,8956,4057,5048,6570,5314,32,3423,5080,7172,8791,540,5494,7765,1299,1757,6485,4861,2460,7697,9667,6037,8999,3238,2608,8490,400,3461,6991,2760,4085,647,6178,1374,4201,5349,1596,6326,4255,8838,7780,4285,3785,816,1191,9279,8183,6182,4567,7161,9985,9178,4187,2305,5118,9542,4170,1661,5148,2246,8036,5675,9228,1768,9989,2903,9155,1622,828,1312,2050,4701,6952,860,1813,6958,3756,2759,7302,8221,2975,9584,850,7034,5595,232,2009,2062,3671,3657,9017,7574,3928,6276,9984,1342,8002,5996,7560,1115,9771,5236,5857,9885,5621,6293,6742,8312,8573,2495,1260,9809,8513,7221,1793,1394,3319,3521,9140,952,246,4047,1998,6582,2250,4492,7534,1628,1052,8806,2431,9067,9460,8841,6165,782,282,6117,1909,4336,181,2575,7930,3953,9731,2808,5219,3920,3985,6913,2593,4633,4958,9663,7757,3266,9141,3933,464,1765,3741,9490,8434,1746,3848,9180,5398,8784,3558,6354,63,797,7455,8221,7637,2883,5569,6310,7060,8816,923,4023,1284,6624,1551,9633,4388,8762,4048,3838,2356,2458,2013,6125,2128,3659,1512,367,2489,1418,8462,9953,8269,3317,1161,9648,6068,4024,1280,7940,881,5274,7274,9341,9998,5632,5896,8441,9704,5166,4787,7201,7082,4779,4730,4865,5236,2927,2028,4412,4947,973,5648,7385,152,2471,4240,9020,2352,8328,1614,3224,4021,4787,6905,1777,1251,6296,1574,8167,8634,5703,4117,233,6919,8858,1164,4800,3978,901,142,9732,1207,2501,7659,2722,7158,856,2694,7606,3454,7142,2600,3972,9743,3829,2984,7255,8721,2228,3312,680,3926,3325,1186,3161,5337,6611,3186,6320,1795,9557,9051,9663,3436,4526,8951,3510,4054,2669,2366,8728,124,8324,5109,5393,482,9858,1007,8681,5354,3860,9976,4611,6212,8195,1020,7927,9694,5502,6711,8556,8089,4737,2545,781,83,8404,1187,6566,9051,2406,7227,3496,6232,8556,719,8638,317,5336,846,8583,4196,8234,9400,8608,2684,6735,2798,2195,3873,9759,3469,1149,4684,4834,6410,8147,9531,4683,5872,119,6258,3148,8386,665,5645,1550,7578,157,445,7092,5377,2620,1864,3693,9331,2882,3832,2416,6050,8786,1862,236,8258,5352,2901,9413,9369,1864,6272,296,8516,1897,8313,7767,8161,2451,6466,2989,5726,8308,9285,1344,6272,3537,1383,771,7733,379,6089,6666,5269,2886,6349,267,943,8366,428,9349,8917,7156,186,6514,6464,9758,9945,5121,3903,4612,6938,6350,4853,2525,7013,3587,7486,4366,2476,8264,45,6730,7474,1614,6055,2345,6863,7980,5865,9722,9456,1316,3730,1124,620,9368,5156,3334,1281,4313,2779,2173,7959,6202,9631,8012,187,5640,2329,4508,47,8815,356,6363,5543,9582,6608,29,2223,9728,1027,9676,4535,7111,9336,2900,9562,8885,8476,1351,9427,254,9332,1982,1877,4650,7362,4133,5879,3039,1179,6287,6747,1388,8880,8050,3613,9203,9719,9281,4155,6598,2052,4062,6676,6284,1841,1201,5093,5659,4663,9502,2967,9823,5265,9815,6674,6284,5447,411,604,5351,4553,6097,4324,5472,8045,3344,5484,6951,5017,1260,8942,449,210,2639,2574,2021,6550,8512,7934,2021,2925,4637,8036,1973,7565,2116,4706,7990,5440,4373,3213,3003,5399,5255,2176,1241,7319,6263,6769,3230,7210,6313,591,146,6942,4557,5265,934,5121,9842,5860,630,6607,7587,5583,3544,9127,5479,1170,407,98,6625,952,4745,1553,409,4445,4662,8180,8785,6796,6104,8544,6208,4778,7566,7907,4649,581,4411,2715,1099,7456,7608,760,592,2302,9779,4370,6740,894,9156,4932,9006,1532,5442,4296,4135,5803,2932,4800,6007,7360,6337,2806,1842,5370,4145,5453,4066,9960,1409,4224,3793,565,7488,2720,1076,1042,2299,1305,2792,9178,9243,3865,7331,4467,38,1243,9324,2669,1046,6012,7509,751,7837,596,5410,3687,2059,2920,7492,7033,3748,228,2389,4191,6486,8261,2742,5537,1201,3339,8444,676,7959,5557,6941,6363,5278,9080,2279,8859,7227,2376,4805,4001,9610,9197,3839,25,8103,239,9964,6400,4294,8872,6531,6472,446,6865,8499,1729,2264,6651,9885,3503,9890,3701,482,5351,2864,502,8524,3447,301,9173,1403,5265,5173,2443,6550,618,171,5779,7847,9954,685,8488,447,6415,6792,1899,7946,8782,9471,5789,5414,5237,8117,9909,6690,4520,5819,8722,6275,7007,2703,5614,1165,1329,2106,9123,1016,9627,6946,7503,6290,3382,6176,9812,9708,6476,9201,3017,4719,2209,3980,5269,141,8653,4507,8049,3072,3302,7414,2877,5207,1490,8871,9533,3701,8871,4226,2861,519,4803,1578,4228,8667,298,1724,5031,3267,2361,8274,3510,4959,7128,792,8572,4515,6861,1175,8591,4810,9129,3389,4802,9609,2774,17,8073,8403,4797,9428,3346,8034,8146,2272,3638,7229,204,4532,3606,6711,1722,854,9334,7575,4027,4791,1624,1935,4290,4822,5039,4115,2431,4505,4586,2127,6742,5095,1329,1626,9286,2849,7987,978,8305,7500,4453,1457,7272,9502,3866,5374,6420,3363,3720,8009,3416,7216,3696,6891,7847,2592,1488,7995,7526,1584,676,8743,517,1973,8000,7386,2263,6451,6973,9216,9340,2895,6943,6375,1457,6018,1335,560,8637,6040,9164,5310,9949,477,1566,9244,7842,8931,3427,4479,4300,577,8813,2168,2655,8879,8076,4418,5461,2892,551,144,1236,2708,9745,7640,6594,5912,8899,3937,1535,9352,5007,8802,2201,260,8291,8350,9243,2434,6142,4361,1398,389,8942,5860,6213,8586,531,5383,6528,5135,8792,5562,6403,3513,1421,9477,9700,4365,2222,9049,6801,2800,853,5667,6495,7449,4605,9408,7965,6436,3729,8362,2930,4694,4381,1703,1877,5118,8115,7114,7212,606,2282,9808,8597,6259,1254,3546,6611,6233,4553,4308,8292,6099,8753,2850,6112,9978,6669,962,1916,2328,3766,4261,4915,9145,2688,2479,8042,557,218,7648,3526,9065,9127,5092,9461,1855,1804,3711,6649,4800,70,8481,5341,9711,956,3701,9457,6753,2351,9365,5853,184,4864,9116,1286,4013,360,6980,4137,7723,8204,8473,1526,7200,1496,2367,912,1310,4764,9153,3191,1338,4642,1105,6318,9289,81,140,3225,1916,2683,7793,6207,4944,9443,7529,1517,6637,8347,5719,4636,8891,3591,5360,9892,6030,7027,389,3756,4580,6839,6289,1939,9519,3346,2275,9668,7498,6631,3119,1701,4207,9825,8520,1272,7126,7676,3215,8748,9138,3703,6958,4169,3807,794,8882,8566,1568,1710,5241,839,9377,6693,9957,9779,2545,383,5861,1567,7146,1227,1564,597,2678,2730,7078,7203,9258,6786,5529,2551,7399,7646,575,8421,1797,5223,179,2950,638,6919,5965,5599,7145,2418,1928,3177,7440,4675,7070,185,3781,7077,3162,3726,6716,7948,118,9291,6359,1244,6456,1237,426,807,8815,2406,9787,6092,836,8410,7304,2438,2754,1812,9606,6614,7491,36,1468,6595,5634,2119,7181,7224,9803,8490,5659,6402,5270,6564,3294,4971,3862,6899,1113,1026,2473,787,3728,6544,5694,2683,9138,1521,6907,206,7982,8593,7958,1597,4793,2694,302,2760,26,8050,811,492,1068,3122,3496,2388,3319,6471,6067,5104,4106,7629,2575,6670,3854,4121,1799,7881,7017,4115,9540,1121,6716,1634,7917,5154,7606,2444,1778,3529,4817,9656,2393,6873,2111,9644,718,3635,3496,2411,4237,7947,1486,3648,5927,2962,3862,4689,9394,2370,2906,8877,935,1472,5558,3026,519,450,4682,3478,3411,5630,4560,6734,9355,3084,3798,688,7252,3399,4528,278,9899,832,2152,5945,4806,7900,2808,5280,5209,9374,8697,6083,1851,7721,9884,7641,8431,6838,4315,5884,6071,7535,4753,1049,1595,3722,4020,2341,702,6694,1637,6186,6601,9950,7653,858,2345,5892,5204,1291,9190,7838,7098,2675,5135,5100,6453,4460,5391,6681,5246,9602,2832,4633,8448,7528,7471,9642,9657,3606,1393,6980,1402,3562,5217,7820,2776,8592,9924,8819,9146,9065,4700,5198,152,6297,174,1555,1228,5001,1015,966,7164,3375,4221,5155,6892,5353,9210,4777,4605,432,2631,9637,4392,2865,790,3245,4541,1429,2574,3940,9204,7373,8526,3561,7270,1467,1129,7283,1720,9200,5100,6794,3857,2326,6759,1711,3313,6353,3495,1502,7103,500,5400,4636,523,3706,3891,8454,8156,5512,5319,8017,342,3021,4005,6183,9015,511,9068,6581,3899,6912,5381,944,3971,4691,5289,5079,2629,8185,3180,7126,2098,2839,4472,6725,438,4236,9414,4891,6521,1120,9848,3730,7834,5296,1520,9983,2859,7911,8158,1344,4563,8549,8562,3185,2576,5820,7125,5316,5892,6938,4993,7206,9988,7741,4346,2452,4513,535,5087,7583,5660,5681,4714,829,2429,8373,375,2516,1300,3773,8177,9203,7033,5715,3754,4278,4033,9929,8737,5918,48,1128,8154,7926,1520,6604,9508,4846,9879,5711,5150,385,9000,119,5970,4625,8763,5669,4998,4107,4481,2179,4828,8112,9912,8611,2467,724,7134,8849,8069,7621,2940,2156,2568,6649,3132,6754,931,3944,7353,2594,9928,187,6269,1486,7805,9867,286,9196,3157,5736,1083,4382,7990,5745,1358,8202,5875,8909,6946,9894,726,3501,3132,5402,6385,2086,2750,2720,2265,4232,1664,8608,6558,8540,3808,7882,3560,1264,8931,564,8414,9580,2264,2250,523,7148,2409,5956,7454,5128,8310,9870,6741,9681,4272,9966,4984,954,4396,3064,5111,5596,6417,6876,3800,5433,3782,1885,8009,5183,8399,5280,1610,7348,4432,862,9297,5330,4019,5504,9149,5843,3044,2598,2254,3661,3921,566,4486,7698,1185,7489,6656,5189,2588,4559,1609,7969,8289,5583,53,4159,9351,7886,2380,3049,9725,6382,8945,3811,8747,3171,4122,9426,8869,8337,4622,3604,5565,1445,3714,764,9439,5635,6014,3952,217,4063,5318,9948,2063,8591,2387,7353,6128,4191,9555,7204,6555,9346,211,6138,3606,2095,2116,386,7853,9577,3594,3585,6457,1114,6694,5709,1016,3498,6534,4473,3239,2708,4081,8766,4018,8692,5347,3775,8975,9783,6184,7451,618,4078,7153,4494,4273,2863,8260,7054,2438,226,5552,3644,9282,9761,7946,4888,7318,1927,7247,1013,6594,6239,5570,2964,9393,1586,7644,3457,689,723,1784,6888,6654,151,112,8867,723,5565,7948,5003,3077,3977,8916,5527,9379,5398,1486,8905,4405,2718,5605,4007,3118,3383,3429,8543,5922,6051,1473,4140,6185,9996,3168,8544,1916,8445,1857,3122,2770,6239,701,6940,9452,7773,9909,711,6842,439,6284,1772,478,7321,4882,1790,7647,5793,6348,3768,3916,4850,1660,8456,6810,6095,6050,3202,4502,2364,3770,2800,9330,2485,693,6284,1900,361,3480,6227,4829,6077,7415,7324,3536,5702,9582,4860,4118,5737,3714,4230,7543,3472,6757,9890,8500,9074,159,1387,633,7650,1518,8438,8412,2377,2205,5934,3544,7716,6755,2075,9501,5048,3741,7602,9374,8482,7471,8859,4203,3040,3540,8151,7246,6143,3220,2296,2470,1329,9400,6916,7122,2853,1273,46,1664,8254,3279,4019,8327,1346,1690,4843,9080,6122,9699,3705,4711,4812,892,4273,1503,1637,649,390,8987,2718,297,4480,869,3095,3825,8103,2559,8209,7123,8136,1766,1418,9180,3419,3952,169,428,9606,836,2216,8807,9164,1921,3709,4205,8778,8663,7636,1149,6524,3511,4819,1487,3584,1546,1082,6465,6693,3192,6553,8081,4818,473,511,3968,3627,290,2165,301,2125,3712,3810,5632,8657,2389,7595,5413,6005,8269,2775,7165,5171,1604,7181,4661,5366,4052,9646,8494,8312,856,1324,4613,4964,6697,9276,6833,3680,7296,3281,3224,3511,9686,6633,7097,8295,5044,7278,4737,4510,3011,2611,3604,4168,7720,9188,1408,3689,9340,5726,7164,1950,8733,3927,5813,1700,3093,1200,8732,3296,9423,5047,4953,1890,9198,2274,5388,3687,3997,5148,555,5570,878,3529,8870,6379,5767,907,2001,4372,874,6963,1224,7061,8035,471,1603,5366,6625,8614,7419,7609,7295,1490,3335,5898,2360,9108,3784,5821,5100,1499,3602,9719,5497,1348,8273,1760,8309,2274,4740,6341,9648,322,3460,9891,7913,6084,2368,3197,6954,9700,6442,2999,4977,470,5804,8935,5615,1286,8737,5525,8142,6403,4533,9453,9386,1686,3347,5880,1949,4088,7631,2331,7434,6437,8164,5369,3802,8197,8020,4811,2720,5644,3946,4782,30,3585,2763,5408,1696,5819,1618,3232,9232,9655,7122,5579,2105,1382,5185,8109,5898,174,1663,614,6765,3117,3772,8366,7855,7107,8985,6398,1462,7980,916,909,7372,5027,9698,7693,2318,2740,7084,3287,3157,2304,3504,4059,5801,3695,7216,4061,6495,5002,4510,1370,3924,3018,8640,4468,4152,3739,1647,3533,6999,7601,6807,3542,7567,1719,5014,5921,333,5679,5387,5551,7770,1646,5131,379,2176,7313,3890,4797,6209,3306,281,4163,2216,675,3031,8538,8410,4192,3906,6257,4974,2309,5747,6927,4249,9541,5879,9558,7981,6676,750,4373,4954,6612,2218,5964,2954,8590,9881,3007,1866,2955,8224,7861,6948,4913,2217,3458,6073,3953,93,6561,829,5974,1829,8137,8935,6144,7150,3316,6627,9779,7647,8891,3421,5418,4202,3688,7813,2628,2906,4195,6815,6019,506,1258,673,4950,9514,8682,7948,9699,5353,109,4627,193,3933,752,4167,2923,9698,8200,7849,7050,5950,5037,9173,7328,6298,4786,6523,277,2553,264,2375,566,5145,6331,289,2558,7404,4084,8953,1962,7831,1918,7545,9203,6731,8850,5613,3294,960,2812,9597,8384,148,1128,2079,8909,6480,6531,289,1955,1009,1603,7862,5509,3270,7469,5912,8367,1029,7289,8133,2899,7747,598,941,6811,3876,8392,3691,5534,4947,3396,3284,5240,457,5724,1238,7163,2262,6155,7325,2906,1503,6944,6239,4627,6180,8391,2879,7597,1839,7719,6502,7420,8396,1615,8389,5364,7839,1864,4109,3360,9732,4151,1490,9355,9287,6689,6469,451,9582,221,3791,556,4118,8084,5519,4231,6195,3010,4286,7570,4774,2469,2815,9582,7640,7125,732,2228,8296,9993,3916,9894,3564,9219,5797,1551,924,1081,9644,7124,428,7499,5855,2864,3109,636,8192,7181,4388,5380,8450,5452,4467,9941,3306,3297,7927,1916,941,9824,4554,6954,2684,6114,2710,2483,2914,8552,7585,4991,8172,4586,3386,6115,2376,6149,3821,311,6910,3079,3031,2973,1807,5977,2850,6825,8405,1056,5261,732,3032,2352,9681,6203,5683,2025,7306,2663,2299,2851,2886,1545,5704,5152,6925,4237,6345,1183,9579,5474,8662,1644,251,1771,8372,6926,237,7377,9514,618,7347,5530,811,1464,305,2989,9668,4296,3996,2242,2436,9082,3204,8973,4638,3990,9113,231,2765,4498,4929,3799,8485,3996,3211,7990,4198,7808,3136,3783,8118,4542,9685,5457,9677,467,2204,2324,4844,8009,5796,1596,495,7919,9088,2938,1867,7952,924,8936,1842,3790,9147,5970,2913,7134,3721,4410,4927,566,4167,5511,5397,106,1867,5317,667,1015,6872,3179,1857,2650,729,7862,731,6037,2312,6782,6150,8100,7911,4064,7111,1430,8669,5900,478,1880,5209,283,6613,5767,8381,9644,4862,8385,3974,425,4187,8598,74,213,6264,1722,2697,4527,545,8978,360,4323,1517,88,9383,6671,4688,7387,651,9368,8534,3626,398,6904,6254,9915,8724,1739,6076,3535,9252,4828,8144,3074,1157,6299,4758,3820,8028,7098,6947,9050,6601,2034,6714,782,920,7264,4324,7389,8428,2919,5698,8513,9913,4627,4637,4230,1261,497,5822,3166,877,925,7364,8162,1832,7231,7097,4196,674,5458,7965,4683,5026,1388,2296,4901,4515,6445,8284,2062,7248,7639,7117,9260,5601,7052,2043,9574,644,4486,860,6154,8978,8820,9577,795,2134,4342,3901,2637,2702,1380,5452,5495,4189,3579,7127,2487,6870,8859,5598,4623,9665,1487,4930,2872,7791,7575,3496,5652,284,355,3134,6772,2131,3864,2912,5415,1738,9752,2011,1652,7805,7244,5990,8164,8907,9772,4013,8708,7791,3582,3556,1261,2807,2352,1017,6438,967,3977,8348,1628,2332,8199,8487,493,8002,4894,3436,4254,276,5444,727,6808,3486,2568,5127,7285,6634,3487,843,6916,6545,184,2063,8484,4298,8185,3028,847,4686,2523,542,5765,3810,9541,7227,7690,6941,3533,6192,5268,2883,1863,6871,705,7024,2430,2576,5059,7857,9887,7225,8934,9230,8570,839,4143,4564,8587,892,4937,5329,5785,4930,9691,161,5464,170,1207,2912,2331,4081,1453,6273,6233,9465,6581,4931,2279,4452,2652,4966,4573,2920,2203,1105,2746,1039,299,9637,9066,81,830,7460,7273,4002,9514,3911,4275,7852,2849,9283,7114,6520,2952,8427,1010,9149,2590,6076,8604,6700,2193,1890,9504,5335,9644,8516,8897,1585,1543,8255,7804,3966,9703,8766,779,522,4953,9180,3150,8739,6353,3111,977,3042,9951,8816,3635,3300,9141,2049,4152,1624,3158,8231,9034,6624,636,2868,1180,5797,3552,6738,2765,9424,2651,5621,8792,7231,1264,7340,2747,5326,5015,6596,4634,9927,8927,6868,7423,5123,3862,5846,7037,2805,8265,3067,3071,5210,2811,1043,4433,2466,9786,9832,4726,8797,5399,1574,2296,1906,9950,6820,2319,5794,5278,1816,7516,7486,7834,4135,7750,4089,3285,161,3367,5462,2405,4488,8494,9733,5193,1837,436,806,5000,8938,1229,7994,2450,8571,5446,5620,1023,3780,7603,330,4013,6938,1133,6987,4759,2670,4980,733,72,1314,8551,8233,1078,250,1913,1821,8249,445,1934,5487,3468,420,8013,1745,4696,5337,5649,7013,908,2440,281,1778,4288,5052,1625,395,4091,9945,4058,3111,6575,3529,963,564,5206,6266,988,5176,9275,7309,590,3526,4692,4031,8010,489,6297,7147,1029,9506,713,9345,5736,6574,6637,7787,5447,8955,8641,8379,2703,4847,2954,9671,9871,3143,3730,1006,7175,19,3591,1846,9160,9532,1817,9061,9352,6982,3709,3599,6094,2668,8017,749,200,915,7801,5585,8015,477,4621,4205,8023,2302,470,3398,6189,7261,7770,3477,8887,8325,1647,9402,2798,2444,2200,7810,3184,7807,8703,3255,5909,617,9663,2070,3924,2920,7166,5227,3403,609,5992,8768,8238,2379,3307,3238,8013,5622,420,1965,5189,4249,7177,8930,781,8147,3080,7215,9366,7081,2856,4542,5767,2355,243,4058,7869,4078,1433,8539,2730,5353,3883,951,1356,2431,1973,6546,3292,4189,7795,7113,5853,7438,318,2198,6705,9555,8567,3012,2374,7655,6879,6657,1698,1259,6488,6969,9950,75,8496,6546,2992,1547,1584,8430,3178,9784,1666,2889,4593,8191,2118,1942,4111,1063,946,6890,6225,6099,3445,6960,7989,7572,8386,3754,5299,1031,5720,3978,7394,1511,9173,478,6411,3296,3798,7257,8289,8851,5250,9887,3255,64,9493,2485,7454,1653,1289,9296,1002,3019,3117,7382,1829,2612,772,9198,8345,6925,7418,4717,4391,3267,161,8682,3361,3332,1456,2382,809,2937,2581,9789,8456,3640,4429,4668,3138,3164,2874,1466,7990,7224,1038,1670,4267,919,6906,7582,2779,4442,8412,1432,94,7258,2400,743,1252,5907,1987,2567,7449,7138,9681,5524,139,721,8418,8860,7370,5995,7692,3460,6997,1314,6732,3493,5277,242,6652,7472,2003,1449,6762,2818,1487,9878,2166,4967,2879,6974,2422,9891,5365,8035,7377,8540,1297,2473,9851,5120,1592,2356,9064,5626,2343,4917,8670,5345,3081,3890,8313,1779,6552,7437,6116,6902,6385,1096,2779,7829,4123,3003,514,4189,9715,8138,4597,58,7691,8834,581,9343,7392,2569,4174,4692,8835,9484,5340,1889,8901,2706,7751,5132,4806,1586,4729,3846,9246,1658,7059,6467,3455,3463,5513,4903,284,1071,6682,3600,9750,1211,2544,4906,2165,5968,7359,9071,4038,2675,7599,2738,1533,1394,1187,5485,6844,9839,4352,1584,5462,4774,9890,7398,1153,2597,1869,9386,9400,6338,8149,9960,435,4973,4313,6207,5923,1159,7157,987,3494,6966,795,3475,5887,4817,6174,7899,6350,5312,3741,8352,3969,3178,2713,7606,8185,56,9585,3546,395,7171,8414,4532,2983,1819,1950,5193,9727,3716,9507,5975,5559,6165,8886,3516,7442,5093,2113,3499,3585,820,2951,4148,7453,4039,4686,5199,7455,6422,4583,3699,9824,5759,4148,6397,6784,3314,418,7105,6750,8724,9623,1133,2856,5954,9424,4089,216,1101,4577,8349,9698,4499,452,3248,8755,9306,1995,1168,6481,4943,5326,7537,3464,8394,8457,1571,5757,4534,4896,3216,7011,704,1325,5029,3974,3181,7027,8028,6652,8796,251,6169,5703,2014,791,7883,8389,581,8196,3178,9085,1999,2773,923,1222,4378,7565,6362,1033,607,5883,2957,3921,9102,701,6088,7758,1632,120,4658,8848,9964,5661,5998,3806,7918,4725,8217,967,6430,5748,4930,1314,3533,5388,4957,1481,4822,1682,5172,9611,6526,217,242,4333,4288,7756,2151,1893,2030,2719,113,7256,2446,3931,9689,4941,4719,3382,7188,6983,1777,2817,1314,1757,5806,1522,9626,9856,8906,3391,2516,1894,2022,566,5258,6324,6989,6914,7014,5950,9721,8548,3162,1924,5196,7653,6203,4405,1521,4313,5116,470,9517,7413,1052,9174,8234,9233,2402,4688,7531,9137,2815,2082,6708,6702,3332,2314,6816,5517,6109,5359,2914,9285,7821,9638,600,8466,1389,6126,1372,8314,2560,5627,1131,5520,3110,4346,7301,4687,3226,6247,7846,1651,886,9163,1959,5738,3789,792,7237,7062,8240,6624,7006,8572,5963,1769,6523,2506,2147,3246,5009,8047,9750,6545,4991,3675,7831,5557,2603,7776,1099,818,5663,7458,7314,9749,4520,3147,1343,9225,4454,4344,4796,5088,2651,3797,1924,6559,1638,5918,1624,6219,3655,9747,2478,6897,5144,9694,9377,3170,4895,4085,8557,5052,8164,3999,4570,7237,2231,8303,944,7939,5282,7265,3526,8025,717,6876,546,3825,4176,804,6611,6053,7305,6462,8990,9400,5112,5446,2116,2689,5433,8938,8394,7456,8456,9486,3568,3200,5860,7824,1745,6389,1605,2816,1201,4941,1932,998,481,2376,1268,4558,5700,6300,318,8984,4931,4083,3696,7750,3331,3588,3964,1916,356,4500,4353,1124,9440,8420,4351,391,8238,6654,3526,1003,2391,7551,2290,5876,9688,7356,40,6740,7920,7789,780,3046,3868,6018,4218,2341,4921,1989,4073,2012,3193,8007,7883,5445,4849,7046,1742,3858,9928,5119,2981,3933,1074,2084,561,5920,3105,3604,4192,93,454,1825,3832,1691,483,986,3292,1056,4855,619,3770,1424,379,616,1555,8319,6864,3905,5898,6076,9943,783,6029,5414,9414,1382,4031,9795,6107,7847,2402,2047,1363,4865,7659,4194,3757,9823,9823,9912,4278,9221,6265,7613,4509,6053,562,254,8241,424,9570,1703,9946,9518,3117,5671,8676,7958,6244,5911,4729,9504,2395,4262,9257,5023,1589,4752,4476,8487,8029,5047,6856,2763,6227,5757,6612,2272,2158,565,5195,7723,6310,8446,7040,8033,8653,8291,9766,6246,6112,8812,5770,985,5938,4105,4691,3279,4509,5329,7574,6206,1856,2949],
    # "k" : 4362,
    # "output" : 29725 },
    {"nums" : [5,5,4,5,4,1,1,1], "k" : 0, "output" : 20}
]

tmp = Solution()

for input in inputs:
    output = tmp.maximumScore(nums = input["nums"], k = input["k"])
    assert output == input["output"], f'Test failed for:\nnums = {input["nums"]},\nk = {input["k"]}\nExpected = {input["output"]}, Returned = {output}'

Results

  • 36 / 72 testcases passed
  • Commented out test case causes program to run for 2+ minutes… There should be an easy way to catch this

Iteration Three

  • With new timing out test, we should find a way to enforce a timeout time. TBD what a reasonable time is
  • Will just add code to enforce some sort of test locally
from typing import List
import multiprocessing
from functools import partial, wraps

class TimeExceededException(Exception):
    pass

def function_runner(*args, **kwargs):
    """Used as a wrapper function to handle
    returning results on the multiprocessing side"""

    send_end = kwargs.pop("__send_end")
    function = kwargs.pop("__function")
    try:
        result = function(*args, **kwargs)
    except Exception as e:
        send_end.send(e)
        return
    send_end.send(result)

def _run_with_timer(func, max_execution_time) -> int:
    @wraps(func)
    def wrapper(*args, **kwargs) -> int:
        recv_end, send_end = multiprocessing.Pipe(False)
        kwargs["__send_end"] = send_end
        kwargs["__function"] = func
        
        p = multiprocessing.Process(target=function_runner, args=args, kwargs=kwargs)
        p.start()
        p.join(max_execution_time)
        if p.is_alive():
            p.terminate()
            p.join()
            raise TimeExceededException("Exceeded Execution Time")
        
        result = recv_end.recv()

        if isinstance(result, Exception):
            raise result

        return result

    return wrapper

# Defines the real wrapper and time limit
enforce_time_limit = partial(_run_with_timer, max_execution_time=2)

# pre: nums are all positive numbers
class Solution:
    def scoreSubarray(self, nums: List[int], i: int, j: int) -> int:
        if i == j:
            return nums[i]
        else:
            return min(nums[i:j]) * (j - i)
        
    # Enforces time-limit on func
    @enforce_time_limit
    def maximumScore(self, nums: List[int], k: int) -> int:
        n : int = len(nums)
        res : int = self.scoreSubarray(nums, k, k + 1)
        max_j : int = n

        # res starts as nums[k]
        curr_min : int = res
        new_ele : int = 0

        for i in range(k, -1, -1):
            # k + 1 already covered in itial calc
            for j in range(k + 1, max_j + 1, 1):

                # If we are adding a new minimum, 
     
                new_ele = nums[j - 1]
                if (new_ele < curr_min):
                    curr_min = new_ele
                    # and it's not possible to beat prev max
                    if new_ele * max_j < res:
                        # Cap j here for future iterations
                        max_j = j
                        break

                res = max(res, self.scoreSubarray(nums, i, j))

            # If we are adding a new minimum, 
            # and it's not possible to beat prev max
            new_ele = nums[i]
            if new_ele < curr_min:
                curr_min = new_ele
                if new_ele * max_j < res:
                    break

        return res


# Lets test the solution defined above
inputs = [
    {"nums" : [1,4,3,7,4,5], "k" : 3, "output" : 15},
    {"nums" : [8182,1273,9847,6230,52,1467,6062,726,4852,4507,2460,2041,500,1025,5524], "k" : 8, "output" : 9014},
    {"nums" : [6569,9667,3148,7698,1622,2194,793,9041,1670,1872], "k" : 5, "output" : 9732},
    {"nums" : [529,7655,4113,7929,7745,6149,2691,435,7858,978,5467,8761,2881,4175,359,9711,7157,1740,5214,7660,1113,614,4077,2859,2954,1170,3997,4526,2771,4046,3174,7126,3866,7603,5596,9587,1826,9228,9983,2487,7018,1130,1299,1389,5914,2926,5679,5781,5770,8705,9053,3449,9893,6042,4349,2008,2959,9730,5639,8813,5206,747,460,149,2553,4006,2012,8966,2245,2635,9089,7962,5879,9785,1069,7122,7926,9546,4557,5719,6926,2353,1887,2744,2240,472,7559,824,4320,8267,7210,4764,8368,3071,8973,7849,8704,2375,5130,5092,8311,6147,7692,6794,8280,4863,4932,4863,946,4243,7307,5061,3752,426,6352,1978,818,5604,3306,9034,9805,7900,8462,4473,1914,8449,113,8566,7671,9518,693,730,8064,2004,9584,8725,4392,468,3013,502,6472,4185,6380,471,4258,3424,8435,7470,5109,7228,486,8925,3130,1574,4454,9048,5824,679,5364,3804,5143,6714,5695,2806,7653,9153,26,3195,2856,4303,6914,270,9011,3325,7835,1770,8668,3395,1756,6702,743,2618,6841,7492,6068,9150,8852,5004,9610,6716,7053,4937,6209,2772,4454,3988,432,8097,9400,3194,5565,6266,2821,4769,5019,164,443,8620,695,8173,7705,5081,1376,6573,9364,7328,2513,8020,2361,4915,5346,7410,2379,5538,7560,9431,1049,9069,9616,9368,3998,3240,8006,3177,4380,794,8668,4685,3456,2257,2645,7269,2424,5209,4198,3086,6821,7598,3764,7505,6191,9018,7019,338,5606,1484,1962,1415,8423,6988,9140,8305,6196,2299,3397,8634,3855,2139,4924,7102,4662,6713,1056,5418,5982,940,3149,9245,637,8873,7651,2975,6447,5539,291,9119,7773,9287,4286,858,9111,5012,9499,1595,4408,918,5742,5134,9475,8427,9556,8422,4825,9747,522,266,9267,7351,5413,7374,8556,8014,6194,6076,3011,1612,217,6101,7673,5623,6757,5038,2615,3711,8296,7453,408,868,4090,1038,6549,7307,7886,3571,6450,1947,5236,8943,5827,1325,1278,9292,1930,7778,6039,3935,623,7886,256,1194,833,4219,3641,1047,2543,4442,9242,150,8148,1460,9650,5882,9647,431,7709,714,6345,6104,3240,6151,6310,7220,216,6452,3271,3368,1247,7870,8492,2124,1932,3524,5515,2911,8798,7242,1019,8154,3942,5654,5994,8323,449,1914,5680,2821,8399,1904,6356,8538,298,7418,2339,1672,2948,584,4877,2702,36,8044,1528,3815,799,8865,7043,5846,3204,4238,3012,2060,8169,9422,8049,8871,1517,819,6066,4821,7262,6131,9774,9210,9683,338,3573,3812,4398,5022,1313,9705,792,3644,3397,529,8340,2683,524,5635,6653,9852,8619,39,6060,4273,3026,7680,6861,4470,8,4094,4720,388,9344,7749,394,3603,8406,8713,9328,4423,3074,9966,694,4094,3627,6926,3558,4322,1720,3814,7277,5770,7077,9871,7872,4016,1196,7425,8843,8631,2500,142,991,9472,1603,7433,2955,5213,3083,9960,3993,8940,2675,5442,8308,6653,2105,4640,2020,8924,8918,2949,4949,5442,9580,2811,5205,7078,9779,5049,4455,3420,5586,6315,1629,101,5384,4917,7629,2731,8121,2852,9260,8445,2896,8075,4667,2164,7085,3616,3177,9104,5318,8728,2332,3943,2388,4352,8537,199,1655,3881,7058,3912,7027,5721,9737,6031,3265,2699,8285,7835],
     "k" : 314,
     "output" : 36150 },
    {"nums" : [3135,245,9277,2315,2945,7091,281,1242,6725,1544,2364,7756,7908,3272,3358,1851,3096,8914,1835,5922,1479,6028,2541,2284,4979,571,1700,6434,62,5378,9973,3997,2880,9307,277,8486,2374,6135,7181,5942,3870,1986,2382,9229,1429,3274,4933,8707,3151,6328,6374,3921,8578,260,7540,304,7441,6931,4160,7894,7486,572,6882,7664,887,4945,2517,7416,2258,5316,1078,9260,9866,9741,8001,1146,5318,2397,1808,4934,3480,3992,6079,1545,764,6841,6900,9452,9575,3076,9535,5559,9289,192,124,7681,6602,1979,3867,8333,3049,3739,1812,1795,7687,5635,4624,7012,913,9680,3012,1286,9490,4001,1238,7961,1492,2559,5897,3661,1665,2976,1448,6901,9761,5762,4156,3341,8422,2810,3574,3751,8130,8719,4145,7881,9438,2332,25,8968,676,4668,1108,8456,4335,4627,6961,8516,7091,9051,6092,9834,2732,3623,5324,2043,6833,5639,4004,1780,2946,3501,60,3395,9217,3304,7444,616,6929,6576,724,4138,6198,8560,638,9182,7067,4431,7138,8623,98,9259,3379,8451,6353,4599,1990,5979,5802,9079,8500,5795,194,6180,68,2157,8181,5961,9229,7840,2645,8624,1112,5115,5146,6301,1202,4813,8123,8005,799,9593,3700,3178,7775,4141,4908,7944,4617,6401,2743,9803,9092,8303,3705,9195,6594,9755,3687,6797,507,8679,2077,4597,2287,7658,5964,5487,9429,4648,836,7128,3295,1030,5782,8829,4700,5287,8155,3356,8283,5881,88,4196,5108,4551,6153,9088,4594,6358,5537,8300,4002,333,9792,6861,8098,7262,7663,2517,4023,726,4036,4711,8529,5610,8088,408,143,2227,2526,8651,7918,4747,7283,599,6717,3426,1149,9063,1243,815,3145,2751,4639,413,6607,6700,7102,1559,3911,8077,900,7035,1025,7278,6835,7413,8743,7598,3347,6002,3644,4171,9132,5199,6822,3531,6499,7653,1797,6960,3358,3508,1082,7217,1136,2561,8878,7968,6292,2419,4412,2790,3472,1299,9502,8683,3884,1757,2812,7986,2932,8056,6798,7043,3556,2001,2306,585,511,7680,7973,5934,1519,4203,3232,7724,9619,4934,9866,3046,5755,1637,4709,6935,5095,4746,430,4568,4865,2085,4528,2480,6035,8693,2862,9894,5058,1190,3860,9664,4704,514,5775,4851,6029,941,104,428,6859,9759,9206,7749,670,5661,9032,855,957,6636,8864,6320,2488,9585,194,5352,7224,4197,4509,8311,8188,9072,1998,8117,1097,4229,2878,3638,3649,3503,7591,8391,5579,9863,2074,1711,9725,6628,8432,2603,519,5654,3709,2207,6495,7253,5108,1868,6546,9414,8191,7970,9928,5387,4961,3428,6480,9465,7879,2844,741,6613,5743,3004,3486,4517,7113,6868,7717,1242,9030,6578,9138,2630,5704,7045,9650,5506,9544,5875,2364,2483,8957,6823,8705,4145,7628,2382,9381,4178,5277,6323,7292,6782,7147,7032,4691,4242,52,424,6754,9593,2274,735,1638,3514,5510,2537,2775,8064,2111,1232,9090,6265,9750,7263,247,7184,1273,761,4605,9283,4302,4169,2338,3786,6029,9243,6093,9875,7110,3074,8735,8104,3297,5565,7784,7797,8757,2056,1346,6658,4878,9409,9656,8444,2785,7681,379,7575,7819,366,5206,7734,951,9744,2063,7775,8048,7634,8553,9339,4710,1870,1839,6745,344,3099,453,9065,8066,6632,9913,4556,4666,5394,1849,7716,5321,9727,3652,2340,1264,4562,9690,7183,5823,8395,8196,5910,8080,8309,6599,1475,7063,5161,4698,5726,3971,7788,1092,8527,9565,8063,9759,5597,3286,5623,206,9149,3803,1066,2018,2439,9598,6791,6509,5173,845,1152,3494,4792,8811,4416,8019,2033,9350,6536,7345,808,1807,8276,2377,4588,8603,5331,9468,5663,9249,4997,2963,7717,9259,8085,8132,271,9713,1013,277,421,6122,420,4682,8017,3029,1415,7755,1421,9961,237,4411,4627,7895,1027,2316,3441,7867,9000,273,8471,8743,8002,5213,9896,4536,5576,6009,1752,6508,6786,9410,8248,3963,245,9068,4968,1513,6055,7128,3294,4431,1832,9327,1897,6065,4889,8725,979,7244,2937,4121,7568,5363,4788,2495,5785,8991,1327,6730,5931,3010,41,5468,6774,5925,7371,7943,6058,1948,4325,4202,9461,6293,124,8849,3288,5880,1904,5329,1672,1576,1862,5221,4430,8550,352,9149,6707,9426,3852,6388,132,4586,2243,697,9454,8983,4364,9189,3909,7312,7454,7796,9570,2452,2495,9527,6927,7032,5911,8172,1634,2997,6923,4962,9583,5118,1391,6836,9540,883,7076,8095,1622,4672,6592,7617,9987,8477,6981,5393,2471,1517,6620,706,2323,6763,3744,8217,8682,2301,4875,2473,9446,610,2169,2527,4583,1050,6901,3495,1269,1794,702,2355,3627,2645,9724,3422,7950,2206,3336,5242,4547,9773,51,9481,8834,2596,1535,9365,438,2162,3791,7470,5298,4055,6696,7885,6951,614,1519,4117,7778,1768,1485,4679,9496,8940,9237,6553,5725,5308,2928,9188,2838,1340,7994,659,8944,6633,2764,3430,5994,8771,2585,2792,4022,7036,1672,1885,9983,748,7559,3328,5970,2283,3495,7246,3296,3402,5162,6617,9752],
     "k" : 400,
     "output" : 29725 },
    # New test case takes for-ever to run... Basically does not complete
    {"nums" : [8311,7569,293,5428,4351,5433,4365,1555,852,9225,8589,3603,8275,6077,9758,7639,8633,9612,1555,8567,6819,8425,8061,7273,5917,3142,1828,5895,3109,1533,3449,2081,3189,704,7929,4288,5179,6244,9360,1621,1210,4829,4034,5053,5857,8862,1193,5336,5268,751,5969,7737,780,113,8397,2048,4854,862,1109,4008,4798,8350,1460,7095,5648,926,7601,6122,7759,9375,7163,5707,7516,9694,3430,2953,544,6199,3665,7486,3578,20,3420,6931,2029,7084,2041,8387,2960,2794,1425,4001,5154,3697,9368,8355,2489,7242,929,1877,511,5917,8940,2651,1463,5577,9332,4032,133,125,8966,1220,7705,157,6990,6515,4428,3858,9342,8721,2453,5464,5385,3329,1640,3301,5482,7802,8750,2286,7575,8463,8248,6459,6555,184,7243,4905,7638,2434,1758,5499,3243,4466,2197,5465,7267,3825,7464,3410,3493,2040,5007,4701,3545,499,5131,4302,6275,7685,6795,4219,7157,3355,2096,1947,3718,7495,5325,4561,8767,3101,9774,4823,9592,1883,9822,9635,2669,7437,9268,7650,7232,2073,9490,739,5196,8470,4495,9689,2683,5942,1811,4189,6063,6213,2557,3083,858,764,2941,1414,2392,7393,8685,7444,8431,4248,4226,2348,3755,9060,3687,5284,8691,8696,4136,4540,1922,717,3911,7385,5419,9559,9478,4535,7248,5869,3824,9509,8720,469,4440,8133,4630,6034,5412,1440,7966,3255,7625,4859,3404,2546,5809,6676,4147,4880,5301,5764,1548,5229,4378,9471,6149,4999,6194,1466,7731,126,3325,9151,9743,9905,9676,1154,1830,3523,680,9592,8829,3882,4689,533,9897,3211,8263,2117,346,5391,306,1941,4653,2018,6978,5493,2984,398,8137,3259,3522,6964,947,6672,6919,9523,6962,5756,4051,8592,5862,4556,9909,3807,7635,1407,8394,9099,8564,2177,4319,6624,1499,1232,2238,4659,339,2824,4628,5406,7093,1432,1640,5245,5856,5061,9409,6614,9512,3057,6999,3303,6552,5264,7038,6758,304,1296,6150,3714,7026,4030,6641,8869,1931,5485,975,3536,6928,449,1938,7249,6938,8491,1431,4674,2318,4237,4868,3889,750,6028,6937,2660,7811,3662,6879,589,8193,1306,7220,7408,2979,2403,8194,9768,3113,1930,8736,5276,1523,8431,2010,5583,9404,2895,5799,9742,1165,9356,5740,6250,9744,3801,1752,5387,3057,9843,277,2410,235,1240,6925,5706,4382,1672,1511,3796,4035,9517,7628,4295,6059,4942,5935,4671,8991,1469,225,3391,3065,3730,2989,1115,8034,5069,3056,9958,8084,4158,3718,4167,6269,7625,6207,3812,9052,6243,2117,5911,9324,2811,3149,8539,7972,1040,8793,2060,8050,9763,1952,4821,3004,8851,516,6087,2241,165,203,3792,3443,5507,1491,5239,6877,879,9765,1676,8331,5244,4082,8742,8720,820,8163,895,7426,3846,9835,9763,9652,5918,2341,3863,738,1249,7208,805,2803,2301,9494,2941,7845,1950,9427,8334,7120,2287,3266,6924,6233,9233,7420,5351,1879,2412,8678,3134,7967,6388,8011,512,6876,7774,488,5188,8177,21,4200,4079,2459,4439,3019,2655,7069,8115,2954,2522,6860,6821,5497,7605,9651,945,9465,7426,138,555,5808,4738,945,4077,1453,693,3397,10000,1100,4994,4435,2868,1794,8039,941,5251,1988,6119,4905,1823,470,2426,9043,1960,4290,754,2920,4087,5863,263,4182,2298,1586,5458,5016,9674,8543,3392,5676,4684,831,9307,6389,1444,5327,9168,3956,2751,3749,8051,6423,9350,115,9177,5217,1793,6538,5109,6105,2694,9387,8616,497,5227,2212,6264,1017,5839,8131,7947,5583,3610,1677,6827,160,2612,911,7085,6776,7310,1166,2841,1362,71,9326,5831,7239,3655,7544,4204,5166,8995,1788,2665,4532,7990,7176,2166,1557,8652,7563,160,7069,9749,2278,5280,4111,1919,9609,8324,845,8739,9584,2796,4722,1777,898,3947,4375,9217,9484,228,2360,4661,1690,3298,1307,6889,4348,7139,6159,4512,4187,9237,6515,9648,5377,4491,4145,8472,848,8014,8764,3039,7930,885,8890,3955,7715,874,6421,3165,2640,3916,4323,1794,7266,594,6655,3782,8589,6382,5467,4954,3441,2944,7002,1623,9489,3412,1887,9918,8502,9497,3093,4021,8257,7539,3055,2840,1898,3514,4311,9880,6513,4335,9245,1702,8183,4896,6894,8756,1049,4784,4819,2029,4213,4170,9897,3019,6358,9988,839,1213,5991,9327,1832,9186,8616,7143,2385,9180,2502,4973,8670,1819,7457,2553,2681,5130,8143,4208,7537,9628,6853,4460,3818,5222,18,3671,1595,5007,1738,6986,8557,1194,8984,3641,4600,9013,3318,1116,7445,60,6685,7991,3957,6145,4056,989,5000,2663,8378,5279,3325,6351,8812,5431,1386,5640,9498,3372,8060,9403,2445,7960,8322,464,4485,1196,8585,9146,8635,5118,7623,5084,6691,8075,2879,8414,2283,4367,4058,3406,5275,9733,7467,8699,6906,1717,8914,8596,3505,3951,8314,8638,9950,3675,381,288,6312,3999,2573,5978,4303,4575,7787,9263,6022,7246,1312,3170,6399,3658,3449,571,7432,6103,3071,9562,7731,9156,8211,1995,1532,954,7939,2377,4022,7342,1186,2597,7559,7956,9118,3209,9640,2226,638,7438,4914,7818,3912,707,3125,2722,5666,5033,7907,3547,4749,543,961,1625,5258,6556,6693,8688,5535,7878,757,9956,6362,3546,2584,2056,7119,6235,6438,1827,8451,9636,7226,3923,2895,3113,5078,1462,6111,6303,9827,6386,3277,7024,5848,8347,2306,4845,8145,3420,8837,9644,4150,5949,4876,7351,8875,304,511,5816,5168,7529,2548,7435,3163,7771,4961,5634,3018,9306,5687,1523,7225,3346,4600,241,3425,1493,1958,2906,4393,8913,3602,3696,5642,1263,369,5987,8347,622,3865,7238,133,6534,8551,1929,1000,9556,8328,9848,9484,3337,4981,7321,773,4397,9513,8150,8960,2101,1358,834,7147,1360,5814,5890,6269,284,3059,4807,8457,8944,6203,3852,5042,1646,6980,4924,6768,3273,2493,5421,7414,9026,4120,7053,6318,548,1178,14,1799,71,6336,2846,9774,1815,3962,7201,1508,4610,2536,2720,2911,8146,8481,2548,5844,8589,6523,2568,9937,3730,9689,1803,8870,4317,4795,2219,6300,9074,3275,1644,1028,4493,1323,8038,2825,3493,8747,6438,6476,6816,1297,8338,8753,79,1809,1048,3282,9175,1816,1647,1363,5465,1825,6987,5362,8638,2066,8375,9122,5633,5476,3820,9410,5927,5869,2904,8091,3542,1215,4360,3526,7128,6727,3152,8264,9515,5198,1660,357,5914,6228,5053,1016,8125,9995,5127,5123,2748,8041,6143,9582,584,375,4762,1557,3947,1704,505,4676,1400,6002,8351,8192,1080,2341,9829,548,9994,8062,301,4784,1091,7960,4080,4182,2091,7208,6098,6778,9764,5727,655,6845,4958,9549,7787,4624,797,3124,7566,3581,7733,8588,8777,4000,1650,7766,2499,3078,3738,3168,6858,9348,5947,9461,7203,9551,8854,2456,3141,8867,4255,3404,3687,9380,4825,6315,1238,6476,4593,8906,3178,5617,2395,3887,125,4119,5681,2270,2917,8827,9314,9458,2285,303,3996,4106,9617,1628,4651,1410,4663,6826,3306,1773,4343,4614,6065,6912,7075,4254,9395,6543,2735,6678,1238,6454,4788,6942,9664,2540,8604,6584,5073,8692,1115,1699,2133,4195,459,4571,5631,3853,9457,6050,8833,4795,6782,5925,7756,8358,3809,3626,9083,9263,8504,2154,3193,9121,6070,9915,5781,7843,3708,4455,1509,3873,2509,4572,9593,2188,6380,3494,4533,472,8954,8871,9611,9069,5913,8027,6286,9419,2038,3606,2814,5345,5201,1471,8491,3514,1512,9136,8386,5805,6548,8946,9511,704,1443,9144,5386,7272,7628,7146,1344,5450,9959,2014,8521,5972,56,5598,6842,5500,3190,7967,2414,4772,1311,3562,6776,518,7694,9534,8631,2623,4805,489,8763,4848,248,1206,5549,5349,4732,6824,9440,9200,7133,8514,9199,3441,1686,5360,6545,8507,2726,932,165,7861,1567,7552,1491,4542,2534,1319,5617,9629,5517,8917,3492,4877,1842,4145,5707,5667,4251,793,3090,7073,2333,1890,5533,4190,2485,4378,4288,8208,3443,9829,4921,23,5873,5702,1063,1968,5054,197,3830,5143,3657,2025,6252,4746,8559,1257,4305,3033,3083,4389,31,981,2913,3997,413,8761,6098,4697,6380,5298,560,7565,5471,7221,7754,9698,161,8284,8024,6274,7358,9104,3581,84,7388,7307,5705,3306,8864,4302,2580,5063,7279,1064,17,4217,3723,1221,1991,9159,8131,4438,4959,4155,1793,5407,2676,4349,1396,8802,6767,2424,1558,7395,8663,2497,5771,760,316,972,2743,5612,1362,5634,5419,6566,6382,8899,9989,4786,9386,4852,4930,3567,6232,2363,1656,9190,7605,8050,1084,1075,280,3017,5073,2472,7463,2375,8470,9037,3491,9627,361,9915,7967,1839,6068,1463,7962,5829,9182,5613,1856,8260,6988,2231,4063,4663,9007,5679,6726,5206,4945,8966,4309,8008,6522,3410,9752,137,413,2599,1690,7086,6487,3901,694,3209,7076,3541,7739,7270,1309,1643,2436,2750,1976,2086,9002,2673,7910,6592,684,3328,4213,7645,9719,4595,6153,8186,5829,6997,2610,6948,9116,1524,5150,8594,2389,5674,935,2860,8612,2278,3894,3304,4111,3833,810,3950,7303,1314,1863,9989,3804,1820,6471,2908,3873,9865,5890,5935,3093,204,5728,6508,3496,8740,6490,1606,2071,7893,3646,2892,5086,9642,9661,2775,961,8660,8083,415,7232,7224,4061,9133,365,2596,3152,6355,2590,3713,6920,6127,9216,8902,1686,3280,7820,546,2344,8205,5934,1385,1004,5814,4236,8910,6726,6763,541,4195,6660,9068,2055,396,5551,3352,643,894,4067,2489,4674,7496,5999,5796,6635,8342,4497,4051,7910,824,5998,5519,8956,563,1591,8787,1768,5238,2227,6430,4365,8237,2362,9751,5801,4381,3509,28,9671,9042,8372,6745,9432,5202,1761,4754,5119,395,6408,7930,2620,8107,4892,1663,5679,4258,7646,2806,6925,393,4976,7744,7332,5017,5387,5460,4892,5793,2642,4563,6147,8944,4127,2965,4260,7105,3864,6413,713,3543,6478,2037,2895,3414,6705,4380,9563,3143,1697,2399,6946,2975,4936,6640,5461,2257,6387,2457,2982,9797,8881,4269,553,6859,8782,5764,2790,2834,4368,1927,8401,2314,4761,392,3715,2375,515,4127,8939,9973,1423,7499,7638,3409,5502,9921,8574,2468,9360,9055,4217,6045,2629,3656,2954,7901,9777,7982,3417,3599,9589,697,528,8480,3043,3852,7265,4922,669,1261,4787,9204,411,8115,7598,5268,4565,4329,2748,2249,9829,8122,5442,158,8759,3410,7365,3918,2570,5917,3425,2907,3483,7679,9969,7206,3375,6574,6680,4194,940,8049,3472,5867,8502,3099,9719,7954,2292,3058,8702,3065,7906,3485,3434,9518,8561,5036,4888,8402,7535,4344,8409,1161,5614,8588,8908,9794,9480,4424,3297,2542,3841,5233,3603,4839,363,9690,7137,5972,2066,2312,1353,5045,197,6028,8230,5282,8012,490,720,8054,590,3157,5141,8222,5597,1833,6458,6458,4714,5245,4516,7367,1496,113,2293,4444,9729,8787,9252,8691,9219,142,4712,8700,1856,1059,9724,5836,2039,1281,6287,3642,2926,8504,2680,2766,4353,6657,1065,2179,2089,203,1136,6057,2061,9520,5854,6713,8742,8621,4697,951,541,6653,988,2389,3770,3917,5135,2918,1868,6962,797,7936,9499,3727,7171,1868,8712,6843,3701,9772,226,7959,9774,1713,8640,8016,4648,233,9709,8037,4493,5348,2377,500,1560,3379,8834,2071,2421,1409,6268,6048,4572,3144,8792,7888,5876,536,2397,7515,9043,2195,7998,1414,2670,4279,2917,2672,9902,2945,7811,5613,7008,8665,6525,1402,9623,6849,4203,9799,8639,4519,8795,7669,4481,9666,4394,5881,546,4995,6615,356,5427,1848,7409,1689,1279,4312,4821,7958,551,8117,9669,50,1092,3904,1605,5695,415,3524,5595,8937,3448,5291,1619,8081,2584,4842,4602,2052,633,8951,9316,6258,3476,3746,8514,9417,4067,3849,6377,2682,2042,4377,8814,6821,5844,9299,8639,1489,4988,4281,7764,3982,6248,3268,4094,3740,229,7828,5060,5552,2646,8387,9781,201,1066,2040,7100,1360,7206,431,4215,7437,9431,9541,1209,5258,8420,6298,8032,8794,6689,9240,5738,5777,1198,4299,3577,1821,9477,2639,5369,8765,7398,9467,6876,734,3691,7802,944,6586,6688,3566,1849,4746,7719,1391,2737,6989,2495,55,2561,5615,8552,8925,9648,6686,8389,4597,5561,3433,8324,7804,2084,9916,8777,6435,5683,5431,3759,2686,8475,9557,4474,820,3440,7589,6294,3424,5002,3875,1273,8413,9894,1988,7766,4252,3512,598,8345,9092,7846,2489,7439,676,5930,2577,3098,2894,468,2021,8250,2820,7116,9429,5102,6577,2313,2658,3766,8540,7021,7197,4900,6973,603,6748,2303,9099,9619,7780,1791,8221,9490,2253,8665,8647,4936,7593,1194,1954,8398,2883,3843,3829,7791,5892,5027,3929,7775,3488,4649,9559,8584,9259,556,3690,7902,4622,4857,8058,4369,3449,8702,8809,4134,9798,7241,3477,6373,8933,168,7264,6654,1343,7013,1063,3888,4234,4959,5606,620,7624,4973,6976,7413,9374,2350,1662,2383,2136,6696,1279,3896,8959,7868,7343,2273,5838,6687,3564,336,7384,6856,8091,7469,5727,3840,8848,7416,3789,5608,7770,3733,7400,9970,8382,8362,7351,5033,6265,2378,2948,9431,1643,227,9660,6403,2427,5628,1233,1949,8194,6841,3247,5907,6764,6056,7881,7315,5248,8430,3588,3638,6710,977,3659,3774,3518,6846,172,1638,9497,230,8710,5073,7444,7523,5899,1070,5487,6596,6533,2012,276,6109,1132,6633,502,3756,3383,177,3031,1088,3918,1000,6561,8827,4806,2328,4333,7943,3908,3172,1546,1288,5456,6883,110,1068,5801,1391,6412,4850,892,9467,1747,9992,1209,6540,2226,244,5786,812,5174,1756,2269,689,5448,7331,9031,3416,33,2608,2234,7762,6681,3891,5371,8160,3127,7465,6522,448,9357,3644,1750,5332,136,1606,5965,7736,7696,9167,4848,8773,8848,3276,5190,5925,739,7729,7016,5815,1825,3506,5003,2613,8401,3902,2978,8082,6781,6878,8290,8896,767,4700,9995,2308,4189,643,2693,4047,1912,8130,9586,3566,3530,3913,1570,3537,6724,2649,4407,4374,344,1285,155,7237,3764,402,4164,1885,3475,1326,384,7948,8352,7512,6046,856,6608,1760,5358,9054,7511,3311,3196,6888,9650,6455,2592,8348,1187,1715,4933,6878,2249,6825,626,5799,2649,1133,4362,1343,341,5050,9681,8005,3385,2725,3253,1617,4969,5549,8981,2038,4626,1588,63,7311,3697,7192,6772,6164,3251,542,5339,6334,9942,6336,9607,8208,9413,3764,1886,728,6831,6731,1618,2106,4392,821,6009,8258,9545,8746,5370,4191,8863,6694,8269,780,812,9112,5571,9161,1462,9006,3205,3264,6960,3987,9259,3490,3003,7220,5247,7920,2861,1392,4156,329,2371,7933,6928,9104,358,3268,1522,6303,6547,283,621,9612,9983,8701,7838,6930,207,9579,1778,2475,1944,5987,5330,1169,428,6399,131,5862,8073,7721,5604,9315,1841,9328,1820,9449,7393,7498,3829,7638,2780,3717,8546,4081,7815,5682,8417,7073,5938,3378,7772,2201,6714,3773,9584,7254,531,7356,1350,221,8359,6746,8385,5661,8515,6693,5309,7975,3416,4400,319,9305,5469,7639,5138,6436,8719,3460,8042,470,8429,1813,4440,1846,228,8946,6081,170,6725,1791,541,3849,8050,7008,2836,5579,208,3767,6133,3415,9670,4063,5573,5953,6849,6375,5191,7427,3504,2846,3498,4354,7196,6264,5900,7908,8672,578,4384,2108,799,3404,5452,1285,2558,1544,2260,8319,4531,7010,8867,9413,7414,9372,3424,681,9879,1155,3944,4369,9552,865,2859,5883,1950,5693,4332,6106,6389,4316,4524,8456,4234,7093,6584,3793,3627,5944,3431,1163,4016,4763,3205,1149,4403,6764,3672,1622,2521,712,2755,3301,9512,3382,7944,509,827,7967,5097,613,5642,9391,3109,1193,27,8330,9084,948,2038,1334,4424,559,4933,8341,1063,4266,4448,9184,8697,7272,1207,1169,3219,1114,1541,6733,496,1234,4990,6102,4008,4182,6324,2539,1406,3472,5227,5921,4253,5936,1590,8762,8611,4922,8620,9438,4779,8255,8755,2642,58,1691,1023,6718,7290,8437,6685,2111,783,6194,8780,1078,1682,6135,2895,4501,1056,3669,4893,5104,7523,6710,5542,1048,6149,6973,6730,3553,6421,9685,8363,4327,4652,5998,8883,4105,2649,9724,9480,4500,297,7184,7737,352,6338,3040,9962,7290,4707,951,5047,9530,5725,9265,7148,4140,5353,700,1733,8605,1228,4512,7091,8950,5496,925,7668,9923,2018,5078,2275,6720,4177,6560,3412,9746,8462,9897,9562,7618,6040,9400,1523,1617,7425,701,1205,1468,8567,6214,1497,486,1471,7728,4360,9869,7602,5922,1500,1836,4542,6655,4507,8310,9208,7493,4981,5195,3938,1923,7148,467,6817,4830,7736,5376,9053,9389,1976,5345,8349,940,3643,2041,4402,7453,871,4440,4363,8384,8709,140,1024,3075,3270,6481,8072,9041,7731,6531,8823,6124,3432,5351,3195,2824,1406,4307,5775,9100,1802,9651,5518,986,8330,1269,2068,4475,4728,3318,5749,5332,7714,7554,6741,5634,9707,9442,1797,1150,5420,3,4288,765,5001,2444,6217,805,3482,1275,6046,1180,3348,9167,1657,2626,3776,320,3480,2817,4889,3434,8635,2160,7102,9345,9605,6707,6301,5823,1936,6689,634,3457,5450,7256,3929,3734,9630,6098,2437,3913,2663,9998,6780,8705,5071,5874,9283,2235,8090,8997,4812,4488,1072,7888,73,9403,7344,4741,3287,5201,6406,1757,9822,3006,7656,1411,9520,2364,1000,1929,7190,3201,6808,5639,1240,5961,4587,8900,8468,230,4525,5894,3377,6056,7243,8685,4575,8827,1072,8659,4949,5911,1788,7639,1352,2461,4066,1041,9486,764,4440,9343,269,4728,2902,6145,3871,1873,623,9508,2226,7335,3190,656,1060,8895,4439,2228,9421,8146,1486,3322,7803,4960,6576,2239,5618,1637,237,1919,6400,8828,5284,5095,6194,7954,5663,8522,3810,2139,376,3878,4626,6864,5112,6643,8118,8382,5698,3548,1713,3138,7331,1516,4133,909,270,9532,9657,3445,515,4568,2844,1072,1050,8145,4149,2508,6445,6906,9196,3319,3320,9902,4366,8786,5913,3087,883,5325,495,4474,4294,7004,5191,561,3488,4078,7536,3144,5833,2771,9165,5346,406,1246,5826,5557,4756,1810,5485,9961,1424,2644,2491,3627,6321,8137,9616,2066,4047,6165,1898,8766,9121,1273,5392,5534,2881,3987,7066,8201,7851,2425,2284,2012,5289,6335,4367,8173,8915,6840,5605,7013,6427,5158,3666,148,7859,339,9590,9953,8568,9276,282,4760,4162,9674,2272,6952,2199,9420,1103,2594,7692,7682,5549,4151,8056,3182,6602,901,9650,4225,1732,4235,7758,3027,7397,6242,3423,959,8213,8789,7274,4763,3408,1754,9663,8813,3000,6571,5988,9394,3024,1533,2546,4428,8098,4939,6671,4852,6701,2920,620,2618,9012,7065,1451,9199,8067,5711,4237,4417,3714,1143,5574,4692,7034,1810,8549,5675,4549,7310,2464,3587,5350,6708,5515,1781,3464,8660,1394,1793,1863,315,3240,2902,1425,149,973,4498,5112,7036,6488,3160,8197,666,2944,303,631,4591,8717,935,8959,8182,6803,5039,1072,9380,5037,6582,7080,7260,6609,3637,879,9279,9642,5202,7828,4280,5689,5428,3336,16,3639,4659,6732,3252,2688,3965,181,4815,6513,3111,297,1597,7193,4833,1825,6079,6119,3483,3350,275,2250,3851,3015,1504,8425,8839,6944,4312,7627,3072,5973,3526,2221,2677,4013,5036,9629,2553,7211,5506,4097,1410,5244,7646,9312,2114,7281,9691,2789,6428,8408,9270,7060,7715,3762,5312,3505,1305,5868,7700,2796,5591,2945,1060,8754,2419,2170,8911,1494,5199,6204,2619,379,391,9507,583,7262,3366,8928,4728,8689,2873,4538,522,743,1521,3162,5267,4447,1911,7261,7501,3582,3169,462,6158,112,6239,3837,6605,1872,8984,4755,742,3617,2367,8896,2637,4817,7197,7815,715,3690,9565,6839,9188,303,2524,1168,5042,3191,8408,2235,2606,8605,5510,9273,6282,5932,5554,3308,5834,9465,4550,9809,7231,8714,7106,1475,2693,2216,7951,2511,6611,6959,7065,6785,732,2697,8232,6343,2394,6167,8522,534,7531,5263,6834,3307,393,5933,4357,2683,9624,7579,9761,9168,1236,2773,7123,6996,6257,4558,4883,5548,8463,9321,4738,1225,4389,3555,5817,5674,4762,9683,7140,4609,8614,1209,3521,7270,9806,3635,3115,4925,2773,5197,5017,6533,7249,1950,513,8183,5088,924,6888,6259,3000,8376,3292,833,7351,5102,4138,2423,8005,9939,141,9256,2479,7104,5719,9057,5359,6373,4845,243,3848,5416,5225,1923,9975,9306,3091,5330,5686,4532,7762,1615,6344,7758,7762,2709,6828,9352,6258,8759,3621,4336,7806,8414,3820,2859,6969,9527,6823,4183,4550,971,309,5438,9829,6803,5702,8679,9630,2825,1013,3191,2822,4543,60,8734,318,771,8555,9126,9786,7798,8523,6029,2275,5259,3355,4367,7945,5124,6428,1811,9071,9202,4915,4727,8033,409,4065,7038,2926,3750,2806,3512,8571,7268,9077,4918,4746,4774,1679,2277,8706,1547,6188,8031,7911,8212,6613,6892,6564,21,5971,7287,1724,4664,9565,9916,9728,4160,1906,6733,648,8297,1399,2596,9857,8078,2194,9129,8528,4001,7455,7981,5787,8932,1560,2675,222,674,681,5176,7710,1818,1664,548,8681,3512,6921,7962,4662,2623,797,5554,7426,3511,5210,6359,7728,9320,6897,3599,6091,1446,689,1093,4147,8637,4919,3389,2867,6712,9452,8189,4869,2617,5528,1226,3383,1566,1140,4259,9949,651,1448,6734,5082,1281,9037,8173,4677,2037,6679,1464,7197,5497,9214,9520,6527,8665,7175,337,2365,560,9938,2068,5748,6329,7989,8111,4284,6218,3393,4146,6916,10000,5308,4499,5337,7128,5591,755,7744,7046,7168,9608,943,6223,4697,6919,6289,4634,6302,1801,6205,6888,1381,701,1724,7062,1734,3836,8571,6522,5001,9183,6248,1285,6644,1838,4533,9434,2979,4114,8864,6400,2858,3408,3937,1992,8993,1586,955,2153,609,2334,8229,9460,8636,4295,2801,1054,9122,5065,2062,5338,8730,3584,4284,7688,6865,4560,6337,9250,455,3062,8305,9673,7665,7311,9791,3829,8268,1185,9784,9314,2029,5706,536,2612,9088,5788,585,5859,5583,1756,3118,2094,49,1634,7067,5374,6618,541,1430,6270,3087,2706,3383,1285,8222,1058,3466,8802,2970,2960,4265,4465,9341,6665,2437,7306,7339,4407,3869,8088,3293,8440,3551,6428,1537,234,6674,9876,10,2900,8264,7690,7982,7674,7249,2495,5657,3721,6061,6111,5316,5742,8537,8752,8077,9150,8190,8887,9041,1720,182,2635,2020,4379,5177,4828,3997,1663,8024,2442,8141,9732,1217,1743,3422,7738,6043,5610,1399,8079,6261,2296,1250,8195,6372,2327,8797,5839,3437,2845,6330,8413,6558,1884,7467,8658,7978,9228,6153,8183,2333,2680,4437,1181,1640,9616,6952,4886,283,20,695,4083,7558,1557,2028,4122,9195,1450,1152,2067,5179,378,164,6370,3051,7892,6012,4745,4940,651,3712,7059,3579,8580,9496,1128,5667,1688,6255,7139,1841,3626,8223,3434,2597,6291,4105,4157,3795,7364,3177,2295,6461,7533,4032,9123,203,7050,3135,5033,541,468,6949,6435,4144,5038,3290,7767,3192,8665,8317,7056,9751,1170,5490,9481,3936,2812,1921,6492,5472,5169,9657,6330,7090,2521,2232,551,2783,2466,711,848,7309,1095,4344,3623,3315,6951,3210,2651,8667,6547,2082,1179,1031,9359,7194,8747,4409,7665,1921,4244,3349,2845,678,7971,2105,1279,4672,8989,8674,4314,5949,8244,8454,8258,8400,5908,2205,2343,6655,460,9807,8533,7236,4979,5171,1025,4650,4459,7235,5739,2081,2419,7460,4769,9754,5223,2707,7995,6087,1925,5858,1955,8539,1483,5673,4044,1777,3819,9521,3599,2524,7606,8555,1488,8928,7919,1919,8680,9485,6485,7013,7781,1970,5711,1537,5430,7548,7384,5133,8287,6272,8524,1335,6904,194,6654,6119,2896,6682,9345,288,1616,4606,657,8826,331,6495,4508,385,6021,6201,4270,5664,1060,2772,3543,1895,5356,5435,9246,7604,9572,8026,4902,5863,4249,7616,2845,326,7405,4349,7416,3987,1719,1810,2015,7839,6551,4215,4145,3208,9130,3725,7914,7535,9052,9401,5401,2819,1295,8472,9542,2785,8969,6140,808,7935,5792,9335,3474,7324,5497,9679,3767,9961,2127,1839,4158,5066,4926,1550,2048,81,6865,3674,3612,834,3710,9565,1801,2146,4267,2835,9353,6613,4948,9291,3447,3988,5208,4981,2672,4850,2775,1400,8866,9538,1271,3271,4272,5128,2534,8891,2845,7131,8477,7080,7348,5554,3992,2482,7431,5607,8866,5107,4680,2695,4092,1008,4576,7417,6746,3263,2163,599,4000,125,645,6708,4273,4158,2792,8900,4564,5556,7964,4492,4420,1051,3283,5726,5408,7899,3738,9329,1319,6735,2222,4934,380,1149,7880,8281,3559,2818,3544,7540,1990,160,3814,823,5470,3488,7845,2202,6571,4236,3465,5312,1923,1643,3084,1599,4573,5643,9833,5072,8146,7512,8668,613,2539,1332,8585,3349,5572,4793,4850,545,9599,8229,5896,4949,1288,9060,4374,1356,123,6547,9774,8221,9484,332,7359,9661,5793,782,6160,9041,7079,4338,4510,9830,8592,9408,8218,5186,8178,474,7210,7405,1309,2133,3702,2308,8975,5637,5348,3459,3157,4729,6522,7075,9530,4311,9275,6288,421,7492,4107,5951,4489,5024,9221,7203,8027,7872,4044,4820,5809,2006,2934,2594,6622,3777,4271,6598,3485,5827,1044,8920,7854,1456,3688,7124,6187,9140,3694,8257,710,8868,2814,4502,3501,6099,9816,8888,9546,240,3382,6970,1790,1922,4782,3168,8524,6279,8182,5590,2726,1472,8957,6548,7890,7053,3890,6544,5302,3582,9239,6521,524,8562,3280,8585,2390,5401,8098,5224,3225,8066,2048,4935,7677,7697,2104,293,7148,4826,2072,9741,1784,3976,9267,9850,9318,9649,3303,5957,7489,6384,1986,1724,7595,1695,6297,3286,2560,8284,5174,6493,176,5487,3719,4408,6713,8072,7041,221,6763,6708,696,8711,7170,4192,5953,3215,9451,4100,31,6713,7150,3662,6156,9988,2370,7652,9465,3814,9899,5647,9014,985,434,6032,8361,9681,3163,5721,3079,490,9398,781,7496,1414,9240,7158,1125,3727,7314,5108,6393,8747,8771,1138,9695,7030,9263,7915,7015,4589,1704,7521,5302,7975,67,9875,7182,5121,9549,9085,5062,9223,760,8646,4948,2107,9776,9534,6077,2,6149,370,7661,1291,6144,7900,891,3883,7426,1570,3693,6132,40,309,8071,4451,9450,9148,6928,5739,8275,5008,3367,8700,5857,9227,8339,3704,2977,7565,2856,6618,3054,2265,4386,2844,2488,836,7835,6132,6412,5468,2096,1277,4690,723,463,2166,2852,719,7885,8501,8843,851,4144,1868,5464,6699,2424,608,8714,4488,4559,454,2434,9737,1337,5840,2139,8916,6736,6795,4437,6100,1640,5809,2168,4301,3283,2861,1692,5661,4342,152,6333,5980,1134,6087,5474,5516,9252,6008,6295,3001,7387,9740,4947,9632,485,9569,7009,1405,5142,4159,7517,2633,1854,2042,3776,9375,674,9846,9520,9158,4129,1636,2450,7092,5969,2333,515,6259,9493,1640,2173,2273,4139,8400,13,9192,6706,9974,8408,4461,9471,3083,366,9131,8172,9826,5151,8099,7971,257,7657,5235,1487,3453,9454,9581,1389,9456,3973,7821,1489,2466,6379,8501,1846,6975,2169,8947,2764,3164,8906,4258,9447,8153,7944,2246,9974,6000,7520,3704,4250,4269,6302,9289,7499,2370,7387,1343,2654,1860,8166,2544,683,9368,4678,7199,9739,7117,6786,6698,5441,8489,5626,6486,5098,5361,7700,5321,9433,8156,4597,8013,8423,557,8164,4426,4636,6590,6483,7612,8399,3751,4328,4176,4746,9376,1403,6143,8218,1517,9455,7436,2277,9789,1673,1083,1690,5504,2614,4535,244,3248,6876,5121,3273,4091,4525,1254,9379,5825,9686,7131,4334,3049,294,7691,81,5981,5962,3537,687,1842,2956,7233,6610,1271,7496,287,1803,4092,9027,4693,2945,8115,1261,2826,5609,6734,7561,6302,154,745,8965,6479,5436,3908,6767,1615,4879,4252,4841,3349,3424,3460,1662,2341,1419,13,8432,6779,4439,437,8931,9442,266,9202,7189,858,3781,9539,2543,9596,3348,3011,2139,965,3702,6553,562,572,9083,6631,7088,4939,30,5683,2127,8078,2692,9463,795,233,4615,9055,3901,8262,1193,6557,9081,4811,7643,9510,3690,4336,6079,3584,9214,2205,5043,2137,3759,2146,4080,1108,7706,739,1899,7362,2615,9481,7472,5566,1411,7525,5081,4272,9881,9259,8265,8798,7050,6621,4943,5925,1664,9933,282,8374,5897,5182,8419,1301,6026,6244,8389,3294,5722,2145,9573,2720,7282,6440,1548,648,4981,7428,1956,2007,2550,8159,7252,7720,8293,9939,7117,626,2593,8810,6689,4294,9111,1070,1244,658,2641,903,1654,3460,1492,2673,4727,3441,8197,8076,2623,1103,4432,9383,8334,1703,8805,3902,8961,9765,1661,1939,9334,8697,9337,8640,4444,5163,5219,733,8494,6044,274,7866,7847,9028,3066,9246,7595,9086,1560,4034,1394,1701,7197,1536,663,2679,8443,9632,9405,9164,6111,6160,5790,9650,8344,4467,8066,4236,9107,7738,4128,50,2934,9716,1988,5132,5450,1703,7586,1730,1337,5729,5948,8991,7470,9544,1416,6949,2959,7363,5762,9083,2181,5911,3261,1233,2329,8197,3340,2797,4321,4812,846,1509,3975,353,2087,9717,4688,1560,8847,9410,3380,3383,7636,7310,6042,2669,7120,578,6731,9540,4954,7276,662,2459,6201,9863,5158,9627,3203,9531,5480,1149,3479,5935,9978,9422,4169,7303,4443,5295,2151,5503,5333,5364,8399,9048,7507,4230,9400,1921,4202,6932,9613,4171,1778,8528,7793,4002,2938,1113,5074,7687,6838,8570,8436,6467,6820,1864,5239,8898,24,1285,2376,4717,998,5408,5306,22,7852,5316,1005,9736,6938,9273,7133,3998,5439,6888,4128,354,1499,9252,3197,4504,3103,2375,9023,4404,9333,6077,7779,1066,7,3977,4513,1284,6121,2251,8418,163,6052,8055,7096,155,3045,520,8604,5926,3160,6482,986,7215,9123,1135,3864,5515,4450,655,9309,5487,755,5365,5963,8119,9579,3735,6791,7170,5484,2003,6619,3008,7634,2598,3652,6445,1962,8380,4739,236,4621,3580,6897,906,9442,3216,1613,7342,7710,8631,6852,5177,5450,657,5538,1703,8074,6498,5232,3088,7972,2005,4272,1254,2832,382,8956,4057,5048,6570,5314,32,3423,5080,7172,8791,540,5494,7765,1299,1757,6485,4861,2460,7697,9667,6037,8999,3238,2608,8490,400,3461,6991,2760,4085,647,6178,1374,4201,5349,1596,6326,4255,8838,7780,4285,3785,816,1191,9279,8183,6182,4567,7161,9985,9178,4187,2305,5118,9542,4170,1661,5148,2246,8036,5675,9228,1768,9989,2903,9155,1622,828,1312,2050,4701,6952,860,1813,6958,3756,2759,7302,8221,2975,9584,850,7034,5595,232,2009,2062,3671,3657,9017,7574,3928,6276,9984,1342,8002,5996,7560,1115,9771,5236,5857,9885,5621,6293,6742,8312,8573,2495,1260,9809,8513,7221,1793,1394,3319,3521,9140,952,246,4047,1998,6582,2250,4492,7534,1628,1052,8806,2431,9067,9460,8841,6165,782,282,6117,1909,4336,181,2575,7930,3953,9731,2808,5219,3920,3985,6913,2593,4633,4958,9663,7757,3266,9141,3933,464,1765,3741,9490,8434,1746,3848,9180,5398,8784,3558,6354,63,797,7455,8221,7637,2883,5569,6310,7060,8816,923,4023,1284,6624,1551,9633,4388,8762,4048,3838,2356,2458,2013,6125,2128,3659,1512,367,2489,1418,8462,9953,8269,3317,1161,9648,6068,4024,1280,7940,881,5274,7274,9341,9998,5632,5896,8441,9704,5166,4787,7201,7082,4779,4730,4865,5236,2927,2028,4412,4947,973,5648,7385,152,2471,4240,9020,2352,8328,1614,3224,4021,4787,6905,1777,1251,6296,1574,8167,8634,5703,4117,233,6919,8858,1164,4800,3978,901,142,9732,1207,2501,7659,2722,7158,856,2694,7606,3454,7142,2600,3972,9743,3829,2984,7255,8721,2228,3312,680,3926,3325,1186,3161,5337,6611,3186,6320,1795,9557,9051,9663,3436,4526,8951,3510,4054,2669,2366,8728,124,8324,5109,5393,482,9858,1007,8681,5354,3860,9976,4611,6212,8195,1020,7927,9694,5502,6711,8556,8089,4737,2545,781,83,8404,1187,6566,9051,2406,7227,3496,6232,8556,719,8638,317,5336,846,8583,4196,8234,9400,8608,2684,6735,2798,2195,3873,9759,3469,1149,4684,4834,6410,8147,9531,4683,5872,119,6258,3148,8386,665,5645,1550,7578,157,445,7092,5377,2620,1864,3693,9331,2882,3832,2416,6050,8786,1862,236,8258,5352,2901,9413,9369,1864,6272,296,8516,1897,8313,7767,8161,2451,6466,2989,5726,8308,9285,1344,6272,3537,1383,771,7733,379,6089,6666,5269,2886,6349,267,943,8366,428,9349,8917,7156,186,6514,6464,9758,9945,5121,3903,4612,6938,6350,4853,2525,7013,3587,7486,4366,2476,8264,45,6730,7474,1614,6055,2345,6863,7980,5865,9722,9456,1316,3730,1124,620,9368,5156,3334,1281,4313,2779,2173,7959,6202,9631,8012,187,5640,2329,4508,47,8815,356,6363,5543,9582,6608,29,2223,9728,1027,9676,4535,7111,9336,2900,9562,8885,8476,1351,9427,254,9332,1982,1877,4650,7362,4133,5879,3039,1179,6287,6747,1388,8880,8050,3613,9203,9719,9281,4155,6598,2052,4062,6676,6284,1841,1201,5093,5659,4663,9502,2967,9823,5265,9815,6674,6284,5447,411,604,5351,4553,6097,4324,5472,8045,3344,5484,6951,5017,1260,8942,449,210,2639,2574,2021,6550,8512,7934,2021,2925,4637,8036,1973,7565,2116,4706,7990,5440,4373,3213,3003,5399,5255,2176,1241,7319,6263,6769,3230,7210,6313,591,146,6942,4557,5265,934,5121,9842,5860,630,6607,7587,5583,3544,9127,5479,1170,407,98,6625,952,4745,1553,409,4445,4662,8180,8785,6796,6104,8544,6208,4778,7566,7907,4649,581,4411,2715,1099,7456,7608,760,592,2302,9779,4370,6740,894,9156,4932,9006,1532,5442,4296,4135,5803,2932,4800,6007,7360,6337,2806,1842,5370,4145,5453,4066,9960,1409,4224,3793,565,7488,2720,1076,1042,2299,1305,2792,9178,9243,3865,7331,4467,38,1243,9324,2669,1046,6012,7509,751,7837,596,5410,3687,2059,2920,7492,7033,3748,228,2389,4191,6486,8261,2742,5537,1201,3339,8444,676,7959,5557,6941,6363,5278,9080,2279,8859,7227,2376,4805,4001,9610,9197,3839,25,8103,239,9964,6400,4294,8872,6531,6472,446,6865,8499,1729,2264,6651,9885,3503,9890,3701,482,5351,2864,502,8524,3447,301,9173,1403,5265,5173,2443,6550,618,171,5779,7847,9954,685,8488,447,6415,6792,1899,7946,8782,9471,5789,5414,5237,8117,9909,6690,4520,5819,8722,6275,7007,2703,5614,1165,1329,2106,9123,1016,9627,6946,7503,6290,3382,6176,9812,9708,6476,9201,3017,4719,2209,3980,5269,141,8653,4507,8049,3072,3302,7414,2877,5207,1490,8871,9533,3701,8871,4226,2861,519,4803,1578,4228,8667,298,1724,5031,3267,2361,8274,3510,4959,7128,792,8572,4515,6861,1175,8591,4810,9129,3389,4802,9609,2774,17,8073,8403,4797,9428,3346,8034,8146,2272,3638,7229,204,4532,3606,6711,1722,854,9334,7575,4027,4791,1624,1935,4290,4822,5039,4115,2431,4505,4586,2127,6742,5095,1329,1626,9286,2849,7987,978,8305,7500,4453,1457,7272,9502,3866,5374,6420,3363,3720,8009,3416,7216,3696,6891,7847,2592,1488,7995,7526,1584,676,8743,517,1973,8000,7386,2263,6451,6973,9216,9340,2895,6943,6375,1457,6018,1335,560,8637,6040,9164,5310,9949,477,1566,9244,7842,8931,3427,4479,4300,577,8813,2168,2655,8879,8076,4418,5461,2892,551,144,1236,2708,9745,7640,6594,5912,8899,3937,1535,9352,5007,8802,2201,260,8291,8350,9243,2434,6142,4361,1398,389,8942,5860,6213,8586,531,5383,6528,5135,8792,5562,6403,3513,1421,9477,9700,4365,2222,9049,6801,2800,853,5667,6495,7449,4605,9408,7965,6436,3729,8362,2930,4694,4381,1703,1877,5118,8115,7114,7212,606,2282,9808,8597,6259,1254,3546,6611,6233,4553,4308,8292,6099,8753,2850,6112,9978,6669,962,1916,2328,3766,4261,4915,9145,2688,2479,8042,557,218,7648,3526,9065,9127,5092,9461,1855,1804,3711,6649,4800,70,8481,5341,9711,956,3701,9457,6753,2351,9365,5853,184,4864,9116,1286,4013,360,6980,4137,7723,8204,8473,1526,7200,1496,2367,912,1310,4764,9153,3191,1338,4642,1105,6318,9289,81,140,3225,1916,2683,7793,6207,4944,9443,7529,1517,6637,8347,5719,4636,8891,3591,5360,9892,6030,7027,389,3756,4580,6839,6289,1939,9519,3346,2275,9668,7498,6631,3119,1701,4207,9825,8520,1272,7126,7676,3215,8748,9138,3703,6958,4169,3807,794,8882,8566,1568,1710,5241,839,9377,6693,9957,9779,2545,383,5861,1567,7146,1227,1564,597,2678,2730,7078,7203,9258,6786,5529,2551,7399,7646,575,8421,1797,5223,179,2950,638,6919,5965,5599,7145,2418,1928,3177,7440,4675,7070,185,3781,7077,3162,3726,6716,7948,118,9291,6359,1244,6456,1237,426,807,8815,2406,9787,6092,836,8410,7304,2438,2754,1812,9606,6614,7491,36,1468,6595,5634,2119,7181,7224,9803,8490,5659,6402,5270,6564,3294,4971,3862,6899,1113,1026,2473,787,3728,6544,5694,2683,9138,1521,6907,206,7982,8593,7958,1597,4793,2694,302,2760,26,8050,811,492,1068,3122,3496,2388,3319,6471,6067,5104,4106,7629,2575,6670,3854,4121,1799,7881,7017,4115,9540,1121,6716,1634,7917,5154,7606,2444,1778,3529,4817,9656,2393,6873,2111,9644,718,3635,3496,2411,4237,7947,1486,3648,5927,2962,3862,4689,9394,2370,2906,8877,935,1472,5558,3026,519,450,4682,3478,3411,5630,4560,6734,9355,3084,3798,688,7252,3399,4528,278,9899,832,2152,5945,4806,7900,2808,5280,5209,9374,8697,6083,1851,7721,9884,7641,8431,6838,4315,5884,6071,7535,4753,1049,1595,3722,4020,2341,702,6694,1637,6186,6601,9950,7653,858,2345,5892,5204,1291,9190,7838,7098,2675,5135,5100,6453,4460,5391,6681,5246,9602,2832,4633,8448,7528,7471,9642,9657,3606,1393,6980,1402,3562,5217,7820,2776,8592,9924,8819,9146,9065,4700,5198,152,6297,174,1555,1228,5001,1015,966,7164,3375,4221,5155,6892,5353,9210,4777,4605,432,2631,9637,4392,2865,790,3245,4541,1429,2574,3940,9204,7373,8526,3561,7270,1467,1129,7283,1720,9200,5100,6794,3857,2326,6759,1711,3313,6353,3495,1502,7103,500,5400,4636,523,3706,3891,8454,8156,5512,5319,8017,342,3021,4005,6183,9015,511,9068,6581,3899,6912,5381,944,3971,4691,5289,5079,2629,8185,3180,7126,2098,2839,4472,6725,438,4236,9414,4891,6521,1120,9848,3730,7834,5296,1520,9983,2859,7911,8158,1344,4563,8549,8562,3185,2576,5820,7125,5316,5892,6938,4993,7206,9988,7741,4346,2452,4513,535,5087,7583,5660,5681,4714,829,2429,8373,375,2516,1300,3773,8177,9203,7033,5715,3754,4278,4033,9929,8737,5918,48,1128,8154,7926,1520,6604,9508,4846,9879,5711,5150,385,9000,119,5970,4625,8763,5669,4998,4107,4481,2179,4828,8112,9912,8611,2467,724,7134,8849,8069,7621,2940,2156,2568,6649,3132,6754,931,3944,7353,2594,9928,187,6269,1486,7805,9867,286,9196,3157,5736,1083,4382,7990,5745,1358,8202,5875,8909,6946,9894,726,3501,3132,5402,6385,2086,2750,2720,2265,4232,1664,8608,6558,8540,3808,7882,3560,1264,8931,564,8414,9580,2264,2250,523,7148,2409,5956,7454,5128,8310,9870,6741,9681,4272,9966,4984,954,4396,3064,5111,5596,6417,6876,3800,5433,3782,1885,8009,5183,8399,5280,1610,7348,4432,862,9297,5330,4019,5504,9149,5843,3044,2598,2254,3661,3921,566,4486,7698,1185,7489,6656,5189,2588,4559,1609,7969,8289,5583,53,4159,9351,7886,2380,3049,9725,6382,8945,3811,8747,3171,4122,9426,8869,8337,4622,3604,5565,1445,3714,764,9439,5635,6014,3952,217,4063,5318,9948,2063,8591,2387,7353,6128,4191,9555,7204,6555,9346,211,6138,3606,2095,2116,386,7853,9577,3594,3585,6457,1114,6694,5709,1016,3498,6534,4473,3239,2708,4081,8766,4018,8692,5347,3775,8975,9783,6184,7451,618,4078,7153,4494,4273,2863,8260,7054,2438,226,5552,3644,9282,9761,7946,4888,7318,1927,7247,1013,6594,6239,5570,2964,9393,1586,7644,3457,689,723,1784,6888,6654,151,112,8867,723,5565,7948,5003,3077,3977,8916,5527,9379,5398,1486,8905,4405,2718,5605,4007,3118,3383,3429,8543,5922,6051,1473,4140,6185,9996,3168,8544,1916,8445,1857,3122,2770,6239,701,6940,9452,7773,9909,711,6842,439,6284,1772,478,7321,4882,1790,7647,5793,6348,3768,3916,4850,1660,8456,6810,6095,6050,3202,4502,2364,3770,2800,9330,2485,693,6284,1900,361,3480,6227,4829,6077,7415,7324,3536,5702,9582,4860,4118,5737,3714,4230,7543,3472,6757,9890,8500,9074,159,1387,633,7650,1518,8438,8412,2377,2205,5934,3544,7716,6755,2075,9501,5048,3741,7602,9374,8482,7471,8859,4203,3040,3540,8151,7246,6143,3220,2296,2470,1329,9400,6916,7122,2853,1273,46,1664,8254,3279,4019,8327,1346,1690,4843,9080,6122,9699,3705,4711,4812,892,4273,1503,1637,649,390,8987,2718,297,4480,869,3095,3825,8103,2559,8209,7123,8136,1766,1418,9180,3419,3952,169,428,9606,836,2216,8807,9164,1921,3709,4205,8778,8663,7636,1149,6524,3511,4819,1487,3584,1546,1082,6465,6693,3192,6553,8081,4818,473,511,3968,3627,290,2165,301,2125,3712,3810,5632,8657,2389,7595,5413,6005,8269,2775,7165,5171,1604,7181,4661,5366,4052,9646,8494,8312,856,1324,4613,4964,6697,9276,6833,3680,7296,3281,3224,3511,9686,6633,7097,8295,5044,7278,4737,4510,3011,2611,3604,4168,7720,9188,1408,3689,9340,5726,7164,1950,8733,3927,5813,1700,3093,1200,8732,3296,9423,5047,4953,1890,9198,2274,5388,3687,3997,5148,555,5570,878,3529,8870,6379,5767,907,2001,4372,874,6963,1224,7061,8035,471,1603,5366,6625,8614,7419,7609,7295,1490,3335,5898,2360,9108,3784,5821,5100,1499,3602,9719,5497,1348,8273,1760,8309,2274,4740,6341,9648,322,3460,9891,7913,6084,2368,3197,6954,9700,6442,2999,4977,470,5804,8935,5615,1286,8737,5525,8142,6403,4533,9453,9386,1686,3347,5880,1949,4088,7631,2331,7434,6437,8164,5369,3802,8197,8020,4811,2720,5644,3946,4782,30,3585,2763,5408,1696,5819,1618,3232,9232,9655,7122,5579,2105,1382,5185,8109,5898,174,1663,614,6765,3117,3772,8366,7855,7107,8985,6398,1462,7980,916,909,7372,5027,9698,7693,2318,2740,7084,3287,3157,2304,3504,4059,5801,3695,7216,4061,6495,5002,4510,1370,3924,3018,8640,4468,4152,3739,1647,3533,6999,7601,6807,3542,7567,1719,5014,5921,333,5679,5387,5551,7770,1646,5131,379,2176,7313,3890,4797,6209,3306,281,4163,2216,675,3031,8538,8410,4192,3906,6257,4974,2309,5747,6927,4249,9541,5879,9558,7981,6676,750,4373,4954,6612,2218,5964,2954,8590,9881,3007,1866,2955,8224,7861,6948,4913,2217,3458,6073,3953,93,6561,829,5974,1829,8137,8935,6144,7150,3316,6627,9779,7647,8891,3421,5418,4202,3688,7813,2628,2906,4195,6815,6019,506,1258,673,4950,9514,8682,7948,9699,5353,109,4627,193,3933,752,4167,2923,9698,8200,7849,7050,5950,5037,9173,7328,6298,4786,6523,277,2553,264,2375,566,5145,6331,289,2558,7404,4084,8953,1962,7831,1918,7545,9203,6731,8850,5613,3294,960,2812,9597,8384,148,1128,2079,8909,6480,6531,289,1955,1009,1603,7862,5509,3270,7469,5912,8367,1029,7289,8133,2899,7747,598,941,6811,3876,8392,3691,5534,4947,3396,3284,5240,457,5724,1238,7163,2262,6155,7325,2906,1503,6944,6239,4627,6180,8391,2879,7597,1839,7719,6502,7420,8396,1615,8389,5364,7839,1864,4109,3360,9732,4151,1490,9355,9287,6689,6469,451,9582,221,3791,556,4118,8084,5519,4231,6195,3010,4286,7570,4774,2469,2815,9582,7640,7125,732,2228,8296,9993,3916,9894,3564,9219,5797,1551,924,1081,9644,7124,428,7499,5855,2864,3109,636,8192,7181,4388,5380,8450,5452,4467,9941,3306,3297,7927,1916,941,9824,4554,6954,2684,6114,2710,2483,2914,8552,7585,4991,8172,4586,3386,6115,2376,6149,3821,311,6910,3079,3031,2973,1807,5977,2850,6825,8405,1056,5261,732,3032,2352,9681,6203,5683,2025,7306,2663,2299,2851,2886,1545,5704,5152,6925,4237,6345,1183,9579,5474,8662,1644,251,1771,8372,6926,237,7377,9514,618,7347,5530,811,1464,305,2989,9668,4296,3996,2242,2436,9082,3204,8973,4638,3990,9113,231,2765,4498,4929,3799,8485,3996,3211,7990,4198,7808,3136,3783,8118,4542,9685,5457,9677,467,2204,2324,4844,8009,5796,1596,495,7919,9088,2938,1867,7952,924,8936,1842,3790,9147,5970,2913,7134,3721,4410,4927,566,4167,5511,5397,106,1867,5317,667,1015,6872,3179,1857,2650,729,7862,731,6037,2312,6782,6150,8100,7911,4064,7111,1430,8669,5900,478,1880,5209,283,6613,5767,8381,9644,4862,8385,3974,425,4187,8598,74,213,6264,1722,2697,4527,545,8978,360,4323,1517,88,9383,6671,4688,7387,651,9368,8534,3626,398,6904,6254,9915,8724,1739,6076,3535,9252,4828,8144,3074,1157,6299,4758,3820,8028,7098,6947,9050,6601,2034,6714,782,920,7264,4324,7389,8428,2919,5698,8513,9913,4627,4637,4230,1261,497,5822,3166,877,925,7364,8162,1832,7231,7097,4196,674,5458,7965,4683,5026,1388,2296,4901,4515,6445,8284,2062,7248,7639,7117,9260,5601,7052,2043,9574,644,4486,860,6154,8978,8820,9577,795,2134,4342,3901,2637,2702,1380,5452,5495,4189,3579,7127,2487,6870,8859,5598,4623,9665,1487,4930,2872,7791,7575,3496,5652,284,355,3134,6772,2131,3864,2912,5415,1738,9752,2011,1652,7805,7244,5990,8164,8907,9772,4013,8708,7791,3582,3556,1261,2807,2352,1017,6438,967,3977,8348,1628,2332,8199,8487,493,8002,4894,3436,4254,276,5444,727,6808,3486,2568,5127,7285,6634,3487,843,6916,6545,184,2063,8484,4298,8185,3028,847,4686,2523,542,5765,3810,9541,7227,7690,6941,3533,6192,5268,2883,1863,6871,705,7024,2430,2576,5059,7857,9887,7225,8934,9230,8570,839,4143,4564,8587,892,4937,5329,5785,4930,9691,161,5464,170,1207,2912,2331,4081,1453,6273,6233,9465,6581,4931,2279,4452,2652,4966,4573,2920,2203,1105,2746,1039,299,9637,9066,81,830,7460,7273,4002,9514,3911,4275,7852,2849,9283,7114,6520,2952,8427,1010,9149,2590,6076,8604,6700,2193,1890,9504,5335,9644,8516,8897,1585,1543,8255,7804,3966,9703,8766,779,522,4953,9180,3150,8739,6353,3111,977,3042,9951,8816,3635,3300,9141,2049,4152,1624,3158,8231,9034,6624,636,2868,1180,5797,3552,6738,2765,9424,2651,5621,8792,7231,1264,7340,2747,5326,5015,6596,4634,9927,8927,6868,7423,5123,3862,5846,7037,2805,8265,3067,3071,5210,2811,1043,4433,2466,9786,9832,4726,8797,5399,1574,2296,1906,9950,6820,2319,5794,5278,1816,7516,7486,7834,4135,7750,4089,3285,161,3367,5462,2405,4488,8494,9733,5193,1837,436,806,5000,8938,1229,7994,2450,8571,5446,5620,1023,3780,7603,330,4013,6938,1133,6987,4759,2670,4980,733,72,1314,8551,8233,1078,250,1913,1821,8249,445,1934,5487,3468,420,8013,1745,4696,5337,5649,7013,908,2440,281,1778,4288,5052,1625,395,4091,9945,4058,3111,6575,3529,963,564,5206,6266,988,5176,9275,7309,590,3526,4692,4031,8010,489,6297,7147,1029,9506,713,9345,5736,6574,6637,7787,5447,8955,8641,8379,2703,4847,2954,9671,9871,3143,3730,1006,7175,19,3591,1846,9160,9532,1817,9061,9352,6982,3709,3599,6094,2668,8017,749,200,915,7801,5585,8015,477,4621,4205,8023,2302,470,3398,6189,7261,7770,3477,8887,8325,1647,9402,2798,2444,2200,7810,3184,7807,8703,3255,5909,617,9663,2070,3924,2920,7166,5227,3403,609,5992,8768,8238,2379,3307,3238,8013,5622,420,1965,5189,4249,7177,8930,781,8147,3080,7215,9366,7081,2856,4542,5767,2355,243,4058,7869,4078,1433,8539,2730,5353,3883,951,1356,2431,1973,6546,3292,4189,7795,7113,5853,7438,318,2198,6705,9555,8567,3012,2374,7655,6879,6657,1698,1259,6488,6969,9950,75,8496,6546,2992,1547,1584,8430,3178,9784,1666,2889,4593,8191,2118,1942,4111,1063,946,6890,6225,6099,3445,6960,7989,7572,8386,3754,5299,1031,5720,3978,7394,1511,9173,478,6411,3296,3798,7257,8289,8851,5250,9887,3255,64,9493,2485,7454,1653,1289,9296,1002,3019,3117,7382,1829,2612,772,9198,8345,6925,7418,4717,4391,3267,161,8682,3361,3332,1456,2382,809,2937,2581,9789,8456,3640,4429,4668,3138,3164,2874,1466,7990,7224,1038,1670,4267,919,6906,7582,2779,4442,8412,1432,94,7258,2400,743,1252,5907,1987,2567,7449,7138,9681,5524,139,721,8418,8860,7370,5995,7692,3460,6997,1314,6732,3493,5277,242,6652,7472,2003,1449,6762,2818,1487,9878,2166,4967,2879,6974,2422,9891,5365,8035,7377,8540,1297,2473,9851,5120,1592,2356,9064,5626,2343,4917,8670,5345,3081,3890,8313,1779,6552,7437,6116,6902,6385,1096,2779,7829,4123,3003,514,4189,9715,8138,4597,58,7691,8834,581,9343,7392,2569,4174,4692,8835,9484,5340,1889,8901,2706,7751,5132,4806,1586,4729,3846,9246,1658,7059,6467,3455,3463,5513,4903,284,1071,6682,3600,9750,1211,2544,4906,2165,5968,7359,9071,4038,2675,7599,2738,1533,1394,1187,5485,6844,9839,4352,1584,5462,4774,9890,7398,1153,2597,1869,9386,9400,6338,8149,9960,435,4973,4313,6207,5923,1159,7157,987,3494,6966,795,3475,5887,4817,6174,7899,6350,5312,3741,8352,3969,3178,2713,7606,8185,56,9585,3546,395,7171,8414,4532,2983,1819,1950,5193,9727,3716,9507,5975,5559,6165,8886,3516,7442,5093,2113,3499,3585,820,2951,4148,7453,4039,4686,5199,7455,6422,4583,3699,9824,5759,4148,6397,6784,3314,418,7105,6750,8724,9623,1133,2856,5954,9424,4089,216,1101,4577,8349,9698,4499,452,3248,8755,9306,1995,1168,6481,4943,5326,7537,3464,8394,8457,1571,5757,4534,4896,3216,7011,704,1325,5029,3974,3181,7027,8028,6652,8796,251,6169,5703,2014,791,7883,8389,581,8196,3178,9085,1999,2773,923,1222,4378,7565,6362,1033,607,5883,2957,3921,9102,701,6088,7758,1632,120,4658,8848,9964,5661,5998,3806,7918,4725,8217,967,6430,5748,4930,1314,3533,5388,4957,1481,4822,1682,5172,9611,6526,217,242,4333,4288,7756,2151,1893,2030,2719,113,7256,2446,3931,9689,4941,4719,3382,7188,6983,1777,2817,1314,1757,5806,1522,9626,9856,8906,3391,2516,1894,2022,566,5258,6324,6989,6914,7014,5950,9721,8548,3162,1924,5196,7653,6203,4405,1521,4313,5116,470,9517,7413,1052,9174,8234,9233,2402,4688,7531,9137,2815,2082,6708,6702,3332,2314,6816,5517,6109,5359,2914,9285,7821,9638,600,8466,1389,6126,1372,8314,2560,5627,1131,5520,3110,4346,7301,4687,3226,6247,7846,1651,886,9163,1959,5738,3789,792,7237,7062,8240,6624,7006,8572,5963,1769,6523,2506,2147,3246,5009,8047,9750,6545,4991,3675,7831,5557,2603,7776,1099,818,5663,7458,7314,9749,4520,3147,1343,9225,4454,4344,4796,5088,2651,3797,1924,6559,1638,5918,1624,6219,3655,9747,2478,6897,5144,9694,9377,3170,4895,4085,8557,5052,8164,3999,4570,7237,2231,8303,944,7939,5282,7265,3526,8025,717,6876,546,3825,4176,804,6611,6053,7305,6462,8990,9400,5112,5446,2116,2689,5433,8938,8394,7456,8456,9486,3568,3200,5860,7824,1745,6389,1605,2816,1201,4941,1932,998,481,2376,1268,4558,5700,6300,318,8984,4931,4083,3696,7750,3331,3588,3964,1916,356,4500,4353,1124,9440,8420,4351,391,8238,6654,3526,1003,2391,7551,2290,5876,9688,7356,40,6740,7920,7789,780,3046,3868,6018,4218,2341,4921,1989,4073,2012,3193,8007,7883,5445,4849,7046,1742,3858,9928,5119,2981,3933,1074,2084,561,5920,3105,3604,4192,93,454,1825,3832,1691,483,986,3292,1056,4855,619,3770,1424,379,616,1555,8319,6864,3905,5898,6076,9943,783,6029,5414,9414,1382,4031,9795,6107,7847,2402,2047,1363,4865,7659,4194,3757,9823,9823,9912,4278,9221,6265,7613,4509,6053,562,254,8241,424,9570,1703,9946,9518,3117,5671,8676,7958,6244,5911,4729,9504,2395,4262,9257,5023,1589,4752,4476,8487,8029,5047,6856,2763,6227,5757,6612,2272,2158,565,5195,7723,6310,8446,7040,8033,8653,8291,9766,6246,6112,8812,5770,985,5938,4105,4691,3279,4509,5329,7574,6206,1856,2949],
    "k" : 4362,
    "output" : 29725 },
    {"nums" : [5,5,4,5,4,1,1,1], "k" : 0, "output" : 20}
]

tmp = Solution()

for input in inputs:
    try: 
        output = tmp.maximumScore(nums = input["nums"], k = input["k"])
        if output != input["output"]:
            print(f'Test failed for:\nnums = {input["nums"]},\nk = {input["k"]}\nExpected = {input["output"]}, Returned = {output}')
    except TimeExceededException as e: print(f'Time Limit error for:\nnums = {input["nums"]},\nk = {input["k"]}')

Iteration 3.5

Now that we have a way to enforce a time limit, lets try and improve our algorithm

from typing import List
import multiprocessing
from functools import partial, wraps

class TimeExceededException(Exception):
    pass

def function_runner(*args, **kwargs):
    """Used as a wrapper function to handle
    returning results on the multiprocessing side"""

    send_end = kwargs.pop("__send_end")
    function = kwargs.pop("__function")
    try:
        result = function(*args, **kwargs)
    except Exception as e:
        send_end.send(e)
        return
    send_end.send(result)

def _run_with_timer(func, max_execution_time) -> int:
    @wraps(func)
    def wrapper(*args, **kwargs) -> int:
        recv_end, send_end = multiprocessing.Pipe(False)
        kwargs["__send_end"] = send_end
        kwargs["__function"] = func
        
        p = multiprocessing.Process(target=function_runner, args=args, kwargs=kwargs)
        p.start()
        p.join(max_execution_time)
        if p.is_alive():
            p.terminate()
            p.join()
            raise TimeExceededException("Exceeded Execution Time")
        
        result = recv_end.recv()

        if isinstance(result, Exception):
            raise ValueError

        return result

    return wrapper

# Defines the real wrapper and time limit
enforce_time_limit = partial(_run_with_timer, max_execution_time=2)

# pre: nums are all positive numbers
class Solution:
    # Enforces time-limit on func
    # If you are debugging simpler test case errors, remove this
    # @enforce_time_limit
    def maximumScore(self, nums: List[int], k: int) -> int:
        n : int = len(nums)
        curr_min : int = nums[k]
        result : int = curr_min

        # If we track when a new min happens (and it's value), we can just skip through and test vals quickly
        i_mins : List[(int, int)] = [(k, curr_min)]
        j_mins : List[(int, int)] = [(k, curr_min)]
        i_min : int = curr_min
        j_min : int = curr_min

        for idx, ele in enumerate(nums[k:]):
            if ele < j_min:
                j_min = ele
                j_mins.append((idx + k, ele))
        
        if j_mins[-1][0] != n - 1:
            j_mins.append((n - 1, j_min))
        
        for idx, ele in reversed(list(enumerate(nums[0:k + 1]))):
            if ele < i_min:
                i_min = ele
                i_mins.append((idx, ele))
        
        if i_mins[-1][0] != 0:
            i_mins.append((0, i_min))

        min1 : int = 0
        min2 : int = 0

        j_len : int = len(j_mins)
        i_len : int = len(i_mins)

        print(f'{i_mins}')
        print(f'{j_mins}')
        
        
        for i_key, (i_idx, i_ele) in reversed(list(enumerate(i_mins))):
            for j_key, (j_idx, j_ele) in reversed(list(enumerate(j_mins))):
                if i_key == i_len and j_key == j_len:
                    result = max(result, min(i_ele, j_ele) * (j_idx - i_idx + 1))
                if i_key != 0 and j_key != 0:
                    min1 = min(i_mins[i_key - 1][1], j_ele)
                    min2 = min(i_ele, j_mins[j_key - 1][1])
                    if min1 > min2:
                        if j_key != j_len - 1:
                            result = max(result, min1 * (j_mins[j_key + 1][0] - i_idx - 1))
                        else:
                            result = max(result, min1 * (j_idx - i_idx))
                    elif min2 > min1:
                        if i_key != i_len - 1:
                            result = max(result, min2 * (j_idx - i_mins[i_key + 1][0] - 1))
                        else:
                            result = max(result, min2 * (j_idx - i_idx))
                    else:
                        result = max(result, min1 * (j_idx - i_idx + 1))
                elif i_key == 0:
                    min1 = min(i_ele, j_mins[j_key - 1][1])
                    if i_len != 1:
                        result = max(result, min1 * (j_idx - i_mins[i_key + 1][0] - 1))
                    else:
                        result = max(result, min1 * (j_idx - i_idx))
                elif j_key == 0:
                    min1 = min(i_mins[i_key - 1][1], j_ele)
                    if j_len != 1:
                        result = max(result, min1 * (j_mins[j_key + 1][0] - i_idx - 1))
                    else:
                        result = max(result, min1 * (j_idx - i_idx))
                else:
                    # We are just looking at nums[k]...
                    pass

        return result


# Lets test the solution defined above
inputs = [
    {"nums" : [1,4,3,7,4,5], "k" : 3, "output" : 15},
    {"nums" : [8182,1273,9847,6230,52,1467,6062,726,4852,4507,2460,2041,500,1025,5524], "k" : 8, "output" : 9014},
    {"nums" : [6569,9667,3148,7698,1622,2194,793,9041,1670,1872], "k" : 5, "output" : 9732},
    {"nums" : [5868,4839,3608,4826,2829,2871,3224,3579,9860,6453,458,1617,2201,2906,8334,8410,3104,1385,5462,4287,2960,5417,2640,2287,6331,4494,773,1178,1426,5271,3221,7606,1091,9043,7008,7218,6004,4636,6253,5628,9533,2204,6903,6912,9736,793,8529,190,1302,4140,3212,2589,2735,109,9090,8351,332,8693,2461,6274,7233,2689,7255,3894,3855,1037,7385,3874],
     "k" : 38,
     "output" : 37088 },
    {"nums" : [3135,245,9277,2315,2945,7091,281,1242,6725,1544,2364,7756,7908,3272,3358,1851,3096,8914,1835,5922,1479,6028,2541,2284,4979,571,1700,6434,62,5378,9973,3997,2880,9307,277,8486,2374,6135,7181,5942,3870,1986,2382,9229,1429,3274,4933,8707,3151,6328,6374,3921,8578,260,7540,304,7441,6931,4160,7894,7486,572,6882,7664,887,4945,2517,7416,2258,5316,1078,9260,9866,9741,8001,1146,5318,2397,1808,4934,3480,3992,6079,1545,764,6841,6900,9452,9575,3076,9535,5559,9289,192,124,7681,6602,1979,3867,8333,3049,3739,1812,1795,7687,5635,4624,7012,913,9680,3012,1286,9490,4001,1238,7961,1492,2559,5897,3661,1665,2976,1448,6901,9761,5762,4156,3341,8422,2810,3574,3751,8130,8719,4145,7881,9438,2332,25,8968,676,4668,1108,8456,4335,4627,6961,8516,7091,9051,6092,9834,2732,3623,5324,2043,6833,5639,4004,1780,2946,3501,60,3395,9217,3304,7444,616,6929,6576,724,4138,6198,8560,638,9182,7067,4431,7138,8623,98,9259,3379,8451,6353,4599,1990,5979,5802,9079,8500,5795,194,6180,68,2157,8181,5961,9229,7840,2645,8624,1112,5115,5146,6301,1202,4813,8123,8005,799,9593,3700,3178,7775,4141,4908,7944,4617,6401,2743,9803,9092,8303,3705,9195,6594,9755,3687,6797,507,8679,2077,4597,2287,7658,5964,5487,9429,4648,836,7128,3295,1030,5782,8829,4700,5287,8155,3356,8283,5881,88,4196,5108,4551,6153,9088,4594,6358,5537,8300,4002,333,9792,6861,8098,7262,7663,2517,4023,726,4036,4711,8529,5610,8088,408,143,2227,2526,8651,7918,4747,7283,599,6717,3426,1149,9063,1243,815,3145,2751,4639,413,6607,6700,7102,1559,3911,8077,900,7035,1025,7278,6835,7413,8743,7598,3347,6002,3644,4171,9132,5199,6822,3531,6499,7653,1797,6960,3358,3508,1082,7217,1136,2561,8878,7968,6292,2419,4412,2790,3472,1299,9502,8683,3884,1757,2812,7986,2932,8056,6798,7043,3556,2001,2306,585,511,7680,7973,5934,1519,4203,3232,7724,9619,4934,9866,3046,5755,1637,4709,6935,5095,4746,430,4568,4865,2085,4528,2480,6035,8693,2862,9894,5058,1190,3860,9664,4704,514,5775,4851,6029,941,104,428,6859,9759,9206,7749,670,5661,9032,855,957,6636,8864,6320,2488,9585,194,5352,7224,4197,4509,8311,8188,9072,1998,8117,1097,4229,2878,3638,3649,3503,7591,8391,5579,9863,2074,1711,9725,6628,8432,2603,519,5654,3709,2207,6495,7253,5108,1868,6546,9414,8191,7970,9928,5387,4961,3428,6480,9465,7879,2844,741,6613,5743,3004,3486,4517,7113,6868,7717,1242,9030,6578,9138,2630,5704,7045,9650,5506,9544,5875,2364,2483,8957,6823,8705,4145,7628,2382,9381,4178,5277,6323,7292,6782,7147,7032,4691,4242,52,424,6754,9593,2274,735,1638,3514,5510,2537,2775,8064,2111,1232,9090,6265,9750,7263,247,7184,1273,761,4605,9283,4302,4169,2338,3786,6029,9243,6093,9875,7110,3074,8735,8104,3297,5565,7784,7797,8757,2056,1346,6658,4878,9409,9656,8444,2785,7681,379,7575,7819,366,5206,7734,951,9744,2063,7775,8048,7634,8553,9339,4710,1870,1839,6745,344,3099,453,9065,8066,6632,9913,4556,4666,5394,1849,7716,5321,9727,3652,2340,1264,4562,9690,7183,5823,8395,8196,5910,8080,8309,6599,1475,7063,5161,4698,5726,3971,7788,1092,8527,9565,8063,9759,5597,3286,5623,206,9149,3803,1066,2018,2439,9598,6791,6509,5173,845,1152,3494,4792,8811,4416,8019,2033,9350,6536,7345,808,1807,8276,2377,4588,8603,5331,9468,5663,9249,4997,2963,7717,9259,8085,8132,271,9713,1013,277,421,6122,420,4682,8017,3029,1415,7755,1421,9961,237,4411,4627,7895,1027,2316,3441,7867,9000,273,8471,8743,8002,5213,9896,4536,5576,6009,1752,6508,6786,9410,8248,3963,245,9068,4968,1513,6055,7128,3294,4431,1832,9327,1897,6065,4889,8725,979,7244,2937,4121,7568,5363,4788,2495,5785,8991,1327,6730,5931,3010,41,5468,6774,5925,7371,7943,6058,1948,4325,4202,9461,6293,124,8849,3288,5880,1904,5329,1672,1576,1862,5221,4430,8550,352,9149,6707,9426,3852,6388,132,4586,2243,697,9454,8983,4364,9189,3909,7312,7454,7796,9570,2452,2495,9527,6927,7032,5911,8172,1634,2997,6923,4962,9583,5118,1391,6836,9540,883,7076,8095,1622,4672,6592,7617,9987,8477,6981,5393,2471,1517,6620,706,2323,6763,3744,8217,8682,2301,4875,2473,9446,610,2169,2527,4583,1050,6901,3495,1269,1794,702,2355,3627,2645,9724,3422,7950,2206,3336,5242,4547,9773,51,9481,8834,2596,1535,9365,438,2162,3791,7470,5298,4055,6696,7885,6951,614,1519,4117,7778,1768,1485,4679,9496,8940,9237,6553,5725,5308,2928,9188,2838,1340,7994,659,8944,6633,2764,3430,5994,8771,2585,2792,4022,7036,1672,1885,9983,748,7559,3328,5970,2283,3495,7246,3296,3402,5162,6617,9752],
     "k" : 400,
     "output" : 29725 },
    # New test case takes for-ever to run... Basically does not complete
    {"nums" : [8311,7569,293,5428,4351,5433,4365,1555,852,9225,8589,3603,8275,6077,9758,7639,8633,9612,1555,8567,6819,8425,8061,7273,5917,3142,1828,5895,3109,1533,3449,2081,3189,704,7929,4288,5179,6244,9360,1621,1210,4829,4034,5053,5857,8862,1193,5336,5268,751,5969,7737,780,113,8397,2048,4854,862,1109,4008,4798,8350,1460,7095,5648,926,7601,6122,7759,9375,7163,5707,7516,9694,3430,2953,544,6199,3665,7486,3578,20,3420,6931,2029,7084,2041,8387,2960,2794,1425,4001,5154,3697,9368,8355,2489,7242,929,1877,511,5917,8940,2651,1463,5577,9332,4032,133,125,8966,1220,7705,157,6990,6515,4428,3858,9342,8721,2453,5464,5385,3329,1640,3301,5482,7802,8750,2286,7575,8463,8248,6459,6555,184,7243,4905,7638,2434,1758,5499,3243,4466,2197,5465,7267,3825,7464,3410,3493,2040,5007,4701,3545,499,5131,4302,6275,7685,6795,4219,7157,3355,2096,1947,3718,7495,5325,4561,8767,3101,9774,4823,9592,1883,9822,9635,2669,7437,9268,7650,7232,2073,9490,739,5196,8470,4495,9689,2683,5942,1811,4189,6063,6213,2557,3083,858,764,2941,1414,2392,7393,8685,7444,8431,4248,4226,2348,3755,9060,3687,5284,8691,8696,4136,4540,1922,717,3911,7385,5419,9559,9478,4535,7248,5869,3824,9509,8720,469,4440,8133,4630,6034,5412,1440,7966,3255,7625,4859,3404,2546,5809,6676,4147,4880,5301,5764,1548,5229,4378,9471,6149,4999,6194,1466,7731,126,3325,9151,9743,9905,9676,1154,1830,3523,680,9592,8829,3882,4689,533,9897,3211,8263,2117,346,5391,306,1941,4653,2018,6978,5493,2984,398,8137,3259,3522,6964,947,6672,6919,9523,6962,5756,4051,8592,5862,4556,9909,3807,7635,1407,8394,9099,8564,2177,4319,6624,1499,1232,2238,4659,339,2824,4628,5406,7093,1432,1640,5245,5856,5061,9409,6614,9512,3057,6999,3303,6552,5264,7038,6758,304,1296,6150,3714,7026,4030,6641,8869,1931,5485,975,3536,6928,449,1938,7249,6938,8491,1431,4674,2318,4237,4868,3889,750,6028,6937,2660,7811,3662,6879,589,8193,1306,7220,7408,2979,2403,8194,9768,3113,1930,8736,5276,1523,8431,2010,5583,9404,2895,5799,9742,1165,9356,5740,6250,9744,3801,1752,5387,3057,9843,277,2410,235,1240,6925,5706,4382,1672,1511,3796,4035,9517,7628,4295,6059,4942,5935,4671,8991,1469,225,3391,3065,3730,2989,1115,8034,5069,3056,9958,8084,4158,3718,4167,6269,7625,6207,3812,9052,6243,2117,5911,9324,2811,3149,8539,7972,1040,8793,2060,8050,9763,1952,4821,3004,8851,516,6087,2241,165,203,3792,3443,5507,1491,5239,6877,879,9765,1676,8331,5244,4082,8742,8720,820,8163,895,7426,3846,9835,9763,9652,5918,2341,3863,738,1249,7208,805,2803,2301,9494,2941,7845,1950,9427,8334,7120,2287,3266,6924,6233,9233,7420,5351,1879,2412,8678,3134,7967,6388,8011,512,6876,7774,488,5188,8177,21,4200,4079,2459,4439,3019,2655,7069,8115,2954,2522,6860,6821,5497,7605,9651,945,9465,7426,138,555,5808,4738,945,4077,1453,693,3397,10000,1100,4994,4435,2868,1794,8039,941,5251,1988,6119,4905,1823,470,2426,9043,1960,4290,754,2920,4087,5863,263,4182,2298,1586,5458,5016,9674,8543,3392,5676,4684,831,9307,6389,1444,5327,9168,3956,2751,3749,8051,6423,9350,115,9177,5217,1793,6538,5109,6105,2694,9387,8616,497,5227,2212,6264,1017,5839,8131,7947,5583,3610,1677,6827,160,2612,911,7085,6776,7310,1166,2841,1362,71,9326,5831,7239,3655,7544,4204,5166,8995,1788,2665,4532,7990,7176,2166,1557,8652,7563,160,7069,9749,2278,5280,4111,1919,9609,8324,845,8739,9584,2796,4722,1777,898,3947,4375,9217,9484,228,2360,4661,1690,3298,1307,6889,4348,7139,6159,4512,4187,9237,6515,9648,5377,4491,4145,8472,848,8014,8764,3039,7930,885,8890,3955,7715,874,6421,3165,2640,3916,4323,1794,7266,594,6655,3782,8589,6382,5467,4954,3441,2944,7002,1623,9489,3412,1887,9918,8502,9497,3093,4021,8257,7539,3055,2840,1898,3514,4311,9880,6513,4335,9245,1702,8183,4896,6894,8756,1049,4784,4819,2029,4213,4170,9897,3019,6358,9988,839,1213,5991,9327,1832,9186,8616,7143,2385,9180,2502,4973,8670,1819,7457,2553,2681,5130,8143,4208,7537,9628,6853,4460,3818,5222,18,3671,1595,5007,1738,6986,8557,1194,8984,3641,4600,9013,3318,1116,7445,60,6685,7991,3957,6145,4056,989,5000,2663,8378,5279,3325,6351,8812,5431,1386,5640,9498,3372,8060,9403,2445,7960,8322,464,4485,1196,8585,9146,8635,5118,7623,5084,6691,8075,2879,8414,2283,4367,4058,3406,5275,9733,7467,8699,6906,1717,8914,8596,3505,3951,8314,8638,9950,3675,381,288,6312,3999,2573,5978,4303,4575,7787,9263,6022,7246,1312,3170,6399,3658,3449,571,7432,6103,3071,9562,7731,9156,8211,1995,1532,954,7939,2377,4022,7342,1186,2597,7559,7956,9118,3209,9640,2226,638,7438,4914,7818,3912,707,3125,2722,5666,5033,7907,3547,4749,543,961,1625,5258,6556,6693,8688,5535,7878,757,9956,6362,3546,2584,2056,7119,6235,6438,1827,8451,9636,7226,3923,2895,3113,5078,1462,6111,6303,9827,6386,3277,7024,5848,8347,2306,4845,8145,3420,8837,9644,4150,5949,4876,7351,8875,304,511,5816,5168,7529,2548,7435,3163,7771,4961,5634,3018,9306,5687,1523,7225,3346,4600,241,3425,1493,1958,2906,4393,8913,3602,3696,5642,1263,369,5987,8347,622,3865,7238,133,6534,8551,1929,1000,9556,8328,9848,9484,3337,4981,7321,773,4397,9513,8150,8960,2101,1358,834,7147,1360,5814,5890,6269,284,3059,4807,8457,8944,6203,3852,5042,1646,6980,4924,6768,3273,2493,5421,7414,9026,4120,7053,6318,548,1178,14,1799,71,6336,2846,9774,1815,3962,7201,1508,4610,2536,2720,2911,8146,8481,2548,5844,8589,6523,2568,9937,3730,9689,1803,8870,4317,4795,2219,6300,9074,3275,1644,1028,4493,1323,8038,2825,3493,8747,6438,6476,6816,1297,8338,8753,79,1809,1048,3282,9175,1816,1647,1363,5465,1825,6987,5362,8638,2066,8375,9122,5633,5476,3820,9410,5927,5869,2904,8091,3542,1215,4360,3526,7128,6727,3152,8264,9515,5198,1660,357,5914,6228,5053,1016,8125,9995,5127,5123,2748,8041,6143,9582,584,375,4762,1557,3947,1704,505,4676,1400,6002,8351,8192,1080,2341,9829,548,9994,8062,301,4784,1091,7960,4080,4182,2091,7208,6098,6778,9764,5727,655,6845,4958,9549,7787,4624,797,3124,7566,3581,7733,8588,8777,4000,1650,7766,2499,3078,3738,3168,6858,9348,5947,9461,7203,9551,8854,2456,3141,8867,4255,3404,3687,9380,4825,6315,1238,6476,4593,8906,3178,5617,2395,3887,125,4119,5681,2270,2917,8827,9314,9458,2285,303,3996,4106,9617,1628,4651,1410,4663,6826,3306,1773,4343,4614,6065,6912,7075,4254,9395,6543,2735,6678,1238,6454,4788,6942,9664,2540,8604,6584,5073,8692,1115,1699,2133,4195,459,4571,5631,3853,9457,6050,8833,4795,6782,5925,7756,8358,3809,3626,9083,9263,8504,2154,3193,9121,6070,9915,5781,7843,3708,4455,1509,3873,2509,4572,9593,2188,6380,3494,4533,472,8954,8871,9611,9069,5913,8027,6286,9419,2038,3606,2814,5345,5201,1471,8491,3514,1512,9136,8386,5805,6548,8946,9511,704,1443,9144,5386,7272,7628,7146,1344,5450,9959,2014,8521,5972,56,5598,6842,5500,3190,7967,2414,4772,1311,3562,6776,518,7694,9534,8631,2623,4805,489,8763,4848,248,1206,5549,5349,4732,6824,9440,9200,7133,8514,9199,3441,1686,5360,6545,8507,2726,932,165,7861,1567,7552,1491,4542,2534,1319,5617,9629,5517,8917,3492,4877,1842,4145,5707,5667,4251,793,3090,7073,2333,1890,5533,4190,2485,4378,4288,8208,3443,9829,4921,23,5873,5702,1063,1968,5054,197,3830,5143,3657,2025,6252,4746,8559,1257,4305,3033,3083,4389,31,981,2913,3997,413,8761,6098,4697,6380,5298,560,7565,5471,7221,7754,9698,161,8284,8024,6274,7358,9104,3581,84,7388,7307,5705,3306,8864,4302,2580,5063,7279,1064,17,4217,3723,1221,1991,9159,8131,4438,4959,4155,1793,5407,2676,4349,1396,8802,6767,2424,1558,7395,8663,2497,5771,760,316,972,2743,5612,1362,5634,5419,6566,6382,8899,9989,4786,9386,4852,4930,3567,6232,2363,1656,9190,7605,8050,1084,1075,280,3017,5073,2472,7463,2375,8470,9037,3491,9627,361,9915,7967,1839,6068,1463,7962,5829,9182,5613,1856,8260,6988,2231,4063,4663,9007,5679,6726,5206,4945,8966,4309,8008,6522,3410,9752,137,413,2599,1690,7086,6487,3901,694,3209,7076,3541,7739,7270,1309,1643,2436,2750,1976,2086,9002,2673,7910,6592,684,3328,4213,7645,9719,4595,6153,8186,5829,6997,2610,6948,9116,1524,5150,8594,2389,5674,935,2860,8612,2278,3894,3304,4111,3833,810,3950,7303,1314,1863,9989,3804,1820,6471,2908,3873,9865,5890,5935,3093,204,5728,6508,3496,8740,6490,1606,2071,7893,3646,2892,5086,9642,9661,2775,961,8660,8083,415,7232,7224,4061,9133,365,2596,3152,6355,2590,3713,6920,6127,9216,8902,1686,3280,7820,546,2344,8205,5934,1385,1004,5814,4236,8910,6726,6763,541,4195,6660,9068,2055,396,5551,3352,643,894,4067,2489,4674,7496,5999,5796,6635,8342,4497,4051,7910,824,5998,5519,8956,563,1591,8787,1768,5238,2227,6430,4365,8237,2362,9751,5801,4381,3509,28,9671,9042,8372,6745,9432,5202,1761,4754,5119,395,6408,7930,2620,8107,4892,1663,5679,4258,7646,2806,6925,393,4976,7744,7332,5017,5387,5460,4892,5793,2642,4563,6147,8944,4127,2965,4260,7105,3864,6413,713,3543,6478,2037,2895,3414,6705,4380,9563,3143,1697,2399,6946,2975,4936,6640,5461,2257,6387,2457,2982,9797,8881,4269,553,6859,8782,5764,2790,2834,4368,1927,8401,2314,4761,392,3715,2375,515,4127,8939,9973,1423,7499,7638,3409,5502,9921,8574,2468,9360,9055,4217,6045,2629,3656,2954,7901,9777,7982,3417,3599,9589,697,528,8480,3043,3852,7265,4922,669,1261,4787,9204,411,8115,7598,5268,4565,4329,2748,2249,9829,8122,5442,158,8759,3410,7365,3918,2570,5917,3425,2907,3483,7679,9969,7206,3375,6574,6680,4194,940,8049,3472,5867,8502,3099,9719,7954,2292,3058,8702,3065,7906,3485,3434,9518,8561,5036,4888,8402,7535,4344,8409,1161,5614,8588,8908,9794,9480,4424,3297,2542,3841,5233,3603,4839,363,9690,7137,5972,2066,2312,1353,5045,197,6028,8230,5282,8012,490,720,8054,590,3157,5141,8222,5597,1833,6458,6458,4714,5245,4516,7367,1496,113,2293,4444,9729,8787,9252,8691,9219,142,4712,8700,1856,1059,9724,5836,2039,1281,6287,3642,2926,8504,2680,2766,4353,6657,1065,2179,2089,203,1136,6057,2061,9520,5854,6713,8742,8621,4697,951,541,6653,988,2389,3770,3917,5135,2918,1868,6962,797,7936,9499,3727,7171,1868,8712,6843,3701,9772,226,7959,9774,1713,8640,8016,4648,233,9709,8037,4493,5348,2377,500,1560,3379,8834,2071,2421,1409,6268,6048,4572,3144,8792,7888,5876,536,2397,7515,9043,2195,7998,1414,2670,4279,2917,2672,9902,2945,7811,5613,7008,8665,6525,1402,9623,6849,4203,9799,8639,4519,8795,7669,4481,9666,4394,5881,546,4995,6615,356,5427,1848,7409,1689,1279,4312,4821,7958,551,8117,9669,50,1092,3904,1605,5695,415,3524,5595,8937,3448,5291,1619,8081,2584,4842,4602,2052,633,8951,9316,6258,3476,3746,8514,9417,4067,3849,6377,2682,2042,4377,8814,6821,5844,9299,8639,1489,4988,4281,7764,3982,6248,3268,4094,3740,229,7828,5060,5552,2646,8387,9781,201,1066,2040,7100,1360,7206,431,4215,7437,9431,9541,1209,5258,8420,6298,8032,8794,6689,9240,5738,5777,1198,4299,3577,1821,9477,2639,5369,8765,7398,9467,6876,734,3691,7802,944,6586,6688,3566,1849,4746,7719,1391,2737,6989,2495,55,2561,5615,8552,8925,9648,6686,8389,4597,5561,3433,8324,7804,2084,9916,8777,6435,5683,5431,3759,2686,8475,9557,4474,820,3440,7589,6294,3424,5002,3875,1273,8413,9894,1988,7766,4252,3512,598,8345,9092,7846,2489,7439,676,5930,2577,3098,2894,468,2021,8250,2820,7116,9429,5102,6577,2313,2658,3766,8540,7021,7197,4900,6973,603,6748,2303,9099,9619,7780,1791,8221,9490,2253,8665,8647,4936,7593,1194,1954,8398,2883,3843,3829,7791,5892,5027,3929,7775,3488,4649,9559,8584,9259,556,3690,7902,4622,4857,8058,4369,3449,8702,8809,4134,9798,7241,3477,6373,8933,168,7264,6654,1343,7013,1063,3888,4234,4959,5606,620,7624,4973,6976,7413,9374,2350,1662,2383,2136,6696,1279,3896,8959,7868,7343,2273,5838,6687,3564,336,7384,6856,8091,7469,5727,3840,8848,7416,3789,5608,7770,3733,7400,9970,8382,8362,7351,5033,6265,2378,2948,9431,1643,227,9660,6403,2427,5628,1233,1949,8194,6841,3247,5907,6764,6056,7881,7315,5248,8430,3588,3638,6710,977,3659,3774,3518,6846,172,1638,9497,230,8710,5073,7444,7523,5899,1070,5487,6596,6533,2012,276,6109,1132,6633,502,3756,3383,177,3031,1088,3918,1000,6561,8827,4806,2328,4333,7943,3908,3172,1546,1288,5456,6883,110,1068,5801,1391,6412,4850,892,9467,1747,9992,1209,6540,2226,244,5786,812,5174,1756,2269,689,5448,7331,9031,3416,33,2608,2234,7762,6681,3891,5371,8160,3127,7465,6522,448,9357,3644,1750,5332,136,1606,5965,7736,7696,9167,4848,8773,8848,3276,5190,5925,739,7729,7016,5815,1825,3506,5003,2613,8401,3902,2978,8082,6781,6878,8290,8896,767,4700,9995,2308,4189,643,2693,4047,1912,8130,9586,3566,3530,3913,1570,3537,6724,2649,4407,4374,344,1285,155,7237,3764,402,4164,1885,3475,1326,384,7948,8352,7512,6046,856,6608,1760,5358,9054,7511,3311,3196,6888,9650,6455,2592,8348,1187,1715,4933,6878,2249,6825,626,5799,2649,1133,4362,1343,341,5050,9681,8005,3385,2725,3253,1617,4969,5549,8981,2038,4626,1588,63,7311,3697,7192,6772,6164,3251,542,5339,6334,9942,6336,9607,8208,9413,3764,1886,728,6831,6731,1618,2106,4392,821,6009,8258,9545,8746,5370,4191,8863,6694,8269,780,812,9112,5571,9161,1462,9006,3205,3264,6960,3987,9259,3490,3003,7220,5247,7920,2861,1392,4156,329,2371,7933,6928,9104,358,3268,1522,6303,6547,283,621,9612,9983,8701,7838,6930,207,9579,1778,2475,1944,5987,5330,1169,428,6399,131,5862,8073,7721,5604,9315,1841,9328,1820,9449,7393,7498,3829,7638,2780,3717,8546,4081,7815,5682,8417,7073,5938,3378,7772,2201,6714,3773,9584,7254,531,7356,1350,221,8359,6746,8385,5661,8515,6693,5309,7975,3416,4400,319,9305,5469,7639,5138,6436,8719,3460,8042,470,8429,1813,4440,1846,228,8946,6081,170,6725,1791,541,3849,8050,7008,2836,5579,208,3767,6133,3415,9670,4063,5573,5953,6849,6375,5191,7427,3504,2846,3498,4354,7196,6264,5900,7908,8672,578,4384,2108,799,3404,5452,1285,2558,1544,2260,8319,4531,7010,8867,9413,7414,9372,3424,681,9879,1155,3944,4369,9552,865,2859,5883,1950,5693,4332,6106,6389,4316,4524,8456,4234,7093,6584,3793,3627,5944,3431,1163,4016,4763,3205,1149,4403,6764,3672,1622,2521,712,2755,3301,9512,3382,7944,509,827,7967,5097,613,5642,9391,3109,1193,27,8330,9084,948,2038,1334,4424,559,4933,8341,1063,4266,4448,9184,8697,7272,1207,1169,3219,1114,1541,6733,496,1234,4990,6102,4008,4182,6324,2539,1406,3472,5227,5921,4253,5936,1590,8762,8611,4922,8620,9438,4779,8255,8755,2642,58,1691,1023,6718,7290,8437,6685,2111,783,6194,8780,1078,1682,6135,2895,4501,1056,3669,4893,5104,7523,6710,5542,1048,6149,6973,6730,3553,6421,9685,8363,4327,4652,5998,8883,4105,2649,9724,9480,4500,297,7184,7737,352,6338,3040,9962,7290,4707,951,5047,9530,5725,9265,7148,4140,5353,700,1733,8605,1228,4512,7091,8950,5496,925,7668,9923,2018,5078,2275,6720,4177,6560,3412,9746,8462,9897,9562,7618,6040,9400,1523,1617,7425,701,1205,1468,8567,6214,1497,486,1471,7728,4360,9869,7602,5922,1500,1836,4542,6655,4507,8310,9208,7493,4981,5195,3938,1923,7148,467,6817,4830,7736,5376,9053,9389,1976,5345,8349,940,3643,2041,4402,7453,871,4440,4363,8384,8709,140,1024,3075,3270,6481,8072,9041,7731,6531,8823,6124,3432,5351,3195,2824,1406,4307,5775,9100,1802,9651,5518,986,8330,1269,2068,4475,4728,3318,5749,5332,7714,7554,6741,5634,9707,9442,1797,1150,5420,3,4288,765,5001,2444,6217,805,3482,1275,6046,1180,3348,9167,1657,2626,3776,320,3480,2817,4889,3434,8635,2160,7102,9345,9605,6707,6301,5823,1936,6689,634,3457,5450,7256,3929,3734,9630,6098,2437,3913,2663,9998,6780,8705,5071,5874,9283,2235,8090,8997,4812,4488,1072,7888,73,9403,7344,4741,3287,5201,6406,1757,9822,3006,7656,1411,9520,2364,1000,1929,7190,3201,6808,5639,1240,5961,4587,8900,8468,230,4525,5894,3377,6056,7243,8685,4575,8827,1072,8659,4949,5911,1788,7639,1352,2461,4066,1041,9486,764,4440,9343,269,4728,2902,6145,3871,1873,623,9508,2226,7335,3190,656,1060,8895,4439,2228,9421,8146,1486,3322,7803,4960,6576,2239,5618,1637,237,1919,6400,8828,5284,5095,6194,7954,5663,8522,3810,2139,376,3878,4626,6864,5112,6643,8118,8382,5698,3548,1713,3138,7331,1516,4133,909,270,9532,9657,3445,515,4568,2844,1072,1050,8145,4149,2508,6445,6906,9196,3319,3320,9902,4366,8786,5913,3087,883,5325,495,4474,4294,7004,5191,561,3488,4078,7536,3144,5833,2771,9165,5346,406,1246,5826,5557,4756,1810,5485,9961,1424,2644,2491,3627,6321,8137,9616,2066,4047,6165,1898,8766,9121,1273,5392,5534,2881,3987,7066,8201,7851,2425,2284,2012,5289,6335,4367,8173,8915,6840,5605,7013,6427,5158,3666,148,7859,339,9590,9953,8568,9276,282,4760,4162,9674,2272,6952,2199,9420,1103,2594,7692,7682,5549,4151,8056,3182,6602,901,9650,4225,1732,4235,7758,3027,7397,6242,3423,959,8213,8789,7274,4763,3408,1754,9663,8813,3000,6571,5988,9394,3024,1533,2546,4428,8098,4939,6671,4852,6701,2920,620,2618,9012,7065,1451,9199,8067,5711,4237,4417,3714,1143,5574,4692,7034,1810,8549,5675,4549,7310,2464,3587,5350,6708,5515,1781,3464,8660,1394,1793,1863,315,3240,2902,1425,149,973,4498,5112,7036,6488,3160,8197,666,2944,303,631,4591,8717,935,8959,8182,6803,5039,1072,9380,5037,6582,7080,7260,6609,3637,879,9279,9642,5202,7828,4280,5689,5428,3336,16,3639,4659,6732,3252,2688,3965,181,4815,6513,3111,297,1597,7193,4833,1825,6079,6119,3483,3350,275,2250,3851,3015,1504,8425,8839,6944,4312,7627,3072,5973,3526,2221,2677,4013,5036,9629,2553,7211,5506,4097,1410,5244,7646,9312,2114,7281,9691,2789,6428,8408,9270,7060,7715,3762,5312,3505,1305,5868,7700,2796,5591,2945,1060,8754,2419,2170,8911,1494,5199,6204,2619,379,391,9507,583,7262,3366,8928,4728,8689,2873,4538,522,743,1521,3162,5267,4447,1911,7261,7501,3582,3169,462,6158,112,6239,3837,6605,1872,8984,4755,742,3617,2367,8896,2637,4817,7197,7815,715,3690,9565,6839,9188,303,2524,1168,5042,3191,8408,2235,2606,8605,5510,9273,6282,5932,5554,3308,5834,9465,4550,9809,7231,8714,7106,1475,2693,2216,7951,2511,6611,6959,7065,6785,732,2697,8232,6343,2394,6167,8522,534,7531,5263,6834,3307,393,5933,4357,2683,9624,7579,9761,9168,1236,2773,7123,6996,6257,4558,4883,5548,8463,9321,4738,1225,4389,3555,5817,5674,4762,9683,7140,4609,8614,1209,3521,7270,9806,3635,3115,4925,2773,5197,5017,6533,7249,1950,513,8183,5088,924,6888,6259,3000,8376,3292,833,7351,5102,4138,2423,8005,9939,141,9256,2479,7104,5719,9057,5359,6373,4845,243,3848,5416,5225,1923,9975,9306,3091,5330,5686,4532,7762,1615,6344,7758,7762,2709,6828,9352,6258,8759,3621,4336,7806,8414,3820,2859,6969,9527,6823,4183,4550,971,309,5438,9829,6803,5702,8679,9630,2825,1013,3191,2822,4543,60,8734,318,771,8555,9126,9786,7798,8523,6029,2275,5259,3355,4367,7945,5124,6428,1811,9071,9202,4915,4727,8033,409,4065,7038,2926,3750,2806,3512,8571,7268,9077,4918,4746,4774,1679,2277,8706,1547,6188,8031,7911,8212,6613,6892,6564,21,5971,7287,1724,4664,9565,9916,9728,4160,1906,6733,648,8297,1399,2596,9857,8078,2194,9129,8528,4001,7455,7981,5787,8932,1560,2675,222,674,681,5176,7710,1818,1664,548,8681,3512,6921,7962,4662,2623,797,5554,7426,3511,5210,6359,7728,9320,6897,3599,6091,1446,689,1093,4147,8637,4919,3389,2867,6712,9452,8189,4869,2617,5528,1226,3383,1566,1140,4259,9949,651,1448,6734,5082,1281,9037,8173,4677,2037,6679,1464,7197,5497,9214,9520,6527,8665,7175,337,2365,560,9938,2068,5748,6329,7989,8111,4284,6218,3393,4146,6916,10000,5308,4499,5337,7128,5591,755,7744,7046,7168,9608,943,6223,4697,6919,6289,4634,6302,1801,6205,6888,1381,701,1724,7062,1734,3836,8571,6522,5001,9183,6248,1285,6644,1838,4533,9434,2979,4114,8864,6400,2858,3408,3937,1992,8993,1586,955,2153,609,2334,8229,9460,8636,4295,2801,1054,9122,5065,2062,5338,8730,3584,4284,7688,6865,4560,6337,9250,455,3062,8305,9673,7665,7311,9791,3829,8268,1185,9784,9314,2029,5706,536,2612,9088,5788,585,5859,5583,1756,3118,2094,49,1634,7067,5374,6618,541,1430,6270,3087,2706,3383,1285,8222,1058,3466,8802,2970,2960,4265,4465,9341,6665,2437,7306,7339,4407,3869,8088,3293,8440,3551,6428,1537,234,6674,9876,10,2900,8264,7690,7982,7674,7249,2495,5657,3721,6061,6111,5316,5742,8537,8752,8077,9150,8190,8887,9041,1720,182,2635,2020,4379,5177,4828,3997,1663,8024,2442,8141,9732,1217,1743,3422,7738,6043,5610,1399,8079,6261,2296,1250,8195,6372,2327,8797,5839,3437,2845,6330,8413,6558,1884,7467,8658,7978,9228,6153,8183,2333,2680,4437,1181,1640,9616,6952,4886,283,20,695,4083,7558,1557,2028,4122,9195,1450,1152,2067,5179,378,164,6370,3051,7892,6012,4745,4940,651,3712,7059,3579,8580,9496,1128,5667,1688,6255,7139,1841,3626,8223,3434,2597,6291,4105,4157,3795,7364,3177,2295,6461,7533,4032,9123,203,7050,3135,5033,541,468,6949,6435,4144,5038,3290,7767,3192,8665,8317,7056,9751,1170,5490,9481,3936,2812,1921,6492,5472,5169,9657,6330,7090,2521,2232,551,2783,2466,711,848,7309,1095,4344,3623,3315,6951,3210,2651,8667,6547,2082,1179,1031,9359,7194,8747,4409,7665,1921,4244,3349,2845,678,7971,2105,1279,4672,8989,8674,4314,5949,8244,8454,8258,8400,5908,2205,2343,6655,460,9807,8533,7236,4979,5171,1025,4650,4459,7235,5739,2081,2419,7460,4769,9754,5223,2707,7995,6087,1925,5858,1955,8539,1483,5673,4044,1777,3819,9521,3599,2524,7606,8555,1488,8928,7919,1919,8680,9485,6485,7013,7781,1970,5711,1537,5430,7548,7384,5133,8287,6272,8524,1335,6904,194,6654,6119,2896,6682,9345,288,1616,4606,657,8826,331,6495,4508,385,6021,6201,4270,5664,1060,2772,3543,1895,5356,5435,9246,7604,9572,8026,4902,5863,4249,7616,2845,326,7405,4349,7416,3987,1719,1810,2015,7839,6551,4215,4145,3208,9130,3725,7914,7535,9052,9401,5401,2819,1295,8472,9542,2785,8969,6140,808,7935,5792,9335,3474,7324,5497,9679,3767,9961,2127,1839,4158,5066,4926,1550,2048,81,6865,3674,3612,834,3710,9565,1801,2146,4267,2835,9353,6613,4948,9291,3447,3988,5208,4981,2672,4850,2775,1400,8866,9538,1271,3271,4272,5128,2534,8891,2845,7131,8477,7080,7348,5554,3992,2482,7431,5607,8866,5107,4680,2695,4092,1008,4576,7417,6746,3263,2163,599,4000,125,645,6708,4273,4158,2792,8900,4564,5556,7964,4492,4420,1051,3283,5726,5408,7899,3738,9329,1319,6735,2222,4934,380,1149,7880,8281,3559,2818,3544,7540,1990,160,3814,823,5470,3488,7845,2202,6571,4236,3465,5312,1923,1643,3084,1599,4573,5643,9833,5072,8146,7512,8668,613,2539,1332,8585,3349,5572,4793,4850,545,9599,8229,5896,4949,1288,9060,4374,1356,123,6547,9774,8221,9484,332,7359,9661,5793,782,6160,9041,7079,4338,4510,9830,8592,9408,8218,5186,8178,474,7210,7405,1309,2133,3702,2308,8975,5637,5348,3459,3157,4729,6522,7075,9530,4311,9275,6288,421,7492,4107,5951,4489,5024,9221,7203,8027,7872,4044,4820,5809,2006,2934,2594,6622,3777,4271,6598,3485,5827,1044,8920,7854,1456,3688,7124,6187,9140,3694,8257,710,8868,2814,4502,3501,6099,9816,8888,9546,240,3382,6970,1790,1922,4782,3168,8524,6279,8182,5590,2726,1472,8957,6548,7890,7053,3890,6544,5302,3582,9239,6521,524,8562,3280,8585,2390,5401,8098,5224,3225,8066,2048,4935,7677,7697,2104,293,7148,4826,2072,9741,1784,3976,9267,9850,9318,9649,3303,5957,7489,6384,1986,1724,7595,1695,6297,3286,2560,8284,5174,6493,176,5487,3719,4408,6713,8072,7041,221,6763,6708,696,8711,7170,4192,5953,3215,9451,4100,31,6713,7150,3662,6156,9988,2370,7652,9465,3814,9899,5647,9014,985,434,6032,8361,9681,3163,5721,3079,490,9398,781,7496,1414,9240,7158,1125,3727,7314,5108,6393,8747,8771,1138,9695,7030,9263,7915,7015,4589,1704,7521,5302,7975,67,9875,7182,5121,9549,9085,5062,9223,760,8646,4948,2107,9776,9534,6077,2,6149,370,7661,1291,6144,7900,891,3883,7426,1570,3693,6132,40,309,8071,4451,9450,9148,6928,5739,8275,5008,3367,8700,5857,9227,8339,3704,2977,7565,2856,6618,3054,2265,4386,2844,2488,836,7835,6132,6412,5468,2096,1277,4690,723,463,2166,2852,719,7885,8501,8843,851,4144,1868,5464,6699,2424,608,8714,4488,4559,454,2434,9737,1337,5840,2139,8916,6736,6795,4437,6100,1640,5809,2168,4301,3283,2861,1692,5661,4342,152,6333,5980,1134,6087,5474,5516,9252,6008,6295,3001,7387,9740,4947,9632,485,9569,7009,1405,5142,4159,7517,2633,1854,2042,3776,9375,674,9846,9520,9158,4129,1636,2450,7092,5969,2333,515,6259,9493,1640,2173,2273,4139,8400,13,9192,6706,9974,8408,4461,9471,3083,366,9131,8172,9826,5151,8099,7971,257,7657,5235,1487,3453,9454,9581,1389,9456,3973,7821,1489,2466,6379,8501,1846,6975,2169,8947,2764,3164,8906,4258,9447,8153,7944,2246,9974,6000,7520,3704,4250,4269,6302,9289,7499,2370,7387,1343,2654,1860,8166,2544,683,9368,4678,7199,9739,7117,6786,6698,5441,8489,5626,6486,5098,5361,7700,5321,9433,8156,4597,8013,8423,557,8164,4426,4636,6590,6483,7612,8399,3751,4328,4176,4746,9376,1403,6143,8218,1517,9455,7436,2277,9789,1673,1083,1690,5504,2614,4535,244,3248,6876,5121,3273,4091,4525,1254,9379,5825,9686,7131,4334,3049,294,7691,81,5981,5962,3537,687,1842,2956,7233,6610,1271,7496,287,1803,4092,9027,4693,2945,8115,1261,2826,5609,6734,7561,6302,154,745,8965,6479,5436,3908,6767,1615,4879,4252,4841,3349,3424,3460,1662,2341,1419,13,8432,6779,4439,437,8931,9442,266,9202,7189,858,3781,9539,2543,9596,3348,3011,2139,965,3702,6553,562,572,9083,6631,7088,4939,30,5683,2127,8078,2692,9463,795,233,4615,9055,3901,8262,1193,6557,9081,4811,7643,9510,3690,4336,6079,3584,9214,2205,5043,2137,3759,2146,4080,1108,7706,739,1899,7362,2615,9481,7472,5566,1411,7525,5081,4272,9881,9259,8265,8798,7050,6621,4943,5925,1664,9933,282,8374,5897,5182,8419,1301,6026,6244,8389,3294,5722,2145,9573,2720,7282,6440,1548,648,4981,7428,1956,2007,2550,8159,7252,7720,8293,9939,7117,626,2593,8810,6689,4294,9111,1070,1244,658,2641,903,1654,3460,1492,2673,4727,3441,8197,8076,2623,1103,4432,9383,8334,1703,8805,3902,8961,9765,1661,1939,9334,8697,9337,8640,4444,5163,5219,733,8494,6044,274,7866,7847,9028,3066,9246,7595,9086,1560,4034,1394,1701,7197,1536,663,2679,8443,9632,9405,9164,6111,6160,5790,9650,8344,4467,8066,4236,9107,7738,4128,50,2934,9716,1988,5132,5450,1703,7586,1730,1337,5729,5948,8991,7470,9544,1416,6949,2959,7363,5762,9083,2181,5911,3261,1233,2329,8197,3340,2797,4321,4812,846,1509,3975,353,2087,9717,4688,1560,8847,9410,3380,3383,7636,7310,6042,2669,7120,578,6731,9540,4954,7276,662,2459,6201,9863,5158,9627,3203,9531,5480,1149,3479,5935,9978,9422,4169,7303,4443,5295,2151,5503,5333,5364,8399,9048,7507,4230,9400,1921,4202,6932,9613,4171,1778,8528,7793,4002,2938,1113,5074,7687,6838,8570,8436,6467,6820,1864,5239,8898,24,1285,2376,4717,998,5408,5306,22,7852,5316,1005,9736,6938,9273,7133,3998,5439,6888,4128,354,1499,9252,3197,4504,3103,2375,9023,4404,9333,6077,7779,1066,7,3977,4513,1284,6121,2251,8418,163,6052,8055,7096,155,3045,520,8604,5926,3160,6482,986,7215,9123,1135,3864,5515,4450,655,9309,5487,755,5365,5963,8119,9579,3735,6791,7170,5484,2003,6619,3008,7634,2598,3652,6445,1962,8380,4739,236,4621,3580,6897,906,9442,3216,1613,7342,7710,8631,6852,5177,5450,657,5538,1703,8074,6498,5232,3088,7972,2005,4272,1254,2832,382,8956,4057,5048,6570,5314,32,3423,5080,7172,8791,540,5494,7765,1299,1757,6485,4861,2460,7697,9667,6037,8999,3238,2608,8490,400,3461,6991,2760,4085,647,6178,1374,4201,5349,1596,6326,4255,8838,7780,4285,3785,816,1191,9279,8183,6182,4567,7161,9985,9178,4187,2305,5118,9542,4170,1661,5148,2246,8036,5675,9228,1768,9989,2903,9155,1622,828,1312,2050,4701,6952,860,1813,6958,3756,2759,7302,8221,2975,9584,850,7034,5595,232,2009,2062,3671,3657,9017,7574,3928,6276,9984,1342,8002,5996,7560,1115,9771,5236,5857,9885,5621,6293,6742,8312,8573,2495,1260,9809,8513,7221,1793,1394,3319,3521,9140,952,246,4047,1998,6582,2250,4492,7534,1628,1052,8806,2431,9067,9460,8841,6165,782,282,6117,1909,4336,181,2575,7930,3953,9731,2808,5219,3920,3985,6913,2593,4633,4958,9663,7757,3266,9141,3933,464,1765,3741,9490,8434,1746,3848,9180,5398,8784,3558,6354,63,797,7455,8221,7637,2883,5569,6310,7060,8816,923,4023,1284,6624,1551,9633,4388,8762,4048,3838,2356,2458,2013,6125,2128,3659,1512,367,2489,1418,8462,9953,8269,3317,1161,9648,6068,4024,1280,7940,881,5274,7274,9341,9998,5632,5896,8441,9704,5166,4787,7201,7082,4779,4730,4865,5236,2927,2028,4412,4947,973,5648,7385,152,2471,4240,9020,2352,8328,1614,3224,4021,4787,6905,1777,1251,6296,1574,8167,8634,5703,4117,233,6919,8858,1164,4800,3978,901,142,9732,1207,2501,7659,2722,7158,856,2694,7606,3454,7142,2600,3972,9743,3829,2984,7255,8721,2228,3312,680,3926,3325,1186,3161,5337,6611,3186,6320,1795,9557,9051,9663,3436,4526,8951,3510,4054,2669,2366,8728,124,8324,5109,5393,482,9858,1007,8681,5354,3860,9976,4611,6212,8195,1020,7927,9694,5502,6711,8556,8089,4737,2545,781,83,8404,1187,6566,9051,2406,7227,3496,6232,8556,719,8638,317,5336,846,8583,4196,8234,9400,8608,2684,6735,2798,2195,3873,9759,3469,1149,4684,4834,6410,8147,9531,4683,5872,119,6258,3148,8386,665,5645,1550,7578,157,445,7092,5377,2620,1864,3693,9331,2882,3832,2416,6050,8786,1862,236,8258,5352,2901,9413,9369,1864,6272,296,8516,1897,8313,7767,8161,2451,6466,2989,5726,8308,9285,1344,6272,3537,1383,771,7733,379,6089,6666,5269,2886,6349,267,943,8366,428,9349,8917,7156,186,6514,6464,9758,9945,5121,3903,4612,6938,6350,4853,2525,7013,3587,7486,4366,2476,8264,45,6730,7474,1614,6055,2345,6863,7980,5865,9722,9456,1316,3730,1124,620,9368,5156,3334,1281,4313,2779,2173,7959,6202,9631,8012,187,5640,2329,4508,47,8815,356,6363,5543,9582,6608,29,2223,9728,1027,9676,4535,7111,9336,2900,9562,8885,8476,1351,9427,254,9332,1982,1877,4650,7362,4133,5879,3039,1179,6287,6747,1388,8880,8050,3613,9203,9719,9281,4155,6598,2052,4062,6676,6284,1841,1201,5093,5659,4663,9502,2967,9823,5265,9815,6674,6284,5447,411,604,5351,4553,6097,4324,5472,8045,3344,5484,6951,5017,1260,8942,449,210,2639,2574,2021,6550,8512,7934,2021,2925,4637,8036,1973,7565,2116,4706,7990,5440,4373,3213,3003,5399,5255,2176,1241,7319,6263,6769,3230,7210,6313,591,146,6942,4557,5265,934,5121,9842,5860,630,6607,7587,5583,3544,9127,5479,1170,407,98,6625,952,4745,1553,409,4445,4662,8180,8785,6796,6104,8544,6208,4778,7566,7907,4649,581,4411,2715,1099,7456,7608,760,592,2302,9779,4370,6740,894,9156,4932,9006,1532,5442,4296,4135,5803,2932,4800,6007,7360,6337,2806,1842,5370,4145,5453,4066,9960,1409,4224,3793,565,7488,2720,1076,1042,2299,1305,2792,9178,9243,3865,7331,4467,38,1243,9324,2669,1046,6012,7509,751,7837,596,5410,3687,2059,2920,7492,7033,3748,228,2389,4191,6486,8261,2742,5537,1201,3339,8444,676,7959,5557,6941,6363,5278,9080,2279,8859,7227,2376,4805,4001,9610,9197,3839,25,8103,239,9964,6400,4294,8872,6531,6472,446,6865,8499,1729,2264,6651,9885,3503,9890,3701,482,5351,2864,502,8524,3447,301,9173,1403,5265,5173,2443,6550,618,171,5779,7847,9954,685,8488,447,6415,6792,1899,7946,8782,9471,5789,5414,5237,8117,9909,6690,4520,5819,8722,6275,7007,2703,5614,1165,1329,2106,9123,1016,9627,6946,7503,6290,3382,6176,9812,9708,6476,9201,3017,4719,2209,3980,5269,141,8653,4507,8049,3072,3302,7414,2877,5207,1490,8871,9533,3701,8871,4226,2861,519,4803,1578,4228,8667,298,1724,5031,3267,2361,8274,3510,4959,7128,792,8572,4515,6861,1175,8591,4810,9129,3389,4802,9609,2774,17,8073,8403,4797,9428,3346,8034,8146,2272,3638,7229,204,4532,3606,6711,1722,854,9334,7575,4027,4791,1624,1935,4290,4822,5039,4115,2431,4505,4586,2127,6742,5095,1329,1626,9286,2849,7987,978,8305,7500,4453,1457,7272,9502,3866,5374,6420,3363,3720,8009,3416,7216,3696,6891,7847,2592,1488,7995,7526,1584,676,8743,517,1973,8000,7386,2263,6451,6973,9216,9340,2895,6943,6375,1457,6018,1335,560,8637,6040,9164,5310,9949,477,1566,9244,7842,8931,3427,4479,4300,577,8813,2168,2655,8879,8076,4418,5461,2892,551,144,1236,2708,9745,7640,6594,5912,8899,3937,1535,9352,5007,8802,2201,260,8291,8350,9243,2434,6142,4361,1398,389,8942,5860,6213,8586,531,5383,6528,5135,8792,5562,6403,3513,1421,9477,9700,4365,2222,9049,6801,2800,853,5667,6495,7449,4605,9408,7965,6436,3729,8362,2930,4694,4381,1703,1877,5118,8115,7114,7212,606,2282,9808,8597,6259,1254,3546,6611,6233,4553,4308,8292,6099,8753,2850,6112,9978,6669,962,1916,2328,3766,4261,4915,9145,2688,2479,8042,557,218,7648,3526,9065,9127,5092,9461,1855,1804,3711,6649,4800,70,8481,5341,9711,956,3701,9457,6753,2351,9365,5853,184,4864,9116,1286,4013,360,6980,4137,7723,8204,8473,1526,7200,1496,2367,912,1310,4764,9153,3191,1338,4642,1105,6318,9289,81,140,3225,1916,2683,7793,6207,4944,9443,7529,1517,6637,8347,5719,4636,8891,3591,5360,9892,6030,7027,389,3756,4580,6839,6289,1939,9519,3346,2275,9668,7498,6631,3119,1701,4207,9825,8520,1272,7126,7676,3215,8748,9138,3703,6958,4169,3807,794,8882,8566,1568,1710,5241,839,9377,6693,9957,9779,2545,383,5861,1567,7146,1227,1564,597,2678,2730,7078,7203,9258,6786,5529,2551,7399,7646,575,8421,1797,5223,179,2950,638,6919,5965,5599,7145,2418,1928,3177,7440,4675,7070,185,3781,7077,3162,3726,6716,7948,118,9291,6359,1244,6456,1237,426,807,8815,2406,9787,6092,836,8410,7304,2438,2754,1812,9606,6614,7491,36,1468,6595,5634,2119,7181,7224,9803,8490,5659,6402,5270,6564,3294,4971,3862,6899,1113,1026,2473,787,3728,6544,5694,2683,9138,1521,6907,206,7982,8593,7958,1597,4793,2694,302,2760,26,8050,811,492,1068,3122,3496,2388,3319,6471,6067,5104,4106,7629,2575,6670,3854,4121,1799,7881,7017,4115,9540,1121,6716,1634,7917,5154,7606,2444,1778,3529,4817,9656,2393,6873,2111,9644,718,3635,3496,2411,4237,7947,1486,3648,5927,2962,3862,4689,9394,2370,2906,8877,935,1472,5558,3026,519,450,4682,3478,3411,5630,4560,6734,9355,3084,3798,688,7252,3399,4528,278,9899,832,2152,5945,4806,7900,2808,5280,5209,9374,8697,6083,1851,7721,9884,7641,8431,6838,4315,5884,6071,7535,4753,1049,1595,3722,4020,2341,702,6694,1637,6186,6601,9950,7653,858,2345,5892,5204,1291,9190,7838,7098,2675,5135,5100,6453,4460,5391,6681,5246,9602,2832,4633,8448,7528,7471,9642,9657,3606,1393,6980,1402,3562,5217,7820,2776,8592,9924,8819,9146,9065,4700,5198,152,6297,174,1555,1228,5001,1015,966,7164,3375,4221,5155,6892,5353,9210,4777,4605,432,2631,9637,4392,2865,790,3245,4541,1429,2574,3940,9204,7373,8526,3561,7270,1467,1129,7283,1720,9200,5100,6794,3857,2326,6759,1711,3313,6353,3495,1502,7103,500,5400,4636,523,3706,3891,8454,8156,5512,5319,8017,342,3021,4005,6183,9015,511,9068,6581,3899,6912,5381,944,3971,4691,5289,5079,2629,8185,3180,7126,2098,2839,4472,6725,438,4236,9414,4891,6521,1120,9848,3730,7834,5296,1520,9983,2859,7911,8158,1344,4563,8549,8562,3185,2576,5820,7125,5316,5892,6938,4993,7206,9988,7741,4346,2452,4513,535,5087,7583,5660,5681,4714,829,2429,8373,375,2516,1300,3773,8177,9203,7033,5715,3754,4278,4033,9929,8737,5918,48,1128,8154,7926,1520,6604,9508,4846,9879,5711,5150,385,9000,119,5970,4625,8763,5669,4998,4107,4481,2179,4828,8112,9912,8611,2467,724,7134,8849,8069,7621,2940,2156,2568,6649,3132,6754,931,3944,7353,2594,9928,187,6269,1486,7805,9867,286,9196,3157,5736,1083,4382,7990,5745,1358,8202,5875,8909,6946,9894,726,3501,3132,5402,6385,2086,2750,2720,2265,4232,1664,8608,6558,8540,3808,7882,3560,1264,8931,564,8414,9580,2264,2250,523,7148,2409,5956,7454,5128,8310,9870,6741,9681,4272,9966,4984,954,4396,3064,5111,5596,6417,6876,3800,5433,3782,1885,8009,5183,8399,5280,1610,7348,4432,862,9297,5330,4019,5504,9149,5843,3044,2598,2254,3661,3921,566,4486,7698,1185,7489,6656,5189,2588,4559,1609,7969,8289,5583,53,4159,9351,7886,2380,3049,9725,6382,8945,3811,8747,3171,4122,9426,8869,8337,4622,3604,5565,1445,3714,764,9439,5635,6014,3952,217,4063,5318,9948,2063,8591,2387,7353,6128,4191,9555,7204,6555,9346,211,6138,3606,2095,2116,386,7853,9577,3594,3585,6457,1114,6694,5709,1016,3498,6534,4473,3239,2708,4081,8766,4018,8692,5347,3775,8975,9783,6184,7451,618,4078,7153,4494,4273,2863,8260,7054,2438,226,5552,3644,9282,9761,7946,4888,7318,1927,7247,1013,6594,6239,5570,2964,9393,1586,7644,3457,689,723,1784,6888,6654,151,112,8867,723,5565,7948,5003,3077,3977,8916,5527,9379,5398,1486,8905,4405,2718,5605,4007,3118,3383,3429,8543,5922,6051,1473,4140,6185,9996,3168,8544,1916,8445,1857,3122,2770,6239,701,6940,9452,7773,9909,711,6842,439,6284,1772,478,7321,4882,1790,7647,5793,6348,3768,3916,4850,1660,8456,6810,6095,6050,3202,4502,2364,3770,2800,9330,2485,693,6284,1900,361,3480,6227,4829,6077,7415,7324,3536,5702,9582,4860,4118,5737,3714,4230,7543,3472,6757,9890,8500,9074,159,1387,633,7650,1518,8438,8412,2377,2205,5934,3544,7716,6755,2075,9501,5048,3741,7602,9374,8482,7471,8859,4203,3040,3540,8151,7246,6143,3220,2296,2470,1329,9400,6916,7122,2853,1273,46,1664,8254,3279,4019,8327,1346,1690,4843,9080,6122,9699,3705,4711,4812,892,4273,1503,1637,649,390,8987,2718,297,4480,869,3095,3825,8103,2559,8209,7123,8136,1766,1418,9180,3419,3952,169,428,9606,836,2216,8807,9164,1921,3709,4205,8778,8663,7636,1149,6524,3511,4819,1487,3584,1546,1082,6465,6693,3192,6553,8081,4818,473,511,3968,3627,290,2165,301,2125,3712,3810,5632,8657,2389,7595,5413,6005,8269,2775,7165,5171,1604,7181,4661,5366,4052,9646,8494,8312,856,1324,4613,4964,6697,9276,6833,3680,7296,3281,3224,3511,9686,6633,7097,8295,5044,7278,4737,4510,3011,2611,3604,4168,7720,9188,1408,3689,9340,5726,7164,1950,8733,3927,5813,1700,3093,1200,8732,3296,9423,5047,4953,1890,9198,2274,5388,3687,3997,5148,555,5570,878,3529,8870,6379,5767,907,2001,4372,874,6963,1224,7061,8035,471,1603,5366,6625,8614,7419,7609,7295,1490,3335,5898,2360,9108,3784,5821,5100,1499,3602,9719,5497,1348,8273,1760,8309,2274,4740,6341,9648,322,3460,9891,7913,6084,2368,3197,6954,9700,6442,2999,4977,470,5804,8935,5615,1286,8737,5525,8142,6403,4533,9453,9386,1686,3347,5880,1949,4088,7631,2331,7434,6437,8164,5369,3802,8197,8020,4811,2720,5644,3946,4782,30,3585,2763,5408,1696,5819,1618,3232,9232,9655,7122,5579,2105,1382,5185,8109,5898,174,1663,614,6765,3117,3772,8366,7855,7107,8985,6398,1462,7980,916,909,7372,5027,9698,7693,2318,2740,7084,3287,3157,2304,3504,4059,5801,3695,7216,4061,6495,5002,4510,1370,3924,3018,8640,4468,4152,3739,1647,3533,6999,7601,6807,3542,7567,1719,5014,5921,333,5679,5387,5551,7770,1646,5131,379,2176,7313,3890,4797,6209,3306,281,4163,2216,675,3031,8538,8410,4192,3906,6257,4974,2309,5747,6927,4249,9541,5879,9558,7981,6676,750,4373,4954,6612,2218,5964,2954,8590,9881,3007,1866,2955,8224,7861,6948,4913,2217,3458,6073,3953,93,6561,829,5974,1829,8137,8935,6144,7150,3316,6627,9779,7647,8891,3421,5418,4202,3688,7813,2628,2906,4195,6815,6019,506,1258,673,4950,9514,8682,7948,9699,5353,109,4627,193,3933,752,4167,2923,9698,8200,7849,7050,5950,5037,9173,7328,6298,4786,6523,277,2553,264,2375,566,5145,6331,289,2558,7404,4084,8953,1962,7831,1918,7545,9203,6731,8850,5613,3294,960,2812,9597,8384,148,1128,2079,8909,6480,6531,289,1955,1009,1603,7862,5509,3270,7469,5912,8367,1029,7289,8133,2899,7747,598,941,6811,3876,8392,3691,5534,4947,3396,3284,5240,457,5724,1238,7163,2262,6155,7325,2906,1503,6944,6239,4627,6180,8391,2879,7597,1839,7719,6502,7420,8396,1615,8389,5364,7839,1864,4109,3360,9732,4151,1490,9355,9287,6689,6469,451,9582,221,3791,556,4118,8084,5519,4231,6195,3010,4286,7570,4774,2469,2815,9582,7640,7125,732,2228,8296,9993,3916,9894,3564,9219,5797,1551,924,1081,9644,7124,428,7499,5855,2864,3109,636,8192,7181,4388,5380,8450,5452,4467,9941,3306,3297,7927,1916,941,9824,4554,6954,2684,6114,2710,2483,2914,8552,7585,4991,8172,4586,3386,6115,2376,6149,3821,311,6910,3079,3031,2973,1807,5977,2850,6825,8405,1056,5261,732,3032,2352,9681,6203,5683,2025,7306,2663,2299,2851,2886,1545,5704,5152,6925,4237,6345,1183,9579,5474,8662,1644,251,1771,8372,6926,237,7377,9514,618,7347,5530,811,1464,305,2989,9668,4296,3996,2242,2436,9082,3204,8973,4638,3990,9113,231,2765,4498,4929,3799,8485,3996,3211,7990,4198,7808,3136,3783,8118,4542,9685,5457,9677,467,2204,2324,4844,8009,5796,1596,495,7919,9088,2938,1867,7952,924,8936,1842,3790,9147,5970,2913,7134,3721,4410,4927,566,4167,5511,5397,106,1867,5317,667,1015,6872,3179,1857,2650,729,7862,731,6037,2312,6782,6150,8100,7911,4064,7111,1430,8669,5900,478,1880,5209,283,6613,5767,8381,9644,4862,8385,3974,425,4187,8598,74,213,6264,1722,2697,4527,545,8978,360,4323,1517,88,9383,6671,4688,7387,651,9368,8534,3626,398,6904,6254,9915,8724,1739,6076,3535,9252,4828,8144,3074,1157,6299,4758,3820,8028,7098,6947,9050,6601,2034,6714,782,920,7264,4324,7389,8428,2919,5698,8513,9913,4627,4637,4230,1261,497,5822,3166,877,925,7364,8162,1832,7231,7097,4196,674,5458,7965,4683,5026,1388,2296,4901,4515,6445,8284,2062,7248,7639,7117,9260,5601,7052,2043,9574,644,4486,860,6154,8978,8820,9577,795,2134,4342,3901,2637,2702,1380,5452,5495,4189,3579,7127,2487,6870,8859,5598,4623,9665,1487,4930,2872,7791,7575,3496,5652,284,355,3134,6772,2131,3864,2912,5415,1738,9752,2011,1652,7805,7244,5990,8164,8907,9772,4013,8708,7791,3582,3556,1261,2807,2352,1017,6438,967,3977,8348,1628,2332,8199,8487,493,8002,4894,3436,4254,276,5444,727,6808,3486,2568,5127,7285,6634,3487,843,6916,6545,184,2063,8484,4298,8185,3028,847,4686,2523,542,5765,3810,9541,7227,7690,6941,3533,6192,5268,2883,1863,6871,705,7024,2430,2576,5059,7857,9887,7225,8934,9230,8570,839,4143,4564,8587,892,4937,5329,5785,4930,9691,161,5464,170,1207,2912,2331,4081,1453,6273,6233,9465,6581,4931,2279,4452,2652,4966,4573,2920,2203,1105,2746,1039,299,9637,9066,81,830,7460,7273,4002,9514,3911,4275,7852,2849,9283,7114,6520,2952,8427,1010,9149,2590,6076,8604,6700,2193,1890,9504,5335,9644,8516,8897,1585,1543,8255,7804,3966,9703,8766,779,522,4953,9180,3150,8739,6353,3111,977,3042,9951,8816,3635,3300,9141,2049,4152,1624,3158,8231,9034,6624,636,2868,1180,5797,3552,6738,2765,9424,2651,5621,8792,7231,1264,7340,2747,5326,5015,6596,4634,9927,8927,6868,7423,5123,3862,5846,7037,2805,8265,3067,3071,5210,2811,1043,4433,2466,9786,9832,4726,8797,5399,1574,2296,1906,9950,6820,2319,5794,5278,1816,7516,7486,7834,4135,7750,4089,3285,161,3367,5462,2405,4488,8494,9733,5193,1837,436,806,5000,8938,1229,7994,2450,8571,5446,5620,1023,3780,7603,330,4013,6938,1133,6987,4759,2670,4980,733,72,1314,8551,8233,1078,250,1913,1821,8249,445,1934,5487,3468,420,8013,1745,4696,5337,5649,7013,908,2440,281,1778,4288,5052,1625,395,4091,9945,4058,3111,6575,3529,963,564,5206,6266,988,5176,9275,7309,590,3526,4692,4031,8010,489,6297,7147,1029,9506,713,9345,5736,6574,6637,7787,5447,8955,8641,8379,2703,4847,2954,9671,9871,3143,3730,1006,7175,19,3591,1846,9160,9532,1817,9061,9352,6982,3709,3599,6094,2668,8017,749,200,915,7801,5585,8015,477,4621,4205,8023,2302,470,3398,6189,7261,7770,3477,8887,8325,1647,9402,2798,2444,2200,7810,3184,7807,8703,3255,5909,617,9663,2070,3924,2920,7166,5227,3403,609,5992,8768,8238,2379,3307,3238,8013,5622,420,1965,5189,4249,7177,8930,781,8147,3080,7215,9366,7081,2856,4542,5767,2355,243,4058,7869,4078,1433,8539,2730,5353,3883,951,1356,2431,1973,6546,3292,4189,7795,7113,5853,7438,318,2198,6705,9555,8567,3012,2374,7655,6879,6657,1698,1259,6488,6969,9950,75,8496,6546,2992,1547,1584,8430,3178,9784,1666,2889,4593,8191,2118,1942,4111,1063,946,6890,6225,6099,3445,6960,7989,7572,8386,3754,5299,1031,5720,3978,7394,1511,9173,478,6411,3296,3798,7257,8289,8851,5250,9887,3255,64,9493,2485,7454,1653,1289,9296,1002,3019,3117,7382,1829,2612,772,9198,8345,6925,7418,4717,4391,3267,161,8682,3361,3332,1456,2382,809,2937,2581,9789,8456,3640,4429,4668,3138,3164,2874,1466,7990,7224,1038,1670,4267,919,6906,7582,2779,4442,8412,1432,94,7258,2400,743,1252,5907,1987,2567,7449,7138,9681,5524,139,721,8418,8860,7370,5995,7692,3460,6997,1314,6732,3493,5277,242,6652,7472,2003,1449,6762,2818,1487,9878,2166,4967,2879,6974,2422,9891,5365,8035,7377,8540,1297,2473,9851,5120,1592,2356,9064,5626,2343,4917,8670,5345,3081,3890,8313,1779,6552,7437,6116,6902,6385,1096,2779,7829,4123,3003,514,4189,9715,8138,4597,58,7691,8834,581,9343,7392,2569,4174,4692,8835,9484,5340,1889,8901,2706,7751,5132,4806,1586,4729,3846,9246,1658,7059,6467,3455,3463,5513,4903,284,1071,6682,3600,9750,1211,2544,4906,2165,5968,7359,9071,4038,2675,7599,2738,1533,1394,1187,5485,6844,9839,4352,1584,5462,4774,9890,7398,1153,2597,1869,9386,9400,6338,8149,9960,435,4973,4313,6207,5923,1159,7157,987,3494,6966,795,3475,5887,4817,6174,7899,6350,5312,3741,8352,3969,3178,2713,7606,8185,56,9585,3546,395,7171,8414,4532,2983,1819,1950,5193,9727,3716,9507,5975,5559,6165,8886,3516,7442,5093,2113,3499,3585,820,2951,4148,7453,4039,4686,5199,7455,6422,4583,3699,9824,5759,4148,6397,6784,3314,418,7105,6750,8724,9623,1133,2856,5954,9424,4089,216,1101,4577,8349,9698,4499,452,3248,8755,9306,1995,1168,6481,4943,5326,7537,3464,8394,8457,1571,5757,4534,4896,3216,7011,704,1325,5029,3974,3181,7027,8028,6652,8796,251,6169,5703,2014,791,7883,8389,581,8196,3178,9085,1999,2773,923,1222,4378,7565,6362,1033,607,5883,2957,3921,9102,701,6088,7758,1632,120,4658,8848,9964,5661,5998,3806,7918,4725,8217,967,6430,5748,4930,1314,3533,5388,4957,1481,4822,1682,5172,9611,6526,217,242,4333,4288,7756,2151,1893,2030,2719,113,7256,2446,3931,9689,4941,4719,3382,7188,6983,1777,2817,1314,1757,5806,1522,9626,9856,8906,3391,2516,1894,2022,566,5258,6324,6989,6914,7014,5950,9721,8548,3162,1924,5196,7653,6203,4405,1521,4313,5116,470,9517,7413,1052,9174,8234,9233,2402,4688,7531,9137,2815,2082,6708,6702,3332,2314,6816,5517,6109,5359,2914,9285,7821,9638,600,8466,1389,6126,1372,8314,2560,5627,1131,5520,3110,4346,7301,4687,3226,6247,7846,1651,886,9163,1959,5738,3789,792,7237,7062,8240,6624,7006,8572,5963,1769,6523,2506,2147,3246,5009,8047,9750,6545,4991,3675,7831,5557,2603,7776,1099,818,5663,7458,7314,9749,4520,3147,1343,9225,4454,4344,4796,5088,2651,3797,1924,6559,1638,5918,1624,6219,3655,9747,2478,6897,5144,9694,9377,3170,4895,4085,8557,5052,8164,3999,4570,7237,2231,8303,944,7939,5282,7265,3526,8025,717,6876,546,3825,4176,804,6611,6053,7305,6462,8990,9400,5112,5446,2116,2689,5433,8938,8394,7456,8456,9486,3568,3200,5860,7824,1745,6389,1605,2816,1201,4941,1932,998,481,2376,1268,4558,5700,6300,318,8984,4931,4083,3696,7750,3331,3588,3964,1916,356,4500,4353,1124,9440,8420,4351,391,8238,6654,3526,1003,2391,7551,2290,5876,9688,7356,40,6740,7920,7789,780,3046,3868,6018,4218,2341,4921,1989,4073,2012,3193,8007,7883,5445,4849,7046,1742,3858,9928,5119,2981,3933,1074,2084,561,5920,3105,3604,4192,93,454,1825,3832,1691,483,986,3292,1056,4855,619,3770,1424,379,616,1555,8319,6864,3905,5898,6076,9943,783,6029,5414,9414,1382,4031,9795,6107,7847,2402,2047,1363,4865,7659,4194,3757,9823,9823,9912,4278,9221,6265,7613,4509,6053,562,254,8241,424,9570,1703,9946,9518,3117,5671,8676,7958,6244,5911,4729,9504,2395,4262,9257,5023,1589,4752,4476,8487,8029,5047,6856,2763,6227,5757,6612,2272,2158,565,5195,7723,6310,8446,7040,8033,8653,8291,9766,6246,6112,8812,5770,985,5938,4105,4691,3279,4509,5329,7574,6206,1856,2949],
     "k" : 4362,
     "output" : 43821 },
    {"nums" : [5,5,4,5,4,1,1,1], "k" : 0, "output" : 20},
    {"nums" : [1301,5849,5714,435,8962,239,2942,8905,7984,981,9091,2069,2775,5874,1226,2347,8145,9079,5433,6498,343,6507,841,9491,4870,476,2687,1254,3517,3316,1910,6489,1787,6203,6232,7959,8301,7448,6103,9374,2071,3800,4737,3869,4090,4619,9828,766,3283,231,4338,7233,799,7350,1451,8605,1666,6833,4553,7334,2070,2518,230,5928,2209,4298,1139,4122,7585,8888,3121,2130,2993,3853,5131,8078,5368,8946,3724,9279,4481,298,5224,6415,4909,2682,8430,2064,6281,4901,2271,1860,415,1472,5705,7580,5543,3401,9397,489,6701,1114,6139,8706,3241,1308,2021,8154,1471,4119,488,8084,5665,8409,7233,5282,3067,3491,3632,6908,9559,6028,8498,9553,6831,6719,2365,5103,4520,4110,1936,1677,5730,9310,9431,2079,3516,3876,7384,4650,3250,7319,6812,1181,3594,4778,4630,3004,2429,1066,9527,9449,1897,3306,7134,2909,5390,703,4688,7166,6821,2743,239,4174,1652,8981,4796,6429,5594,785,8850,6284,8347,2432,1376,3075,2718,2097,556,5213,6821,4514,3407,1706,3865,7415,8069,9943,592,3621,6210,9302,3514,8313,3211,5458,6363,9878,4968,7258,6175,2221,7335,2462,5887,5074,8463,345,9110,5265,2781,8067,8880,1751,7798,6738,3966,3667,1992,5654,1935,1134,117,4273,3606,4436,8603,7905,2769,6900,2220,3302,5852,4861,6438,2764,4073,5406,8659,5834,1253,3731,7325,1849,2747,3896,8358,772,338,3658,7578,8017,3358,1776,4913,9817,6467,8681,8451,6363,5655,9981,5661,3761,8867,3320,4245,4616,969,9447,7619,2982,3211,1376,5733,8959,6327,3316,6725,8011,9467,6818,1156,7794,8221,1080,1191,2068,3046,5775,1118,7709,1910,289,7499,8814,7555,3877,4117,9825,1740,9947,3473,7632,8937,5553,3034,554,312,4545,4374,3495,5911,6369,7002,4071,5943,3172,8237,5628,2175,6177,9064,8292,1270,9214,5248,925,446,6229,7880,7817,115,9306,3316,3329,1339,5223,5066,9164,8159,7429,9496,8176,6847,9256,1779,4156,8389,2620,1926,2393,6185,6700,7000,9959,1238,490,9701,9640,1841,2701,1563,1915,9404,9272,9418,6297,5650,7845,5816,3149,1563,6038,912,6078,5854,3162,7876,5622,8591,7788,5521,1609,9122,2235,1882,5471,574,1627,5930,6728,4465,4309,644,4489,1915,1241,2125,5782,2866,3245,9445,8560,5039,7179,9345,6563,650,6501,6992,9528,1534,2531,7547,6402,336,7522,7509,2728,8992,844,932,6659,8961,8338,8683,8865,7471,6325,8538,5122,514,6270,4885,9206,2983,690,569,9841,3919,8301,8409,9214,2510,10000,7483], 
     "k" : 240, 
     "output" : 51405}
]
tmp = Solution()
for input in inputs:
    try: 
        # print(f'Trying {input["nums"]} with k = {input["k"]}')
        output = tmp.maximumScore(nums = input["nums"], k = input["k"])
        if output != input["output"]:
            print(f'Test failed for:\nnums = {input["nums"]},\nk = {input["k"]}\nExpected = {input["output"]}, Returned = {output}')
    except TimeExceededException as e: print(f'Time Limit error for:\nnums = {input["nums"]},\nk = {input["k"]}')
[(3, 7), (2, 3), (0, 1)]
[(3, 7), (4, 4), (5, 4)]
[(8, 4852), (7, 726), (4, 52), (0, 52)]
[(8, 4852), (9, 4507), (10, 2460), (11, 2041), (12, 500), (14, 500)]
[(5, 2194), (4, 1622), (0, 1622)]
[(5, 2194), (6, 793), (9, 793)]
[(38, 6253), (37, 4636), (32, 1091), (26, 773), (10, 458), (0, 458)]
[(38, 6253), (39, 5628), (41, 2204), (45, 793), (47, 190), (53, 109), (67, 109)]
[(400, 8864), (399, 6636), (398, 957), (397, 855), (394, 670), (389, 428), (388, 104), (252, 88), (194, 68), (162, 60), (138, 25), (0, 25)]
[(400, 8864), (401, 6320), (402, 2488), (404, 194), (488, 52), (701, 41), (863, 41)]
[(4362, 3694), (4358, 3688), (4357, 1456), (4354, 1044), (4332, 421), (4297, 332), (4292, 123), (4167, 81), (3912, 20), (3841, 10), (2923, 3), (0, 3)]
[(4362, 3694), (4364, 710), (4373, 240), (4436, 176), (4454, 31), (4515, 2), (9125, 2)]
[(0, 5)]
[(0, 5), (2, 4), (5, 1), (7, 1)]
[(240, 1253), (222, 117), (0, 117)]
[(240, 1253), (247, 772), (248, 338), (293, 289), (332, 115), (446, 115)]

Results:

  • 65/72 test cases passed
  • Frustrating that I still didn’t figure out why my alogirthm was doing so poorly…

This iteration seems to catch most issues, but runtime is creeping back in as an issue.

Iteration 4

Decided to look at a reference solution, as I was pulling my hair out, and wanted it to be over.

Turns out there are three things I was missing: - The greedy approach worked - Two other algorithms I would never have thought of

See editorial

class Solution:
    def maximumScore(self, nums: List[int], k: int) -> int:
        n : int = len(nums)
        left : int = k
        right : int = k
        ans : int = nums[k]
        curr_min : int = nums[k]
        
        while left > 0 or right < n - 1:
            if (0 if left == 0 else nums[left - 1]) < (0 if right >= n - 1 else nums[right + 1]):
                right += 1
                curr_min = min(curr_min, nums[right])
            else:
                left -= 1
                curr_min = min(curr_min, nums[left])

            ans = max(ans, curr_min * (right - left + 1))
        
        return ans

# Lets test the solution defined above
inputs = [
    {"nums" : [1,4,3,7,4,5], "k" : 3, "output" : 15},
    {"nums" : [8182,1273,9847,6230,52,1467,6062,726,4852,4507,2460,2041,500,1025,5524], "k" : 8, "output" : 9014},
    {"nums" : [6569,9667,3148,7698,1622,2194,793,9041,1670,1872], "k" : 5, "output" : 9732},
    {"nums" : [5868,4839,3608,4826,2829,2871,3224,3579,9860,6453,458,1617,2201,2906,8334,8410,3104,1385,5462,4287,2960,5417,2640,2287,6331,4494,773,1178,1426,5271,3221,7606,1091,9043,7008,7218,6004,4636,6253,5628,9533,2204,6903,6912,9736,793,8529,190,1302,4140,3212,2589,2735,109,9090,8351,332,8693,2461,6274,7233,2689,7255,3894,3855,1037,7385,3874],
     "k" : 38,
     "output" : 37088 },
    {"nums" : [3135,245,9277,2315,2945,7091,281,1242,6725,1544,2364,7756,7908,3272,3358,1851,3096,8914,1835,5922,1479,6028,2541,2284,4979,571,1700,6434,62,5378,9973,3997,2880,9307,277,8486,2374,6135,7181,5942,3870,1986,2382,9229,1429,3274,4933,8707,3151,6328,6374,3921,8578,260,7540,304,7441,6931,4160,7894,7486,572,6882,7664,887,4945,2517,7416,2258,5316,1078,9260,9866,9741,8001,1146,5318,2397,1808,4934,3480,3992,6079,1545,764,6841,6900,9452,9575,3076,9535,5559,9289,192,124,7681,6602,1979,3867,8333,3049,3739,1812,1795,7687,5635,4624,7012,913,9680,3012,1286,9490,4001,1238,7961,1492,2559,5897,3661,1665,2976,1448,6901,9761,5762,4156,3341,8422,2810,3574,3751,8130,8719,4145,7881,9438,2332,25,8968,676,4668,1108,8456,4335,4627,6961,8516,7091,9051,6092,9834,2732,3623,5324,2043,6833,5639,4004,1780,2946,3501,60,3395,9217,3304,7444,616,6929,6576,724,4138,6198,8560,638,9182,7067,4431,7138,8623,98,9259,3379,8451,6353,4599,1990,5979,5802,9079,8500,5795,194,6180,68,2157,8181,5961,9229,7840,2645,8624,1112,5115,5146,6301,1202,4813,8123,8005,799,9593,3700,3178,7775,4141,4908,7944,4617,6401,2743,9803,9092,8303,3705,9195,6594,9755,3687,6797,507,8679,2077,4597,2287,7658,5964,5487,9429,4648,836,7128,3295,1030,5782,8829,4700,5287,8155,3356,8283,5881,88,4196,5108,4551,6153,9088,4594,6358,5537,8300,4002,333,9792,6861,8098,7262,7663,2517,4023,726,4036,4711,8529,5610,8088,408,143,2227,2526,8651,7918,4747,7283,599,6717,3426,1149,9063,1243,815,3145,2751,4639,413,6607,6700,7102,1559,3911,8077,900,7035,1025,7278,6835,7413,8743,7598,3347,6002,3644,4171,9132,5199,6822,3531,6499,7653,1797,6960,3358,3508,1082,7217,1136,2561,8878,7968,6292,2419,4412,2790,3472,1299,9502,8683,3884,1757,2812,7986,2932,8056,6798,7043,3556,2001,2306,585,511,7680,7973,5934,1519,4203,3232,7724,9619,4934,9866,3046,5755,1637,4709,6935,5095,4746,430,4568,4865,2085,4528,2480,6035,8693,2862,9894,5058,1190,3860,9664,4704,514,5775,4851,6029,941,104,428,6859,9759,9206,7749,670,5661,9032,855,957,6636,8864,6320,2488,9585,194,5352,7224,4197,4509,8311,8188,9072,1998,8117,1097,4229,2878,3638,3649,3503,7591,8391,5579,9863,2074,1711,9725,6628,8432,2603,519,5654,3709,2207,6495,7253,5108,1868,6546,9414,8191,7970,9928,5387,4961,3428,6480,9465,7879,2844,741,6613,5743,3004,3486,4517,7113,6868,7717,1242,9030,6578,9138,2630,5704,7045,9650,5506,9544,5875,2364,2483,8957,6823,8705,4145,7628,2382,9381,4178,5277,6323,7292,6782,7147,7032,4691,4242,52,424,6754,9593,2274,735,1638,3514,5510,2537,2775,8064,2111,1232,9090,6265,9750,7263,247,7184,1273,761,4605,9283,4302,4169,2338,3786,6029,9243,6093,9875,7110,3074,8735,8104,3297,5565,7784,7797,8757,2056,1346,6658,4878,9409,9656,8444,2785,7681,379,7575,7819,366,5206,7734,951,9744,2063,7775,8048,7634,8553,9339,4710,1870,1839,6745,344,3099,453,9065,8066,6632,9913,4556,4666,5394,1849,7716,5321,9727,3652,2340,1264,4562,9690,7183,5823,8395,8196,5910,8080,8309,6599,1475,7063,5161,4698,5726,3971,7788,1092,8527,9565,8063,9759,5597,3286,5623,206,9149,3803,1066,2018,2439,9598,6791,6509,5173,845,1152,3494,4792,8811,4416,8019,2033,9350,6536,7345,808,1807,8276,2377,4588,8603,5331,9468,5663,9249,4997,2963,7717,9259,8085,8132,271,9713,1013,277,421,6122,420,4682,8017,3029,1415,7755,1421,9961,237,4411,4627,7895,1027,2316,3441,7867,9000,273,8471,8743,8002,5213,9896,4536,5576,6009,1752,6508,6786,9410,8248,3963,245,9068,4968,1513,6055,7128,3294,4431,1832,9327,1897,6065,4889,8725,979,7244,2937,4121,7568,5363,4788,2495,5785,8991,1327,6730,5931,3010,41,5468,6774,5925,7371,7943,6058,1948,4325,4202,9461,6293,124,8849,3288,5880,1904,5329,1672,1576,1862,5221,4430,8550,352,9149,6707,9426,3852,6388,132,4586,2243,697,9454,8983,4364,9189,3909,7312,7454,7796,9570,2452,2495,9527,6927,7032,5911,8172,1634,2997,6923,4962,9583,5118,1391,6836,9540,883,7076,8095,1622,4672,6592,7617,9987,8477,6981,5393,2471,1517,6620,706,2323,6763,3744,8217,8682,2301,4875,2473,9446,610,2169,2527,4583,1050,6901,3495,1269,1794,702,2355,3627,2645,9724,3422,7950,2206,3336,5242,4547,9773,51,9481,8834,2596,1535,9365,438,2162,3791,7470,5298,4055,6696,7885,6951,614,1519,4117,7778,1768,1485,4679,9496,8940,9237,6553,5725,5308,2928,9188,2838,1340,7994,659,8944,6633,2764,3430,5994,8771,2585,2792,4022,7036,1672,1885,9983,748,7559,3328,5970,2283,3495,7246,3296,3402,5162,6617,9752],
     "k" : 400,
     "output" : 29725 },
    # New test case takes for-ever to run... Basically does not complete
    {"nums" : [8311,7569,293,5428,4351,5433,4365,1555,852,9225,8589,3603,8275,6077,9758,7639,8633,9612,1555,8567,6819,8425,8061,7273,5917,3142,1828,5895,3109,1533,3449,2081,3189,704,7929,4288,5179,6244,9360,1621,1210,4829,4034,5053,5857,8862,1193,5336,5268,751,5969,7737,780,113,8397,2048,4854,862,1109,4008,4798,8350,1460,7095,5648,926,7601,6122,7759,9375,7163,5707,7516,9694,3430,2953,544,6199,3665,7486,3578,20,3420,6931,2029,7084,2041,8387,2960,2794,1425,4001,5154,3697,9368,8355,2489,7242,929,1877,511,5917,8940,2651,1463,5577,9332,4032,133,125,8966,1220,7705,157,6990,6515,4428,3858,9342,8721,2453,5464,5385,3329,1640,3301,5482,7802,8750,2286,7575,8463,8248,6459,6555,184,7243,4905,7638,2434,1758,5499,3243,4466,2197,5465,7267,3825,7464,3410,3493,2040,5007,4701,3545,499,5131,4302,6275,7685,6795,4219,7157,3355,2096,1947,3718,7495,5325,4561,8767,3101,9774,4823,9592,1883,9822,9635,2669,7437,9268,7650,7232,2073,9490,739,5196,8470,4495,9689,2683,5942,1811,4189,6063,6213,2557,3083,858,764,2941,1414,2392,7393,8685,7444,8431,4248,4226,2348,3755,9060,3687,5284,8691,8696,4136,4540,1922,717,3911,7385,5419,9559,9478,4535,7248,5869,3824,9509,8720,469,4440,8133,4630,6034,5412,1440,7966,3255,7625,4859,3404,2546,5809,6676,4147,4880,5301,5764,1548,5229,4378,9471,6149,4999,6194,1466,7731,126,3325,9151,9743,9905,9676,1154,1830,3523,680,9592,8829,3882,4689,533,9897,3211,8263,2117,346,5391,306,1941,4653,2018,6978,5493,2984,398,8137,3259,3522,6964,947,6672,6919,9523,6962,5756,4051,8592,5862,4556,9909,3807,7635,1407,8394,9099,8564,2177,4319,6624,1499,1232,2238,4659,339,2824,4628,5406,7093,1432,1640,5245,5856,5061,9409,6614,9512,3057,6999,3303,6552,5264,7038,6758,304,1296,6150,3714,7026,4030,6641,8869,1931,5485,975,3536,6928,449,1938,7249,6938,8491,1431,4674,2318,4237,4868,3889,750,6028,6937,2660,7811,3662,6879,589,8193,1306,7220,7408,2979,2403,8194,9768,3113,1930,8736,5276,1523,8431,2010,5583,9404,2895,5799,9742,1165,9356,5740,6250,9744,3801,1752,5387,3057,9843,277,2410,235,1240,6925,5706,4382,1672,1511,3796,4035,9517,7628,4295,6059,4942,5935,4671,8991,1469,225,3391,3065,3730,2989,1115,8034,5069,3056,9958,8084,4158,3718,4167,6269,7625,6207,3812,9052,6243,2117,5911,9324,2811,3149,8539,7972,1040,8793,2060,8050,9763,1952,4821,3004,8851,516,6087,2241,165,203,3792,3443,5507,1491,5239,6877,879,9765,1676,8331,5244,4082,8742,8720,820,8163,895,7426,3846,9835,9763,9652,5918,2341,3863,738,1249,7208,805,2803,2301,9494,2941,7845,1950,9427,8334,7120,2287,3266,6924,6233,9233,7420,5351,1879,2412,8678,3134,7967,6388,8011,512,6876,7774,488,5188,8177,21,4200,4079,2459,4439,3019,2655,7069,8115,2954,2522,6860,6821,5497,7605,9651,945,9465,7426,138,555,5808,4738,945,4077,1453,693,3397,10000,1100,4994,4435,2868,1794,8039,941,5251,1988,6119,4905,1823,470,2426,9043,1960,4290,754,2920,4087,5863,263,4182,2298,1586,5458,5016,9674,8543,3392,5676,4684,831,9307,6389,1444,5327,9168,3956,2751,3749,8051,6423,9350,115,9177,5217,1793,6538,5109,6105,2694,9387,8616,497,5227,2212,6264,1017,5839,8131,7947,5583,3610,1677,6827,160,2612,911,7085,6776,7310,1166,2841,1362,71,9326,5831,7239,3655,7544,4204,5166,8995,1788,2665,4532,7990,7176,2166,1557,8652,7563,160,7069,9749,2278,5280,4111,1919,9609,8324,845,8739,9584,2796,4722,1777,898,3947,4375,9217,9484,228,2360,4661,1690,3298,1307,6889,4348,7139,6159,4512,4187,9237,6515,9648,5377,4491,4145,8472,848,8014,8764,3039,7930,885,8890,3955,7715,874,6421,3165,2640,3916,4323,1794,7266,594,6655,3782,8589,6382,5467,4954,3441,2944,7002,1623,9489,3412,1887,9918,8502,9497,3093,4021,8257,7539,3055,2840,1898,3514,4311,9880,6513,4335,9245,1702,8183,4896,6894,8756,1049,4784,4819,2029,4213,4170,9897,3019,6358,9988,839,1213,5991,9327,1832,9186,8616,7143,2385,9180,2502,4973,8670,1819,7457,2553,2681,5130,8143,4208,7537,9628,6853,4460,3818,5222,18,3671,1595,5007,1738,6986,8557,1194,8984,3641,4600,9013,3318,1116,7445,60,6685,7991,3957,6145,4056,989,5000,2663,8378,5279,3325,6351,8812,5431,1386,5640,9498,3372,8060,9403,2445,7960,8322,464,4485,1196,8585,9146,8635,5118,7623,5084,6691,8075,2879,8414,2283,4367,4058,3406,5275,9733,7467,8699,6906,1717,8914,8596,3505,3951,8314,8638,9950,3675,381,288,6312,3999,2573,5978,4303,4575,7787,9263,6022,7246,1312,3170,6399,3658,3449,571,7432,6103,3071,9562,7731,9156,8211,1995,1532,954,7939,2377,4022,7342,1186,2597,7559,7956,9118,3209,9640,2226,638,7438,4914,7818,3912,707,3125,2722,5666,5033,7907,3547,4749,543,961,1625,5258,6556,6693,8688,5535,7878,757,9956,6362,3546,2584,2056,7119,6235,6438,1827,8451,9636,7226,3923,2895,3113,5078,1462,6111,6303,9827,6386,3277,7024,5848,8347,2306,4845,8145,3420,8837,9644,4150,5949,4876,7351,8875,304,511,5816,5168,7529,2548,7435,3163,7771,4961,5634,3018,9306,5687,1523,7225,3346,4600,241,3425,1493,1958,2906,4393,8913,3602,3696,5642,1263,369,5987,8347,622,3865,7238,133,6534,8551,1929,1000,9556,8328,9848,9484,3337,4981,7321,773,4397,9513,8150,8960,2101,1358,834,7147,1360,5814,5890,6269,284,3059,4807,8457,8944,6203,3852,5042,1646,6980,4924,6768,3273,2493,5421,7414,9026,4120,7053,6318,548,1178,14,1799,71,6336,2846,9774,1815,3962,7201,1508,4610,2536,2720,2911,8146,8481,2548,5844,8589,6523,2568,9937,3730,9689,1803,8870,4317,4795,2219,6300,9074,3275,1644,1028,4493,1323,8038,2825,3493,8747,6438,6476,6816,1297,8338,8753,79,1809,1048,3282,9175,1816,1647,1363,5465,1825,6987,5362,8638,2066,8375,9122,5633,5476,3820,9410,5927,5869,2904,8091,3542,1215,4360,3526,7128,6727,3152,8264,9515,5198,1660,357,5914,6228,5053,1016,8125,9995,5127,5123,2748,8041,6143,9582,584,375,4762,1557,3947,1704,505,4676,1400,6002,8351,8192,1080,2341,9829,548,9994,8062,301,4784,1091,7960,4080,4182,2091,7208,6098,6778,9764,5727,655,6845,4958,9549,7787,4624,797,3124,7566,3581,7733,8588,8777,4000,1650,7766,2499,3078,3738,3168,6858,9348,5947,9461,7203,9551,8854,2456,3141,8867,4255,3404,3687,9380,4825,6315,1238,6476,4593,8906,3178,5617,2395,3887,125,4119,5681,2270,2917,8827,9314,9458,2285,303,3996,4106,9617,1628,4651,1410,4663,6826,3306,1773,4343,4614,6065,6912,7075,4254,9395,6543,2735,6678,1238,6454,4788,6942,9664,2540,8604,6584,5073,8692,1115,1699,2133,4195,459,4571,5631,3853,9457,6050,8833,4795,6782,5925,7756,8358,3809,3626,9083,9263,8504,2154,3193,9121,6070,9915,5781,7843,3708,4455,1509,3873,2509,4572,9593,2188,6380,3494,4533,472,8954,8871,9611,9069,5913,8027,6286,9419,2038,3606,2814,5345,5201,1471,8491,3514,1512,9136,8386,5805,6548,8946,9511,704,1443,9144,5386,7272,7628,7146,1344,5450,9959,2014,8521,5972,56,5598,6842,5500,3190,7967,2414,4772,1311,3562,6776,518,7694,9534,8631,2623,4805,489,8763,4848,248,1206,5549,5349,4732,6824,9440,9200,7133,8514,9199,3441,1686,5360,6545,8507,2726,932,165,7861,1567,7552,1491,4542,2534,1319,5617,9629,5517,8917,3492,4877,1842,4145,5707,5667,4251,793,3090,7073,2333,1890,5533,4190,2485,4378,4288,8208,3443,9829,4921,23,5873,5702,1063,1968,5054,197,3830,5143,3657,2025,6252,4746,8559,1257,4305,3033,3083,4389,31,981,2913,3997,413,8761,6098,4697,6380,5298,560,7565,5471,7221,7754,9698,161,8284,8024,6274,7358,9104,3581,84,7388,7307,5705,3306,8864,4302,2580,5063,7279,1064,17,4217,3723,1221,1991,9159,8131,4438,4959,4155,1793,5407,2676,4349,1396,8802,6767,2424,1558,7395,8663,2497,5771,760,316,972,2743,5612,1362,5634,5419,6566,6382,8899,9989,4786,9386,4852,4930,3567,6232,2363,1656,9190,7605,8050,1084,1075,280,3017,5073,2472,7463,2375,8470,9037,3491,9627,361,9915,7967,1839,6068,1463,7962,5829,9182,5613,1856,8260,6988,2231,4063,4663,9007,5679,6726,5206,4945,8966,4309,8008,6522,3410,9752,137,413,2599,1690,7086,6487,3901,694,3209,7076,3541,7739,7270,1309,1643,2436,2750,1976,2086,9002,2673,7910,6592,684,3328,4213,7645,9719,4595,6153,8186,5829,6997,2610,6948,9116,1524,5150,8594,2389,5674,935,2860,8612,2278,3894,3304,4111,3833,810,3950,7303,1314,1863,9989,3804,1820,6471,2908,3873,9865,5890,5935,3093,204,5728,6508,3496,8740,6490,1606,2071,7893,3646,2892,5086,9642,9661,2775,961,8660,8083,415,7232,7224,4061,9133,365,2596,3152,6355,2590,3713,6920,6127,9216,8902,1686,3280,7820,546,2344,8205,5934,1385,1004,5814,4236,8910,6726,6763,541,4195,6660,9068,2055,396,5551,3352,643,894,4067,2489,4674,7496,5999,5796,6635,8342,4497,4051,7910,824,5998,5519,8956,563,1591,8787,1768,5238,2227,6430,4365,8237,2362,9751,5801,4381,3509,28,9671,9042,8372,6745,9432,5202,1761,4754,5119,395,6408,7930,2620,8107,4892,1663,5679,4258,7646,2806,6925,393,4976,7744,7332,5017,5387,5460,4892,5793,2642,4563,6147,8944,4127,2965,4260,7105,3864,6413,713,3543,6478,2037,2895,3414,6705,4380,9563,3143,1697,2399,6946,2975,4936,6640,5461,2257,6387,2457,2982,9797,8881,4269,553,6859,8782,5764,2790,2834,4368,1927,8401,2314,4761,392,3715,2375,515,4127,8939,9973,1423,7499,7638,3409,5502,9921,8574,2468,9360,9055,4217,6045,2629,3656,2954,7901,9777,7982,3417,3599,9589,697,528,8480,3043,3852,7265,4922,669,1261,4787,9204,411,8115,7598,5268,4565,4329,2748,2249,9829,8122,5442,158,8759,3410,7365,3918,2570,5917,3425,2907,3483,7679,9969,7206,3375,6574,6680,4194,940,8049,3472,5867,8502,3099,9719,7954,2292,3058,8702,3065,7906,3485,3434,9518,8561,5036,4888,8402,7535,4344,8409,1161,5614,8588,8908,9794,9480,4424,3297,2542,3841,5233,3603,4839,363,9690,7137,5972,2066,2312,1353,5045,197,6028,8230,5282,8012,490,720,8054,590,3157,5141,8222,5597,1833,6458,6458,4714,5245,4516,7367,1496,113,2293,4444,9729,8787,9252,8691,9219,142,4712,8700,1856,1059,9724,5836,2039,1281,6287,3642,2926,8504,2680,2766,4353,6657,1065,2179,2089,203,1136,6057,2061,9520,5854,6713,8742,8621,4697,951,541,6653,988,2389,3770,3917,5135,2918,1868,6962,797,7936,9499,3727,7171,1868,8712,6843,3701,9772,226,7959,9774,1713,8640,8016,4648,233,9709,8037,4493,5348,2377,500,1560,3379,8834,2071,2421,1409,6268,6048,4572,3144,8792,7888,5876,536,2397,7515,9043,2195,7998,1414,2670,4279,2917,2672,9902,2945,7811,5613,7008,8665,6525,1402,9623,6849,4203,9799,8639,4519,8795,7669,4481,9666,4394,5881,546,4995,6615,356,5427,1848,7409,1689,1279,4312,4821,7958,551,8117,9669,50,1092,3904,1605,5695,415,3524,5595,8937,3448,5291,1619,8081,2584,4842,4602,2052,633,8951,9316,6258,3476,3746,8514,9417,4067,3849,6377,2682,2042,4377,8814,6821,5844,9299,8639,1489,4988,4281,7764,3982,6248,3268,4094,3740,229,7828,5060,5552,2646,8387,9781,201,1066,2040,7100,1360,7206,431,4215,7437,9431,9541,1209,5258,8420,6298,8032,8794,6689,9240,5738,5777,1198,4299,3577,1821,9477,2639,5369,8765,7398,9467,6876,734,3691,7802,944,6586,6688,3566,1849,4746,7719,1391,2737,6989,2495,55,2561,5615,8552,8925,9648,6686,8389,4597,5561,3433,8324,7804,2084,9916,8777,6435,5683,5431,3759,2686,8475,9557,4474,820,3440,7589,6294,3424,5002,3875,1273,8413,9894,1988,7766,4252,3512,598,8345,9092,7846,2489,7439,676,5930,2577,3098,2894,468,2021,8250,2820,7116,9429,5102,6577,2313,2658,3766,8540,7021,7197,4900,6973,603,6748,2303,9099,9619,7780,1791,8221,9490,2253,8665,8647,4936,7593,1194,1954,8398,2883,3843,3829,7791,5892,5027,3929,7775,3488,4649,9559,8584,9259,556,3690,7902,4622,4857,8058,4369,3449,8702,8809,4134,9798,7241,3477,6373,8933,168,7264,6654,1343,7013,1063,3888,4234,4959,5606,620,7624,4973,6976,7413,9374,2350,1662,2383,2136,6696,1279,3896,8959,7868,7343,2273,5838,6687,3564,336,7384,6856,8091,7469,5727,3840,8848,7416,3789,5608,7770,3733,7400,9970,8382,8362,7351,5033,6265,2378,2948,9431,1643,227,9660,6403,2427,5628,1233,1949,8194,6841,3247,5907,6764,6056,7881,7315,5248,8430,3588,3638,6710,977,3659,3774,3518,6846,172,1638,9497,230,8710,5073,7444,7523,5899,1070,5487,6596,6533,2012,276,6109,1132,6633,502,3756,3383,177,3031,1088,3918,1000,6561,8827,4806,2328,4333,7943,3908,3172,1546,1288,5456,6883,110,1068,5801,1391,6412,4850,892,9467,1747,9992,1209,6540,2226,244,5786,812,5174,1756,2269,689,5448,7331,9031,3416,33,2608,2234,7762,6681,3891,5371,8160,3127,7465,6522,448,9357,3644,1750,5332,136,1606,5965,7736,7696,9167,4848,8773,8848,3276,5190,5925,739,7729,7016,5815,1825,3506,5003,2613,8401,3902,2978,8082,6781,6878,8290,8896,767,4700,9995,2308,4189,643,2693,4047,1912,8130,9586,3566,3530,3913,1570,3537,6724,2649,4407,4374,344,1285,155,7237,3764,402,4164,1885,3475,1326,384,7948,8352,7512,6046,856,6608,1760,5358,9054,7511,3311,3196,6888,9650,6455,2592,8348,1187,1715,4933,6878,2249,6825,626,5799,2649,1133,4362,1343,341,5050,9681,8005,3385,2725,3253,1617,4969,5549,8981,2038,4626,1588,63,7311,3697,7192,6772,6164,3251,542,5339,6334,9942,6336,9607,8208,9413,3764,1886,728,6831,6731,1618,2106,4392,821,6009,8258,9545,8746,5370,4191,8863,6694,8269,780,812,9112,5571,9161,1462,9006,3205,3264,6960,3987,9259,3490,3003,7220,5247,7920,2861,1392,4156,329,2371,7933,6928,9104,358,3268,1522,6303,6547,283,621,9612,9983,8701,7838,6930,207,9579,1778,2475,1944,5987,5330,1169,428,6399,131,5862,8073,7721,5604,9315,1841,9328,1820,9449,7393,7498,3829,7638,2780,3717,8546,4081,7815,5682,8417,7073,5938,3378,7772,2201,6714,3773,9584,7254,531,7356,1350,221,8359,6746,8385,5661,8515,6693,5309,7975,3416,4400,319,9305,5469,7639,5138,6436,8719,3460,8042,470,8429,1813,4440,1846,228,8946,6081,170,6725,1791,541,3849,8050,7008,2836,5579,208,3767,6133,3415,9670,4063,5573,5953,6849,6375,5191,7427,3504,2846,3498,4354,7196,6264,5900,7908,8672,578,4384,2108,799,3404,5452,1285,2558,1544,2260,8319,4531,7010,8867,9413,7414,9372,3424,681,9879,1155,3944,4369,9552,865,2859,5883,1950,5693,4332,6106,6389,4316,4524,8456,4234,7093,6584,3793,3627,5944,3431,1163,4016,4763,3205,1149,4403,6764,3672,1622,2521,712,2755,3301,9512,3382,7944,509,827,7967,5097,613,5642,9391,3109,1193,27,8330,9084,948,2038,1334,4424,559,4933,8341,1063,4266,4448,9184,8697,7272,1207,1169,3219,1114,1541,6733,496,1234,4990,6102,4008,4182,6324,2539,1406,3472,5227,5921,4253,5936,1590,8762,8611,4922,8620,9438,4779,8255,8755,2642,58,1691,1023,6718,7290,8437,6685,2111,783,6194,8780,1078,1682,6135,2895,4501,1056,3669,4893,5104,7523,6710,5542,1048,6149,6973,6730,3553,6421,9685,8363,4327,4652,5998,8883,4105,2649,9724,9480,4500,297,7184,7737,352,6338,3040,9962,7290,4707,951,5047,9530,5725,9265,7148,4140,5353,700,1733,8605,1228,4512,7091,8950,5496,925,7668,9923,2018,5078,2275,6720,4177,6560,3412,9746,8462,9897,9562,7618,6040,9400,1523,1617,7425,701,1205,1468,8567,6214,1497,486,1471,7728,4360,9869,7602,5922,1500,1836,4542,6655,4507,8310,9208,7493,4981,5195,3938,1923,7148,467,6817,4830,7736,5376,9053,9389,1976,5345,8349,940,3643,2041,4402,7453,871,4440,4363,8384,8709,140,1024,3075,3270,6481,8072,9041,7731,6531,8823,6124,3432,5351,3195,2824,1406,4307,5775,9100,1802,9651,5518,986,8330,1269,2068,4475,4728,3318,5749,5332,7714,7554,6741,5634,9707,9442,1797,1150,5420,3,4288,765,5001,2444,6217,805,3482,1275,6046,1180,3348,9167,1657,2626,3776,320,3480,2817,4889,3434,8635,2160,7102,9345,9605,6707,6301,5823,1936,6689,634,3457,5450,7256,3929,3734,9630,6098,2437,3913,2663,9998,6780,8705,5071,5874,9283,2235,8090,8997,4812,4488,1072,7888,73,9403,7344,4741,3287,5201,6406,1757,9822,3006,7656,1411,9520,2364,1000,1929,7190,3201,6808,5639,1240,5961,4587,8900,8468,230,4525,5894,3377,6056,7243,8685,4575,8827,1072,8659,4949,5911,1788,7639,1352,2461,4066,1041,9486,764,4440,9343,269,4728,2902,6145,3871,1873,623,9508,2226,7335,3190,656,1060,8895,4439,2228,9421,8146,1486,3322,7803,4960,6576,2239,5618,1637,237,1919,6400,8828,5284,5095,6194,7954,5663,8522,3810,2139,376,3878,4626,6864,5112,6643,8118,8382,5698,3548,1713,3138,7331,1516,4133,909,270,9532,9657,3445,515,4568,2844,1072,1050,8145,4149,2508,6445,6906,9196,3319,3320,9902,4366,8786,5913,3087,883,5325,495,4474,4294,7004,5191,561,3488,4078,7536,3144,5833,2771,9165,5346,406,1246,5826,5557,4756,1810,5485,9961,1424,2644,2491,3627,6321,8137,9616,2066,4047,6165,1898,8766,9121,1273,5392,5534,2881,3987,7066,8201,7851,2425,2284,2012,5289,6335,4367,8173,8915,6840,5605,7013,6427,5158,3666,148,7859,339,9590,9953,8568,9276,282,4760,4162,9674,2272,6952,2199,9420,1103,2594,7692,7682,5549,4151,8056,3182,6602,901,9650,4225,1732,4235,7758,3027,7397,6242,3423,959,8213,8789,7274,4763,3408,1754,9663,8813,3000,6571,5988,9394,3024,1533,2546,4428,8098,4939,6671,4852,6701,2920,620,2618,9012,7065,1451,9199,8067,5711,4237,4417,3714,1143,5574,4692,7034,1810,8549,5675,4549,7310,2464,3587,5350,6708,5515,1781,3464,8660,1394,1793,1863,315,3240,2902,1425,149,973,4498,5112,7036,6488,3160,8197,666,2944,303,631,4591,8717,935,8959,8182,6803,5039,1072,9380,5037,6582,7080,7260,6609,3637,879,9279,9642,5202,7828,4280,5689,5428,3336,16,3639,4659,6732,3252,2688,3965,181,4815,6513,3111,297,1597,7193,4833,1825,6079,6119,3483,3350,275,2250,3851,3015,1504,8425,8839,6944,4312,7627,3072,5973,3526,2221,2677,4013,5036,9629,2553,7211,5506,4097,1410,5244,7646,9312,2114,7281,9691,2789,6428,8408,9270,7060,7715,3762,5312,3505,1305,5868,7700,2796,5591,2945,1060,8754,2419,2170,8911,1494,5199,6204,2619,379,391,9507,583,7262,3366,8928,4728,8689,2873,4538,522,743,1521,3162,5267,4447,1911,7261,7501,3582,3169,462,6158,112,6239,3837,6605,1872,8984,4755,742,3617,2367,8896,2637,4817,7197,7815,715,3690,9565,6839,9188,303,2524,1168,5042,3191,8408,2235,2606,8605,5510,9273,6282,5932,5554,3308,5834,9465,4550,9809,7231,8714,7106,1475,2693,2216,7951,2511,6611,6959,7065,6785,732,2697,8232,6343,2394,6167,8522,534,7531,5263,6834,3307,393,5933,4357,2683,9624,7579,9761,9168,1236,2773,7123,6996,6257,4558,4883,5548,8463,9321,4738,1225,4389,3555,5817,5674,4762,9683,7140,4609,8614,1209,3521,7270,9806,3635,3115,4925,2773,5197,5017,6533,7249,1950,513,8183,5088,924,6888,6259,3000,8376,3292,833,7351,5102,4138,2423,8005,9939,141,9256,2479,7104,5719,9057,5359,6373,4845,243,3848,5416,5225,1923,9975,9306,3091,5330,5686,4532,7762,1615,6344,7758,7762,2709,6828,9352,6258,8759,3621,4336,7806,8414,3820,2859,6969,9527,6823,4183,4550,971,309,5438,9829,6803,5702,8679,9630,2825,1013,3191,2822,4543,60,8734,318,771,8555,9126,9786,7798,8523,6029,2275,5259,3355,4367,7945,5124,6428,1811,9071,9202,4915,4727,8033,409,4065,7038,2926,3750,2806,3512,8571,7268,9077,4918,4746,4774,1679,2277,8706,1547,6188,8031,7911,8212,6613,6892,6564,21,5971,7287,1724,4664,9565,9916,9728,4160,1906,6733,648,8297,1399,2596,9857,8078,2194,9129,8528,4001,7455,7981,5787,8932,1560,2675,222,674,681,5176,7710,1818,1664,548,8681,3512,6921,7962,4662,2623,797,5554,7426,3511,5210,6359,7728,9320,6897,3599,6091,1446,689,1093,4147,8637,4919,3389,2867,6712,9452,8189,4869,2617,5528,1226,3383,1566,1140,4259,9949,651,1448,6734,5082,1281,9037,8173,4677,2037,6679,1464,7197,5497,9214,9520,6527,8665,7175,337,2365,560,9938,2068,5748,6329,7989,8111,4284,6218,3393,4146,6916,10000,5308,4499,5337,7128,5591,755,7744,7046,7168,9608,943,6223,4697,6919,6289,4634,6302,1801,6205,6888,1381,701,1724,7062,1734,3836,8571,6522,5001,9183,6248,1285,6644,1838,4533,9434,2979,4114,8864,6400,2858,3408,3937,1992,8993,1586,955,2153,609,2334,8229,9460,8636,4295,2801,1054,9122,5065,2062,5338,8730,3584,4284,7688,6865,4560,6337,9250,455,3062,8305,9673,7665,7311,9791,3829,8268,1185,9784,9314,2029,5706,536,2612,9088,5788,585,5859,5583,1756,3118,2094,49,1634,7067,5374,6618,541,1430,6270,3087,2706,3383,1285,8222,1058,3466,8802,2970,2960,4265,4465,9341,6665,2437,7306,7339,4407,3869,8088,3293,8440,3551,6428,1537,234,6674,9876,10,2900,8264,7690,7982,7674,7249,2495,5657,3721,6061,6111,5316,5742,8537,8752,8077,9150,8190,8887,9041,1720,182,2635,2020,4379,5177,4828,3997,1663,8024,2442,8141,9732,1217,1743,3422,7738,6043,5610,1399,8079,6261,2296,1250,8195,6372,2327,8797,5839,3437,2845,6330,8413,6558,1884,7467,8658,7978,9228,6153,8183,2333,2680,4437,1181,1640,9616,6952,4886,283,20,695,4083,7558,1557,2028,4122,9195,1450,1152,2067,5179,378,164,6370,3051,7892,6012,4745,4940,651,3712,7059,3579,8580,9496,1128,5667,1688,6255,7139,1841,3626,8223,3434,2597,6291,4105,4157,3795,7364,3177,2295,6461,7533,4032,9123,203,7050,3135,5033,541,468,6949,6435,4144,5038,3290,7767,3192,8665,8317,7056,9751,1170,5490,9481,3936,2812,1921,6492,5472,5169,9657,6330,7090,2521,2232,551,2783,2466,711,848,7309,1095,4344,3623,3315,6951,3210,2651,8667,6547,2082,1179,1031,9359,7194,8747,4409,7665,1921,4244,3349,2845,678,7971,2105,1279,4672,8989,8674,4314,5949,8244,8454,8258,8400,5908,2205,2343,6655,460,9807,8533,7236,4979,5171,1025,4650,4459,7235,5739,2081,2419,7460,4769,9754,5223,2707,7995,6087,1925,5858,1955,8539,1483,5673,4044,1777,3819,9521,3599,2524,7606,8555,1488,8928,7919,1919,8680,9485,6485,7013,7781,1970,5711,1537,5430,7548,7384,5133,8287,6272,8524,1335,6904,194,6654,6119,2896,6682,9345,288,1616,4606,657,8826,331,6495,4508,385,6021,6201,4270,5664,1060,2772,3543,1895,5356,5435,9246,7604,9572,8026,4902,5863,4249,7616,2845,326,7405,4349,7416,3987,1719,1810,2015,7839,6551,4215,4145,3208,9130,3725,7914,7535,9052,9401,5401,2819,1295,8472,9542,2785,8969,6140,808,7935,5792,9335,3474,7324,5497,9679,3767,9961,2127,1839,4158,5066,4926,1550,2048,81,6865,3674,3612,834,3710,9565,1801,2146,4267,2835,9353,6613,4948,9291,3447,3988,5208,4981,2672,4850,2775,1400,8866,9538,1271,3271,4272,5128,2534,8891,2845,7131,8477,7080,7348,5554,3992,2482,7431,5607,8866,5107,4680,2695,4092,1008,4576,7417,6746,3263,2163,599,4000,125,645,6708,4273,4158,2792,8900,4564,5556,7964,4492,4420,1051,3283,5726,5408,7899,3738,9329,1319,6735,2222,4934,380,1149,7880,8281,3559,2818,3544,7540,1990,160,3814,823,5470,3488,7845,2202,6571,4236,3465,5312,1923,1643,3084,1599,4573,5643,9833,5072,8146,7512,8668,613,2539,1332,8585,3349,5572,4793,4850,545,9599,8229,5896,4949,1288,9060,4374,1356,123,6547,9774,8221,9484,332,7359,9661,5793,782,6160,9041,7079,4338,4510,9830,8592,9408,8218,5186,8178,474,7210,7405,1309,2133,3702,2308,8975,5637,5348,3459,3157,4729,6522,7075,9530,4311,9275,6288,421,7492,4107,5951,4489,5024,9221,7203,8027,7872,4044,4820,5809,2006,2934,2594,6622,3777,4271,6598,3485,5827,1044,8920,7854,1456,3688,7124,6187,9140,3694,8257,710,8868,2814,4502,3501,6099,9816,8888,9546,240,3382,6970,1790,1922,4782,3168,8524,6279,8182,5590,2726,1472,8957,6548,7890,7053,3890,6544,5302,3582,9239,6521,524,8562,3280,8585,2390,5401,8098,5224,3225,8066,2048,4935,7677,7697,2104,293,7148,4826,2072,9741,1784,3976,9267,9850,9318,9649,3303,5957,7489,6384,1986,1724,7595,1695,6297,3286,2560,8284,5174,6493,176,5487,3719,4408,6713,8072,7041,221,6763,6708,696,8711,7170,4192,5953,3215,9451,4100,31,6713,7150,3662,6156,9988,2370,7652,9465,3814,9899,5647,9014,985,434,6032,8361,9681,3163,5721,3079,490,9398,781,7496,1414,9240,7158,1125,3727,7314,5108,6393,8747,8771,1138,9695,7030,9263,7915,7015,4589,1704,7521,5302,7975,67,9875,7182,5121,9549,9085,5062,9223,760,8646,4948,2107,9776,9534,6077,2,6149,370,7661,1291,6144,7900,891,3883,7426,1570,3693,6132,40,309,8071,4451,9450,9148,6928,5739,8275,5008,3367,8700,5857,9227,8339,3704,2977,7565,2856,6618,3054,2265,4386,2844,2488,836,7835,6132,6412,5468,2096,1277,4690,723,463,2166,2852,719,7885,8501,8843,851,4144,1868,5464,6699,2424,608,8714,4488,4559,454,2434,9737,1337,5840,2139,8916,6736,6795,4437,6100,1640,5809,2168,4301,3283,2861,1692,5661,4342,152,6333,5980,1134,6087,5474,5516,9252,6008,6295,3001,7387,9740,4947,9632,485,9569,7009,1405,5142,4159,7517,2633,1854,2042,3776,9375,674,9846,9520,9158,4129,1636,2450,7092,5969,2333,515,6259,9493,1640,2173,2273,4139,8400,13,9192,6706,9974,8408,4461,9471,3083,366,9131,8172,9826,5151,8099,7971,257,7657,5235,1487,3453,9454,9581,1389,9456,3973,7821,1489,2466,6379,8501,1846,6975,2169,8947,2764,3164,8906,4258,9447,8153,7944,2246,9974,6000,7520,3704,4250,4269,6302,9289,7499,2370,7387,1343,2654,1860,8166,2544,683,9368,4678,7199,9739,7117,6786,6698,5441,8489,5626,6486,5098,5361,7700,5321,9433,8156,4597,8013,8423,557,8164,4426,4636,6590,6483,7612,8399,3751,4328,4176,4746,9376,1403,6143,8218,1517,9455,7436,2277,9789,1673,1083,1690,5504,2614,4535,244,3248,6876,5121,3273,4091,4525,1254,9379,5825,9686,7131,4334,3049,294,7691,81,5981,5962,3537,687,1842,2956,7233,6610,1271,7496,287,1803,4092,9027,4693,2945,8115,1261,2826,5609,6734,7561,6302,154,745,8965,6479,5436,3908,6767,1615,4879,4252,4841,3349,3424,3460,1662,2341,1419,13,8432,6779,4439,437,8931,9442,266,9202,7189,858,3781,9539,2543,9596,3348,3011,2139,965,3702,6553,562,572,9083,6631,7088,4939,30,5683,2127,8078,2692,9463,795,233,4615,9055,3901,8262,1193,6557,9081,4811,7643,9510,3690,4336,6079,3584,9214,2205,5043,2137,3759,2146,4080,1108,7706,739,1899,7362,2615,9481,7472,5566,1411,7525,5081,4272,9881,9259,8265,8798,7050,6621,4943,5925,1664,9933,282,8374,5897,5182,8419,1301,6026,6244,8389,3294,5722,2145,9573,2720,7282,6440,1548,648,4981,7428,1956,2007,2550,8159,7252,7720,8293,9939,7117,626,2593,8810,6689,4294,9111,1070,1244,658,2641,903,1654,3460,1492,2673,4727,3441,8197,8076,2623,1103,4432,9383,8334,1703,8805,3902,8961,9765,1661,1939,9334,8697,9337,8640,4444,5163,5219,733,8494,6044,274,7866,7847,9028,3066,9246,7595,9086,1560,4034,1394,1701,7197,1536,663,2679,8443,9632,9405,9164,6111,6160,5790,9650,8344,4467,8066,4236,9107,7738,4128,50,2934,9716,1988,5132,5450,1703,7586,1730,1337,5729,5948,8991,7470,9544,1416,6949,2959,7363,5762,9083,2181,5911,3261,1233,2329,8197,3340,2797,4321,4812,846,1509,3975,353,2087,9717,4688,1560,8847,9410,3380,3383,7636,7310,6042,2669,7120,578,6731,9540,4954,7276,662,2459,6201,9863,5158,9627,3203,9531,5480,1149,3479,5935,9978,9422,4169,7303,4443,5295,2151,5503,5333,5364,8399,9048,7507,4230,9400,1921,4202,6932,9613,4171,1778,8528,7793,4002,2938,1113,5074,7687,6838,8570,8436,6467,6820,1864,5239,8898,24,1285,2376,4717,998,5408,5306,22,7852,5316,1005,9736,6938,9273,7133,3998,5439,6888,4128,354,1499,9252,3197,4504,3103,2375,9023,4404,9333,6077,7779,1066,7,3977,4513,1284,6121,2251,8418,163,6052,8055,7096,155,3045,520,8604,5926,3160,6482,986,7215,9123,1135,3864,5515,4450,655,9309,5487,755,5365,5963,8119,9579,3735,6791,7170,5484,2003,6619,3008,7634,2598,3652,6445,1962,8380,4739,236,4621,3580,6897,906,9442,3216,1613,7342,7710,8631,6852,5177,5450,657,5538,1703,8074,6498,5232,3088,7972,2005,4272,1254,2832,382,8956,4057,5048,6570,5314,32,3423,5080,7172,8791,540,5494,7765,1299,1757,6485,4861,2460,7697,9667,6037,8999,3238,2608,8490,400,3461,6991,2760,4085,647,6178,1374,4201,5349,1596,6326,4255,8838,7780,4285,3785,816,1191,9279,8183,6182,4567,7161,9985,9178,4187,2305,5118,9542,4170,1661,5148,2246,8036,5675,9228,1768,9989,2903,9155,1622,828,1312,2050,4701,6952,860,1813,6958,3756,2759,7302,8221,2975,9584,850,7034,5595,232,2009,2062,3671,3657,9017,7574,3928,6276,9984,1342,8002,5996,7560,1115,9771,5236,5857,9885,5621,6293,6742,8312,8573,2495,1260,9809,8513,7221,1793,1394,3319,3521,9140,952,246,4047,1998,6582,2250,4492,7534,1628,1052,8806,2431,9067,9460,8841,6165,782,282,6117,1909,4336,181,2575,7930,3953,9731,2808,5219,3920,3985,6913,2593,4633,4958,9663,7757,3266,9141,3933,464,1765,3741,9490,8434,1746,3848,9180,5398,8784,3558,6354,63,797,7455,8221,7637,2883,5569,6310,7060,8816,923,4023,1284,6624,1551,9633,4388,8762,4048,3838,2356,2458,2013,6125,2128,3659,1512,367,2489,1418,8462,9953,8269,3317,1161,9648,6068,4024,1280,7940,881,5274,7274,9341,9998,5632,5896,8441,9704,5166,4787,7201,7082,4779,4730,4865,5236,2927,2028,4412,4947,973,5648,7385,152,2471,4240,9020,2352,8328,1614,3224,4021,4787,6905,1777,1251,6296,1574,8167,8634,5703,4117,233,6919,8858,1164,4800,3978,901,142,9732,1207,2501,7659,2722,7158,856,2694,7606,3454,7142,2600,3972,9743,3829,2984,7255,8721,2228,3312,680,3926,3325,1186,3161,5337,6611,3186,6320,1795,9557,9051,9663,3436,4526,8951,3510,4054,2669,2366,8728,124,8324,5109,5393,482,9858,1007,8681,5354,3860,9976,4611,6212,8195,1020,7927,9694,5502,6711,8556,8089,4737,2545,781,83,8404,1187,6566,9051,2406,7227,3496,6232,8556,719,8638,317,5336,846,8583,4196,8234,9400,8608,2684,6735,2798,2195,3873,9759,3469,1149,4684,4834,6410,8147,9531,4683,5872,119,6258,3148,8386,665,5645,1550,7578,157,445,7092,5377,2620,1864,3693,9331,2882,3832,2416,6050,8786,1862,236,8258,5352,2901,9413,9369,1864,6272,296,8516,1897,8313,7767,8161,2451,6466,2989,5726,8308,9285,1344,6272,3537,1383,771,7733,379,6089,6666,5269,2886,6349,267,943,8366,428,9349,8917,7156,186,6514,6464,9758,9945,5121,3903,4612,6938,6350,4853,2525,7013,3587,7486,4366,2476,8264,45,6730,7474,1614,6055,2345,6863,7980,5865,9722,9456,1316,3730,1124,620,9368,5156,3334,1281,4313,2779,2173,7959,6202,9631,8012,187,5640,2329,4508,47,8815,356,6363,5543,9582,6608,29,2223,9728,1027,9676,4535,7111,9336,2900,9562,8885,8476,1351,9427,254,9332,1982,1877,4650,7362,4133,5879,3039,1179,6287,6747,1388,8880,8050,3613,9203,9719,9281,4155,6598,2052,4062,6676,6284,1841,1201,5093,5659,4663,9502,2967,9823,5265,9815,6674,6284,5447,411,604,5351,4553,6097,4324,5472,8045,3344,5484,6951,5017,1260,8942,449,210,2639,2574,2021,6550,8512,7934,2021,2925,4637,8036,1973,7565,2116,4706,7990,5440,4373,3213,3003,5399,5255,2176,1241,7319,6263,6769,3230,7210,6313,591,146,6942,4557,5265,934,5121,9842,5860,630,6607,7587,5583,3544,9127,5479,1170,407,98,6625,952,4745,1553,409,4445,4662,8180,8785,6796,6104,8544,6208,4778,7566,7907,4649,581,4411,2715,1099,7456,7608,760,592,2302,9779,4370,6740,894,9156,4932,9006,1532,5442,4296,4135,5803,2932,4800,6007,7360,6337,2806,1842,5370,4145,5453,4066,9960,1409,4224,3793,565,7488,2720,1076,1042,2299,1305,2792,9178,9243,3865,7331,4467,38,1243,9324,2669,1046,6012,7509,751,7837,596,5410,3687,2059,2920,7492,7033,3748,228,2389,4191,6486,8261,2742,5537,1201,3339,8444,676,7959,5557,6941,6363,5278,9080,2279,8859,7227,2376,4805,4001,9610,9197,3839,25,8103,239,9964,6400,4294,8872,6531,6472,446,6865,8499,1729,2264,6651,9885,3503,9890,3701,482,5351,2864,502,8524,3447,301,9173,1403,5265,5173,2443,6550,618,171,5779,7847,9954,685,8488,447,6415,6792,1899,7946,8782,9471,5789,5414,5237,8117,9909,6690,4520,5819,8722,6275,7007,2703,5614,1165,1329,2106,9123,1016,9627,6946,7503,6290,3382,6176,9812,9708,6476,9201,3017,4719,2209,3980,5269,141,8653,4507,8049,3072,3302,7414,2877,5207,1490,8871,9533,3701,8871,4226,2861,519,4803,1578,4228,8667,298,1724,5031,3267,2361,8274,3510,4959,7128,792,8572,4515,6861,1175,8591,4810,9129,3389,4802,9609,2774,17,8073,8403,4797,9428,3346,8034,8146,2272,3638,7229,204,4532,3606,6711,1722,854,9334,7575,4027,4791,1624,1935,4290,4822,5039,4115,2431,4505,4586,2127,6742,5095,1329,1626,9286,2849,7987,978,8305,7500,4453,1457,7272,9502,3866,5374,6420,3363,3720,8009,3416,7216,3696,6891,7847,2592,1488,7995,7526,1584,676,8743,517,1973,8000,7386,2263,6451,6973,9216,9340,2895,6943,6375,1457,6018,1335,560,8637,6040,9164,5310,9949,477,1566,9244,7842,8931,3427,4479,4300,577,8813,2168,2655,8879,8076,4418,5461,2892,551,144,1236,2708,9745,7640,6594,5912,8899,3937,1535,9352,5007,8802,2201,260,8291,8350,9243,2434,6142,4361,1398,389,8942,5860,6213,8586,531,5383,6528,5135,8792,5562,6403,3513,1421,9477,9700,4365,2222,9049,6801,2800,853,5667,6495,7449,4605,9408,7965,6436,3729,8362,2930,4694,4381,1703,1877,5118,8115,7114,7212,606,2282,9808,8597,6259,1254,3546,6611,6233,4553,4308,8292,6099,8753,2850,6112,9978,6669,962,1916,2328,3766,4261,4915,9145,2688,2479,8042,557,218,7648,3526,9065,9127,5092,9461,1855,1804,3711,6649,4800,70,8481,5341,9711,956,3701,9457,6753,2351,9365,5853,184,4864,9116,1286,4013,360,6980,4137,7723,8204,8473,1526,7200,1496,2367,912,1310,4764,9153,3191,1338,4642,1105,6318,9289,81,140,3225,1916,2683,7793,6207,4944,9443,7529,1517,6637,8347,5719,4636,8891,3591,5360,9892,6030,7027,389,3756,4580,6839,6289,1939,9519,3346,2275,9668,7498,6631,3119,1701,4207,9825,8520,1272,7126,7676,3215,8748,9138,3703,6958,4169,3807,794,8882,8566,1568,1710,5241,839,9377,6693,9957,9779,2545,383,5861,1567,7146,1227,1564,597,2678,2730,7078,7203,9258,6786,5529,2551,7399,7646,575,8421,1797,5223,179,2950,638,6919,5965,5599,7145,2418,1928,3177,7440,4675,7070,185,3781,7077,3162,3726,6716,7948,118,9291,6359,1244,6456,1237,426,807,8815,2406,9787,6092,836,8410,7304,2438,2754,1812,9606,6614,7491,36,1468,6595,5634,2119,7181,7224,9803,8490,5659,6402,5270,6564,3294,4971,3862,6899,1113,1026,2473,787,3728,6544,5694,2683,9138,1521,6907,206,7982,8593,7958,1597,4793,2694,302,2760,26,8050,811,492,1068,3122,3496,2388,3319,6471,6067,5104,4106,7629,2575,6670,3854,4121,1799,7881,7017,4115,9540,1121,6716,1634,7917,5154,7606,2444,1778,3529,4817,9656,2393,6873,2111,9644,718,3635,3496,2411,4237,7947,1486,3648,5927,2962,3862,4689,9394,2370,2906,8877,935,1472,5558,3026,519,450,4682,3478,3411,5630,4560,6734,9355,3084,3798,688,7252,3399,4528,278,9899,832,2152,5945,4806,7900,2808,5280,5209,9374,8697,6083,1851,7721,9884,7641,8431,6838,4315,5884,6071,7535,4753,1049,1595,3722,4020,2341,702,6694,1637,6186,6601,9950,7653,858,2345,5892,5204,1291,9190,7838,7098,2675,5135,5100,6453,4460,5391,6681,5246,9602,2832,4633,8448,7528,7471,9642,9657,3606,1393,6980,1402,3562,5217,7820,2776,8592,9924,8819,9146,9065,4700,5198,152,6297,174,1555,1228,5001,1015,966,7164,3375,4221,5155,6892,5353,9210,4777,4605,432,2631,9637,4392,2865,790,3245,4541,1429,2574,3940,9204,7373,8526,3561,7270,1467,1129,7283,1720,9200,5100,6794,3857,2326,6759,1711,3313,6353,3495,1502,7103,500,5400,4636,523,3706,3891,8454,8156,5512,5319,8017,342,3021,4005,6183,9015,511,9068,6581,3899,6912,5381,944,3971,4691,5289,5079,2629,8185,3180,7126,2098,2839,4472,6725,438,4236,9414,4891,6521,1120,9848,3730,7834,5296,1520,9983,2859,7911,8158,1344,4563,8549,8562,3185,2576,5820,7125,5316,5892,6938,4993,7206,9988,7741,4346,2452,4513,535,5087,7583,5660,5681,4714,829,2429,8373,375,2516,1300,3773,8177,9203,7033,5715,3754,4278,4033,9929,8737,5918,48,1128,8154,7926,1520,6604,9508,4846,9879,5711,5150,385,9000,119,5970,4625,8763,5669,4998,4107,4481,2179,4828,8112,9912,8611,2467,724,7134,8849,8069,7621,2940,2156,2568,6649,3132,6754,931,3944,7353,2594,9928,187,6269,1486,7805,9867,286,9196,3157,5736,1083,4382,7990,5745,1358,8202,5875,8909,6946,9894,726,3501,3132,5402,6385,2086,2750,2720,2265,4232,1664,8608,6558,8540,3808,7882,3560,1264,8931,564,8414,9580,2264,2250,523,7148,2409,5956,7454,5128,8310,9870,6741,9681,4272,9966,4984,954,4396,3064,5111,5596,6417,6876,3800,5433,3782,1885,8009,5183,8399,5280,1610,7348,4432,862,9297,5330,4019,5504,9149,5843,3044,2598,2254,3661,3921,566,4486,7698,1185,7489,6656,5189,2588,4559,1609,7969,8289,5583,53,4159,9351,7886,2380,3049,9725,6382,8945,3811,8747,3171,4122,9426,8869,8337,4622,3604,5565,1445,3714,764,9439,5635,6014,3952,217,4063,5318,9948,2063,8591,2387,7353,6128,4191,9555,7204,6555,9346,211,6138,3606,2095,2116,386,7853,9577,3594,3585,6457,1114,6694,5709,1016,3498,6534,4473,3239,2708,4081,8766,4018,8692,5347,3775,8975,9783,6184,7451,618,4078,7153,4494,4273,2863,8260,7054,2438,226,5552,3644,9282,9761,7946,4888,7318,1927,7247,1013,6594,6239,5570,2964,9393,1586,7644,3457,689,723,1784,6888,6654,151,112,8867,723,5565,7948,5003,3077,3977,8916,5527,9379,5398,1486,8905,4405,2718,5605,4007,3118,3383,3429,8543,5922,6051,1473,4140,6185,9996,3168,8544,1916,8445,1857,3122,2770,6239,701,6940,9452,7773,9909,711,6842,439,6284,1772,478,7321,4882,1790,7647,5793,6348,3768,3916,4850,1660,8456,6810,6095,6050,3202,4502,2364,3770,2800,9330,2485,693,6284,1900,361,3480,6227,4829,6077,7415,7324,3536,5702,9582,4860,4118,5737,3714,4230,7543,3472,6757,9890,8500,9074,159,1387,633,7650,1518,8438,8412,2377,2205,5934,3544,7716,6755,2075,9501,5048,3741,7602,9374,8482,7471,8859,4203,3040,3540,8151,7246,6143,3220,2296,2470,1329,9400,6916,7122,2853,1273,46,1664,8254,3279,4019,8327,1346,1690,4843,9080,6122,9699,3705,4711,4812,892,4273,1503,1637,649,390,8987,2718,297,4480,869,3095,3825,8103,2559,8209,7123,8136,1766,1418,9180,3419,3952,169,428,9606,836,2216,8807,9164,1921,3709,4205,8778,8663,7636,1149,6524,3511,4819,1487,3584,1546,1082,6465,6693,3192,6553,8081,4818,473,511,3968,3627,290,2165,301,2125,3712,3810,5632,8657,2389,7595,5413,6005,8269,2775,7165,5171,1604,7181,4661,5366,4052,9646,8494,8312,856,1324,4613,4964,6697,9276,6833,3680,7296,3281,3224,3511,9686,6633,7097,8295,5044,7278,4737,4510,3011,2611,3604,4168,7720,9188,1408,3689,9340,5726,7164,1950,8733,3927,5813,1700,3093,1200,8732,3296,9423,5047,4953,1890,9198,2274,5388,3687,3997,5148,555,5570,878,3529,8870,6379,5767,907,2001,4372,874,6963,1224,7061,8035,471,1603,5366,6625,8614,7419,7609,7295,1490,3335,5898,2360,9108,3784,5821,5100,1499,3602,9719,5497,1348,8273,1760,8309,2274,4740,6341,9648,322,3460,9891,7913,6084,2368,3197,6954,9700,6442,2999,4977,470,5804,8935,5615,1286,8737,5525,8142,6403,4533,9453,9386,1686,3347,5880,1949,4088,7631,2331,7434,6437,8164,5369,3802,8197,8020,4811,2720,5644,3946,4782,30,3585,2763,5408,1696,5819,1618,3232,9232,9655,7122,5579,2105,1382,5185,8109,5898,174,1663,614,6765,3117,3772,8366,7855,7107,8985,6398,1462,7980,916,909,7372,5027,9698,7693,2318,2740,7084,3287,3157,2304,3504,4059,5801,3695,7216,4061,6495,5002,4510,1370,3924,3018,8640,4468,4152,3739,1647,3533,6999,7601,6807,3542,7567,1719,5014,5921,333,5679,5387,5551,7770,1646,5131,379,2176,7313,3890,4797,6209,3306,281,4163,2216,675,3031,8538,8410,4192,3906,6257,4974,2309,5747,6927,4249,9541,5879,9558,7981,6676,750,4373,4954,6612,2218,5964,2954,8590,9881,3007,1866,2955,8224,7861,6948,4913,2217,3458,6073,3953,93,6561,829,5974,1829,8137,8935,6144,7150,3316,6627,9779,7647,8891,3421,5418,4202,3688,7813,2628,2906,4195,6815,6019,506,1258,673,4950,9514,8682,7948,9699,5353,109,4627,193,3933,752,4167,2923,9698,8200,7849,7050,5950,5037,9173,7328,6298,4786,6523,277,2553,264,2375,566,5145,6331,289,2558,7404,4084,8953,1962,7831,1918,7545,9203,6731,8850,5613,3294,960,2812,9597,8384,148,1128,2079,8909,6480,6531,289,1955,1009,1603,7862,5509,3270,7469,5912,8367,1029,7289,8133,2899,7747,598,941,6811,3876,8392,3691,5534,4947,3396,3284,5240,457,5724,1238,7163,2262,6155,7325,2906,1503,6944,6239,4627,6180,8391,2879,7597,1839,7719,6502,7420,8396,1615,8389,5364,7839,1864,4109,3360,9732,4151,1490,9355,9287,6689,6469,451,9582,221,3791,556,4118,8084,5519,4231,6195,3010,4286,7570,4774,2469,2815,9582,7640,7125,732,2228,8296,9993,3916,9894,3564,9219,5797,1551,924,1081,9644,7124,428,7499,5855,2864,3109,636,8192,7181,4388,5380,8450,5452,4467,9941,3306,3297,7927,1916,941,9824,4554,6954,2684,6114,2710,2483,2914,8552,7585,4991,8172,4586,3386,6115,2376,6149,3821,311,6910,3079,3031,2973,1807,5977,2850,6825,8405,1056,5261,732,3032,2352,9681,6203,5683,2025,7306,2663,2299,2851,2886,1545,5704,5152,6925,4237,6345,1183,9579,5474,8662,1644,251,1771,8372,6926,237,7377,9514,618,7347,5530,811,1464,305,2989,9668,4296,3996,2242,2436,9082,3204,8973,4638,3990,9113,231,2765,4498,4929,3799,8485,3996,3211,7990,4198,7808,3136,3783,8118,4542,9685,5457,9677,467,2204,2324,4844,8009,5796,1596,495,7919,9088,2938,1867,7952,924,8936,1842,3790,9147,5970,2913,7134,3721,4410,4927,566,4167,5511,5397,106,1867,5317,667,1015,6872,3179,1857,2650,729,7862,731,6037,2312,6782,6150,8100,7911,4064,7111,1430,8669,5900,478,1880,5209,283,6613,5767,8381,9644,4862,8385,3974,425,4187,8598,74,213,6264,1722,2697,4527,545,8978,360,4323,1517,88,9383,6671,4688,7387,651,9368,8534,3626,398,6904,6254,9915,8724,1739,6076,3535,9252,4828,8144,3074,1157,6299,4758,3820,8028,7098,6947,9050,6601,2034,6714,782,920,7264,4324,7389,8428,2919,5698,8513,9913,4627,4637,4230,1261,497,5822,3166,877,925,7364,8162,1832,7231,7097,4196,674,5458,7965,4683,5026,1388,2296,4901,4515,6445,8284,2062,7248,7639,7117,9260,5601,7052,2043,9574,644,4486,860,6154,8978,8820,9577,795,2134,4342,3901,2637,2702,1380,5452,5495,4189,3579,7127,2487,6870,8859,5598,4623,9665,1487,4930,2872,7791,7575,3496,5652,284,355,3134,6772,2131,3864,2912,5415,1738,9752,2011,1652,7805,7244,5990,8164,8907,9772,4013,8708,7791,3582,3556,1261,2807,2352,1017,6438,967,3977,8348,1628,2332,8199,8487,493,8002,4894,3436,4254,276,5444,727,6808,3486,2568,5127,7285,6634,3487,843,6916,6545,184,2063,8484,4298,8185,3028,847,4686,2523,542,5765,3810,9541,7227,7690,6941,3533,6192,5268,2883,1863,6871,705,7024,2430,2576,5059,7857,9887,7225,8934,9230,8570,839,4143,4564,8587,892,4937,5329,5785,4930,9691,161,5464,170,1207,2912,2331,4081,1453,6273,6233,9465,6581,4931,2279,4452,2652,4966,4573,2920,2203,1105,2746,1039,299,9637,9066,81,830,7460,7273,4002,9514,3911,4275,7852,2849,9283,7114,6520,2952,8427,1010,9149,2590,6076,8604,6700,2193,1890,9504,5335,9644,8516,8897,1585,1543,8255,7804,3966,9703,8766,779,522,4953,9180,3150,8739,6353,3111,977,3042,9951,8816,3635,3300,9141,2049,4152,1624,3158,8231,9034,6624,636,2868,1180,5797,3552,6738,2765,9424,2651,5621,8792,7231,1264,7340,2747,5326,5015,6596,4634,9927,8927,6868,7423,5123,3862,5846,7037,2805,8265,3067,3071,5210,2811,1043,4433,2466,9786,9832,4726,8797,5399,1574,2296,1906,9950,6820,2319,5794,5278,1816,7516,7486,7834,4135,7750,4089,3285,161,3367,5462,2405,4488,8494,9733,5193,1837,436,806,5000,8938,1229,7994,2450,8571,5446,5620,1023,3780,7603,330,4013,6938,1133,6987,4759,2670,4980,733,72,1314,8551,8233,1078,250,1913,1821,8249,445,1934,5487,3468,420,8013,1745,4696,5337,5649,7013,908,2440,281,1778,4288,5052,1625,395,4091,9945,4058,3111,6575,3529,963,564,5206,6266,988,5176,9275,7309,590,3526,4692,4031,8010,489,6297,7147,1029,9506,713,9345,5736,6574,6637,7787,5447,8955,8641,8379,2703,4847,2954,9671,9871,3143,3730,1006,7175,19,3591,1846,9160,9532,1817,9061,9352,6982,3709,3599,6094,2668,8017,749,200,915,7801,5585,8015,477,4621,4205,8023,2302,470,3398,6189,7261,7770,3477,8887,8325,1647,9402,2798,2444,2200,7810,3184,7807,8703,3255,5909,617,9663,2070,3924,2920,7166,5227,3403,609,5992,8768,8238,2379,3307,3238,8013,5622,420,1965,5189,4249,7177,8930,781,8147,3080,7215,9366,7081,2856,4542,5767,2355,243,4058,7869,4078,1433,8539,2730,5353,3883,951,1356,2431,1973,6546,3292,4189,7795,7113,5853,7438,318,2198,6705,9555,8567,3012,2374,7655,6879,6657,1698,1259,6488,6969,9950,75,8496,6546,2992,1547,1584,8430,3178,9784,1666,2889,4593,8191,2118,1942,4111,1063,946,6890,6225,6099,3445,6960,7989,7572,8386,3754,5299,1031,5720,3978,7394,1511,9173,478,6411,3296,3798,7257,8289,8851,5250,9887,3255,64,9493,2485,7454,1653,1289,9296,1002,3019,3117,7382,1829,2612,772,9198,8345,6925,7418,4717,4391,3267,161,8682,3361,3332,1456,2382,809,2937,2581,9789,8456,3640,4429,4668,3138,3164,2874,1466,7990,7224,1038,1670,4267,919,6906,7582,2779,4442,8412,1432,94,7258,2400,743,1252,5907,1987,2567,7449,7138,9681,5524,139,721,8418,8860,7370,5995,7692,3460,6997,1314,6732,3493,5277,242,6652,7472,2003,1449,6762,2818,1487,9878,2166,4967,2879,6974,2422,9891,5365,8035,7377,8540,1297,2473,9851,5120,1592,2356,9064,5626,2343,4917,8670,5345,3081,3890,8313,1779,6552,7437,6116,6902,6385,1096,2779,7829,4123,3003,514,4189,9715,8138,4597,58,7691,8834,581,9343,7392,2569,4174,4692,8835,9484,5340,1889,8901,2706,7751,5132,4806,1586,4729,3846,9246,1658,7059,6467,3455,3463,5513,4903,284,1071,6682,3600,9750,1211,2544,4906,2165,5968,7359,9071,4038,2675,7599,2738,1533,1394,1187,5485,6844,9839,4352,1584,5462,4774,9890,7398,1153,2597,1869,9386,9400,6338,8149,9960,435,4973,4313,6207,5923,1159,7157,987,3494,6966,795,3475,5887,4817,6174,7899,6350,5312,3741,8352,3969,3178,2713,7606,8185,56,9585,3546,395,7171,8414,4532,2983,1819,1950,5193,9727,3716,9507,5975,5559,6165,8886,3516,7442,5093,2113,3499,3585,820,2951,4148,7453,4039,4686,5199,7455,6422,4583,3699,9824,5759,4148,6397,6784,3314,418,7105,6750,8724,9623,1133,2856,5954,9424,4089,216,1101,4577,8349,9698,4499,452,3248,8755,9306,1995,1168,6481,4943,5326,7537,3464,8394,8457,1571,5757,4534,4896,3216,7011,704,1325,5029,3974,3181,7027,8028,6652,8796,251,6169,5703,2014,791,7883,8389,581,8196,3178,9085,1999,2773,923,1222,4378,7565,6362,1033,607,5883,2957,3921,9102,701,6088,7758,1632,120,4658,8848,9964,5661,5998,3806,7918,4725,8217,967,6430,5748,4930,1314,3533,5388,4957,1481,4822,1682,5172,9611,6526,217,242,4333,4288,7756,2151,1893,2030,2719,113,7256,2446,3931,9689,4941,4719,3382,7188,6983,1777,2817,1314,1757,5806,1522,9626,9856,8906,3391,2516,1894,2022,566,5258,6324,6989,6914,7014,5950,9721,8548,3162,1924,5196,7653,6203,4405,1521,4313,5116,470,9517,7413,1052,9174,8234,9233,2402,4688,7531,9137,2815,2082,6708,6702,3332,2314,6816,5517,6109,5359,2914,9285,7821,9638,600,8466,1389,6126,1372,8314,2560,5627,1131,5520,3110,4346,7301,4687,3226,6247,7846,1651,886,9163,1959,5738,3789,792,7237,7062,8240,6624,7006,8572,5963,1769,6523,2506,2147,3246,5009,8047,9750,6545,4991,3675,7831,5557,2603,7776,1099,818,5663,7458,7314,9749,4520,3147,1343,9225,4454,4344,4796,5088,2651,3797,1924,6559,1638,5918,1624,6219,3655,9747,2478,6897,5144,9694,9377,3170,4895,4085,8557,5052,8164,3999,4570,7237,2231,8303,944,7939,5282,7265,3526,8025,717,6876,546,3825,4176,804,6611,6053,7305,6462,8990,9400,5112,5446,2116,2689,5433,8938,8394,7456,8456,9486,3568,3200,5860,7824,1745,6389,1605,2816,1201,4941,1932,998,481,2376,1268,4558,5700,6300,318,8984,4931,4083,3696,7750,3331,3588,3964,1916,356,4500,4353,1124,9440,8420,4351,391,8238,6654,3526,1003,2391,7551,2290,5876,9688,7356,40,6740,7920,7789,780,3046,3868,6018,4218,2341,4921,1989,4073,2012,3193,8007,7883,5445,4849,7046,1742,3858,9928,5119,2981,3933,1074,2084,561,5920,3105,3604,4192,93,454,1825,3832,1691,483,986,3292,1056,4855,619,3770,1424,379,616,1555,8319,6864,3905,5898,6076,9943,783,6029,5414,9414,1382,4031,9795,6107,7847,2402,2047,1363,4865,7659,4194,3757,9823,9823,9912,4278,9221,6265,7613,4509,6053,562,254,8241,424,9570,1703,9946,9518,3117,5671,8676,7958,6244,5911,4729,9504,2395,4262,9257,5023,1589,4752,4476,8487,8029,5047,6856,2763,6227,5757,6612,2272,2158,565,5195,7723,6310,8446,7040,8033,8653,8291,9766,6246,6112,8812,5770,985,5938,4105,4691,3279,4509,5329,7574,6206,1856,2949],
     "k" : 4362,
     "output" : 43821 },
    {"nums" : [5,5,4,5,4,1,1,1], "k" : 0, "output" : 20},
    {"nums" : [1301,5849,5714,435,8962,239,2942,8905,7984,981,9091,2069,2775,5874,1226,2347,8145,9079,5433,6498,343,6507,841,9491,4870,476,2687,1254,3517,3316,1910,6489,1787,6203,6232,7959,8301,7448,6103,9374,2071,3800,4737,3869,4090,4619,9828,766,3283,231,4338,7233,799,7350,1451,8605,1666,6833,4553,7334,2070,2518,230,5928,2209,4298,1139,4122,7585,8888,3121,2130,2993,3853,5131,8078,5368,8946,3724,9279,4481,298,5224,6415,4909,2682,8430,2064,6281,4901,2271,1860,415,1472,5705,7580,5543,3401,9397,489,6701,1114,6139,8706,3241,1308,2021,8154,1471,4119,488,8084,5665,8409,7233,5282,3067,3491,3632,6908,9559,6028,8498,9553,6831,6719,2365,5103,4520,4110,1936,1677,5730,9310,9431,2079,3516,3876,7384,4650,3250,7319,6812,1181,3594,4778,4630,3004,2429,1066,9527,9449,1897,3306,7134,2909,5390,703,4688,7166,6821,2743,239,4174,1652,8981,4796,6429,5594,785,8850,6284,8347,2432,1376,3075,2718,2097,556,5213,6821,4514,3407,1706,3865,7415,8069,9943,592,3621,6210,9302,3514,8313,3211,5458,6363,9878,4968,7258,6175,2221,7335,2462,5887,5074,8463,345,9110,5265,2781,8067,8880,1751,7798,6738,3966,3667,1992,5654,1935,1134,117,4273,3606,4436,8603,7905,2769,6900,2220,3302,5852,4861,6438,2764,4073,5406,8659,5834,1253,3731,7325,1849,2747,3896,8358,772,338,3658,7578,8017,3358,1776,4913,9817,6467,8681,8451,6363,5655,9981,5661,3761,8867,3320,4245,4616,969,9447,7619,2982,3211,1376,5733,8959,6327,3316,6725,8011,9467,6818,1156,7794,8221,1080,1191,2068,3046,5775,1118,7709,1910,289,7499,8814,7555,3877,4117,9825,1740,9947,3473,7632,8937,5553,3034,554,312,4545,4374,3495,5911,6369,7002,4071,5943,3172,8237,5628,2175,6177,9064,8292,1270,9214,5248,925,446,6229,7880,7817,115,9306,3316,3329,1339,5223,5066,9164,8159,7429,9496,8176,6847,9256,1779,4156,8389,2620,1926,2393,6185,6700,7000,9959,1238,490,9701,9640,1841,2701,1563,1915,9404,9272,9418,6297,5650,7845,5816,3149,1563,6038,912,6078,5854,3162,7876,5622,8591,7788,5521,1609,9122,2235,1882,5471,574,1627,5930,6728,4465,4309,644,4489,1915,1241,2125,5782,2866,3245,9445,8560,5039,7179,9345,6563,650,6501,6992,9528,1534,2531,7547,6402,336,7522,7509,2728,8992,844,932,6659,8961,8338,8683,8865,7471,6325,8538,5122,514,6270,4885,9206,2983,690,569,9841,3919,8301,8409,9214,2510,10000,7483], 
     "k" : 240, 
     "output" : 51405}
]
tmp = Solution()
for input in inputs:
    try: 
        # print(f'Trying {input["nums"]} with k = {input["k"]}')
        output = tmp.maximumScore(nums = input["nums"], k = input["k"])
        if output != input["output"]:
            print(f'Test failed for:\nnums = {input["nums"]},\nk = {input["k"]}\nExpected = {input["output"]}, Returned = {output}')
    except TimeExceededException as e: print(f'Time Limit error for:\nnums = {input["nums"]},\nk = {input["k"]}')