day 16, part 1

master
Matthew Butterick 2 years ago
parent 2e0676ac47
commit 3f9d7989f9

@ -0,0 +1,59 @@
#lang br
(require racket/file rackunit)
(match-define (list fields my-ticket other-tickets)
(string-split (file->string "16.rktd") "\n\n"))
(struct predicate (name func) #:transparent)
(define predicates
(for/list ([field (string-split fields "\n")])
(match (regexp-match #px"^(.*?): (\\d+)-(\\d+) or (\\d+)-(\\d+)$" field)
[(list* _ name numstrs)
(match-define (list val1 val2 val3 val4) (map string->number numstrs))
(predicate name (λ (x) (or (<= val1 x val2) (<= val3 x val4))))])))
(define (t2intvec t) (list->vector (map string->number (string-split t ","))))
(check-equal? (for*/sum ([ticket (cdr (string-split other-tickets "\n"))]
[intvec (t2intvec ticket)]
#:unless (for/or ([pred predicates])
((predicate-func pred) intvec)))
intvec) 26988)
(define all-tickets (cdr (string-split other-tickets "\n")))
(define (ticket-valid? ticket)
(for/and ([intvec (t2intvec ticket)])
(for/or ([pred predicates])
((predicate-func pred) intvec))))
(define valid-tickets (filter ticket-valid? all-tickets))
(define-values (departure-predicates other-predicates)
(partition (λ (p) (string-prefix? (predicate-name p) "departure")) predicates))
(define winning-idxss
(let loop ([extra-count 0])
(define predicates-to-test
(append departure-predicates (take other-predicates extra-count)))
(define possible-winning-idxss
(let ([valid-ticket-vecs (map t2intvec valid-tickets)])
(for/list ([idxs (in-combinations (range (length predicates))
(length predicates-to-test))]
#:when (for/and ([intvec valid-ticket-vecs])
(for/and ([idx idxs]
[pred departure-predicates])
((predicate-func pred) (vector-ref intvec idx)))))
idxs)))
(match possible-winning-idxss
[(list winner) (drop-right winner extra-count)]
[_ (loop (add1 extra-count))])))
;; too many possibilities
winning-idxss
#;(define my-ticket-intvec (t2intvec (cadr (string-split my-ticket "\n"))))
#;(for/product ([idx winning-idxs]
[pred departure-predicates])
(vector-ref my-ticket-intvec idx))

@ -0,0 +1,270 @@
departure location: 41-598 or 605-974
departure station: 30-617 or 625-957
departure platform: 29-914 or 931-960
departure track: 39-734 or 756-972
departure date: 37-894 or 915-956
departure time: 48-54 or 70-955
arrival location: 39-469 or 491-955
arrival station: 47-269 or 282-949
arrival platform: 26-500 or 521-960
arrival track: 26-681 or 703-953
class: 49-293 or 318-956
duration: 25-861 or 873-973
price: 30-446 or 465-958
route: 50-525 or 551-973
row: 39-129 or 141-972
seat: 37-566 or 573-953
train: 43-330 or 356-969
type: 32-770 or 792-955
wagon: 47-435 or 446-961
zone: 30-155 or 179-957
your ticket:
71,127,181,179,113,109,79,151,97,107,53,193,73,83,191,101,89,149,103,197
nearby tickets:
909,469,709,246,389,667,389,288,817,242,942,255,428,712,187,861,821,552,229,253
373,887,919,576,884,946,794,434,376,843,327,658,587,232,796,228,671,878,947,559
554,199,222,610,427,81,235,884,947,81,670,672,643,369,805,611,892,615,274,658
261,378,571,124,111,153,801,196,830,759,257,189,361,382,942,889,613,493,496,320
98,265,894,196,859,594,267,99,7,286,616,665,97,356,524,382,641,290,563,813
947,259,423,939,155,608,282,150,890,147,140,323,808,284,466,725,214,799,96,86
631,265,836,523,86,147,557,542,610,647,398,730,242,243,717,705,72,811,734,556
746,577,386,713,646,127,433,399,243,218,949,225,933,244,827,726,189,625,358,859
90,670,369,154,97,110,188,829,585,383,828,469,190,837,199,245,668,585,400,136
221,855,756,92,86,207,414,395,183,731,591,239,114,798,212,609,708,252,594,602
401,816,196,703,822,792,522,605,119,793,259,254,384,815,552,83,874,582,137,812
186,677,891,259,730,424,653,655,397,947,689,107,363,711,182,415,757,667,70,860
933,401,208,402,388,358,552,713,720,185,307,183,834,141,433,596,641,394,358,665
193,239,553,809,250,466,801,124,776,200,430,376,143,580,367,51,764,576,824,390
378,658,705,644,657,561,521,703,854,375,679,320,500,216,138,614,254,758,124,287
70,808,469,189,323,847,393,833,830,234,883,188,229,830,853,986,673,641,83,406
421,703,741,78,586,116,833,628,182,662,629,258,202,495,674,96,670,101,328,287
608,821,634,155,117,661,103,781,84,756,770,321,119,362,816,681,879,878,759,420
626,239,647,839,2,228,265,293,576,949,592,410,659,885,434,379,257,947,794,671
666,252,811,370,328,54,716,241,874,757,50,495,652,75,933,935,144,1,143,101
594,283,842,605,894,98,368,803,114,797,5,98,379,932,330,200,680,584,645,824
492,290,76,579,100,762,856,812,148,617,183,833,380,757,52,293,68,875,366,873
792,582,392,329,210,846,662,388,310,183,705,410,100,769,125,719,251,366,71,87
558,669,801,80,881,497,981,112,582,597,97,804,652,938,671,842,617,287,708,422
376,802,398,708,389,581,403,212,851,651,225,848,150,791,118,834,857,83,680,592
358,803,629,933,416,944,226,706,795,5,936,129,467,849,253,829,179,734,228,244
433,825,67,236,388,858,880,427,943,400,842,723,564,633,408,79,836,592,704,328
366,402,988,892,469,941,829,90,876,662,879,556,200,590,86,733,229,768,421,409
316,397,806,848,148,382,641,92,850,366,633,392,373,642,793,635,240,826,144,389
318,647,154,382,597,672,321,238,220,88,674,472,402,521,121,769,326,795,890,221
946,385,361,855,598,399,361,409,595,852,225,588,368,556,826,853,721,232,6,850
847,323,626,254,719,938,122,656,806,578,88,556,229,894,579,105,554,266,152,342
207,396,152,390,704,854,563,128,658,254,610,801,221,302,398,89,149,845,403,847
793,180,225,427,723,721,793,811,212,380,270,817,180,770,359,196,415,494,229,383
894,815,641,356,239,143,384,759,469,586,772,598,800,633,606,358,651,109,805,796
551,102,940,715,831,560,399,599,591,250,816,246,587,852,382,416,284,636,585,420
858,643,758,564,84,821,388,183,259,627,647,523,404,251,779,551,731,73,733,185
647,948,663,241,837,219,687,522,521,796,122,756,418,876,887,942,795,74,762,244
500,224,845,426,800,388,492,11,829,183,393,804,889,838,181,807,586,417,829,98
77,936,231,116,211,874,385,572,357,248,825,374,833,236,384,769,764,855,71,794
268,856,941,677,449,384,242,187,218,236,821,655,811,400,197,798,415,198,219,211
664,183,420,189,400,846,584,611,82,204,585,263,614,498,608,278,425,680,612,707
111,270,420,838,196,844,616,392,415,107,652,153,729,757,664,522,183,499,805,499
651,467,949,825,628,798,149,876,245,765,936,653,292,523,640,247,403,389,230,507
717,627,678,145,826,195,197,402,981,240,885,524,207,521,287,647,680,232,208,408
108,648,823,724,267,212,625,644,363,222,880,894,230,397,560,138,217,384,888,933
235,403,659,13,841,429,262,769,363,180,359,262,392,236,823,492,266,566,658,389
429,771,609,126,288,382,415,93,420,252,804,282,879,588,805,384,231,830,379,263
318,82,815,648,290,414,793,558,369,946,646,721,196,7,931,798,637,820,117,204
673,265,664,850,556,627,194,50,84,431,403,895,705,597,820,76,893,628,360,129
940,419,618,70,435,816,586,837,51,117,210,881,836,846,664,194,88,676,885,643
96,104,646,363,700,676,246,859,362,607,643,97,817,521,831,491,612,214,375,875
828,935,727,762,568,237,122,819,235,710,234,816,834,856,634,713,222,419,934,326
636,107,591,594,264,879,850,658,825,148,606,659,223,629,70,806,224,606,914,179
776,617,116,650,576,105,556,625,142,770,363,360,722,108,389,72,124,109,888,320
678,587,498,841,54,712,200,271,631,368,265,766,330,830,97,816,587,798,242,369
418,938,606,580,433,494,716,909,150,633,797,369,887,51,255,593,197,256,720,891
873,239,817,522,71,575,800,117,935,891,640,668,579,255,887,152,771,393,807,817
236,150,433,405,52,728,631,136,856,616,122,844,524,814,413,525,418,815,71,814
89,392,497,939,655,669,403,880,697,226,887,860,525,667,796,666,109,105,561,401
638,576,615,708,621,655,391,491,652,616,126,225,656,230,937,398,839,728,398,249
238,392,798,235,667,493,119,149,827,715,98,112,800,200,51,398,125,260,13,465
195,86,416,949,235,468,666,181,541,936,431,212,145,573,625,418,847,325,596,187
230,724,371,256,733,205,101,715,403,126,675,883,730,519,767,885,151,875,893,650
666,330,480,201,827,402,644,796,946,141,625,119,823,598,758,665,894,121,945,73
255,989,840,121,806,86,193,264,611,812,84,813,560,793,664,323,108,707,627,375
219,630,225,129,823,591,809,824,881,938,798,357,887,75,661,247,620,207,795,378
454,635,500,426,98,942,617,126,647,230,122,887,637,269,375,391,290,125,129,231
328,830,460,630,242,219,252,763,657,719,210,767,587,372,243,730,259,616,182,379
525,576,118,596,101,221,75,320,804,617,206,763,637,762,575,858,594,703,603,826
947,884,363,408,607,810,498,817,421,617,566,109,291,605,800,832,812,679,690,51
84,823,636,139,521,242,947,639,880,263,559,248,211,655,816,801,573,78,713,207
666,50,325,118,578,578,822,885,919,837,229,830,407,670,79,359,243,598,495,428
848,86,673,946,239,803,209,401,882,105,144,90,324,227,629,207,87,851,650,976
616,202,825,707,941,645,402,433,425,660,891,566,86,380,503,418,595,385,680,941
815,264,268,874,54,839,84,74,10,944,803,143,422,411,760,812,833,186,672,557
800,93,2,793,427,420,435,856,556,842,369,832,639,364,704,809,469,115,859,426
884,381,725,841,249,321,105,588,845,579,219,513,255,431,651,584,825,252,370,936
98,725,770,875,417,406,991,681,725,931,644,590,523,54,932,378,418,858,284,321
330,415,503,521,598,209,384,761,669,426,241,879,499,576,190,88,218,380,811,102
182,386,102,769,317,561,828,85,142,363,497,734,419,412,756,384,711,646,153,193
233,609,141,615,731,239,768,402,359,575,984,861,681,677,213,560,412,674,560,264
269,586,889,670,633,919,289,123,640,208,428,326,725,467,629,556,615,219,155,146
222,801,987,415,325,283,721,657,947,941,850,847,559,146,641,679,81,73,794,206
222,940,822,395,770,187,233,852,830,431,631,221,660,758,91,948,913,244,882,105
256,766,364,586,148,892,260,122,710,659,80,387,631,407,701,129,213,236,76,393
719,540,235,70,617,286,836,617,72,575,554,838,51,287,186,241,660,558,880,404
244,844,374,727,255,579,891,195,681,575,645,581,936,552,369,79,134,367,196,324
870,573,591,894,325,54,287,625,833,732,397,847,383,220,522,193,285,581,665,817
724,667,582,100,677,412,318,19,108,292,632,412,734,155,635,761,939,583,223,650
541,255,882,555,673,219,396,756,656,414,803,626,655,388,947,706,942,231,86,121
330,662,885,220,405,886,107,114,192,356,667,222,884,368,921,837,607,937,848,495
184,145,617,426,467,767,78,919,705,378,828,381,98,932,888,109,433,434,728,770
234,730,230,122,155,196,384,683,667,420,805,327,249,670,886,239,947,761,91,716
602,725,389,629,933,398,605,120,631,381,221,199,191,757,844,607,947,575,727,323
681,52,777,184,321,768,213,104,76,667,372,826,721,80,665,880,187,195,759,834
805,95,860,221,713,231,855,375,996,718,889,632,411,78,851,266,91,609,844,935
579,111,185,792,648,325,265,121,716,551,411,124,655,648,324,106,503,215,662,939
794,825,809,564,217,626,637,673,661,205,762,849,385,118,879,219,433,646,531,109
792,873,760,194,240,773,363,573,564,609,78,289,812,432,390,556,206,402,802,251
248,223,839,611,921,267,241,582,241,109,287,639,613,838,874,658,86,118,813,673
127,758,940,561,837,212,114,841,129,289,662,497,371,293,591,758,269,1,228,182
498,322,703,499,826,535,432,626,262,414,70,625,469,201,285,391,194,195,726,193
221,734,399,556,731,820,497,752,127,818,606,845,680,941,221,105,469,383,730,405
161,125,216,50,551,649,607,86,811,77,799,594,759,852,435,111,672,381,758,231
393,78,200,360,828,125,122,208,122,803,837,450,590,242,938,629,83,809,214,51
802,677,732,560,105,664,934,943,637,288,636,528,628,820,207,813,254,731,860,667
214,630,434,561,710,726,808,88,851,797,647,673,126,113,0,647,727,415,365,266
664,818,762,706,209,145,980,209,940,193,940,430,128,86,836,465,365,937,111,180
795,551,84,838,367,387,609,732,837,369,720,129,468,695,665,805,573,835,97,85
396,838,912,154,257,825,369,876,119,111,813,260,813,221,393,185,222,726,808,416
560,762,189,84,563,237,434,706,660,820,124,589,652,824,996,147,612,641,521,369
792,251,523,844,839,680,657,797,277,606,114,850,52,322,410,627,500,650,716,144
598,301,154,606,414,403,385,365,888,122,647,877,102,861,145,659,861,525,593,197
490,882,643,714,651,365,642,81,118,674,655,942,99,677,153,145,833,427,934,128
855,185,536,426,642,826,422,403,931,829,385,641,432,858,238,285,466,640,831,818
232,757,325,288,879,369,54,820,715,387,845,415,150,643,64,651,425,595,250,81
836,397,399,670,392,758,674,111,395,497,876,849,799,328,100,306,883,555,222,491
320,579,117,391,220,102,411,632,670,239,219,608,93,71,824,700,361,809,365,560
838,113,198,851,410,628,254,117,766,734,145,618,467,948,237,840,761,75,375,231
931,247,409,714,54,705,812,389,634,193,111,813,828,237,525,675,389,628,412,7
567,766,198,219,878,598,705,847,933,656,649,239,730,709,318,607,153,216,810,588
666,843,405,322,847,404,931,150,140,144,616,881,188,681,113,244,730,558,858,523
857,656,226,231,580,940,842,618,663,579,611,551,876,850,565,389,406,284,521,144
270,564,573,729,491,946,707,837,198,420,111,125,103,427,406,497,845,466,225,642
520,631,552,832,380,590,813,716,290,605,711,231,551,629,214,323,383,91,574,254
384,645,714,763,678,768,256,179,225,256,216,206,611,377,24,674,614,395,206,553
429,762,122,894,591,716,244,638,882,129,252,421,795,144,281,413,560,558,256,94
384,390,18,381,756,110,714,90,225,211,836,559,671,946,330,719,110,858,827,841
692,329,575,589,892,396,116,124,709,645,720,366,209,224,717,616,255,629,234,845
587,891,656,495,96,605,677,846,850,99,223,123,936,636,434,425,893,424,988,758
613,734,99,611,200,792,580,630,881,247,815,363,829,874,360,425,673,799,941,691
265,654,216,393,77,823,419,635,196,144,663,634,724,90,631,423,792,851,228,56
245,426,127,525,711,727,411,814,944,713,77,823,523,225,839,498,224,275,84,468
381,678,323,284,668,143,797,409,938,89,73,812,796,883,807,82,80,434,427,906
89,804,653,653,112,633,221,184,98,416,610,102,106,253,538,814,424,417,554,327
644,92,707,70,58,945,859,821,404,372,183,409,325,247,705,434,184,582,859,229
203,810,875,841,732,795,823,22,497,610,260,661,499,376,880,666,236,594,426,593
217,132,102,93,807,840,406,827,586,262,657,84,833,101,53,469,584,384,948,419
184,430,932,362,404,845,809,247,881,204,50,404,725,854,908,793,203,833,372,797
428,370,84,626,777,856,152,129,812,635,373,876,666,825,577,191,112,894,293,51
820,591,649,326,130,670,265,932,893,664,838,151,611,207,241,725,585,369,656,240
521,760,137,417,829,413,492,822,649,329,108,392,731,420,663,412,818,606,499,726
827,427,827,420,179,146,492,126,183,226,804,712,651,275,321,593,556,121,845,99
255,235,241,149,255,706,127,370,446,84,17,367,375,808,155,375,122,882,229,75
430,803,995,391,886,424,257,152,196,566,893,851,380,429,934,254,671,148,153,384
805,578,943,412,663,268,123,366,605,208,205,10,432,723,803,615,414,769,109,232
232,668,852,389,743,556,123,820,716,118,848,389,949,947,78,582,377,792,77,374
267,939,733,103,224,759,892,429,857,674,703,861,192,238,619,116,804,726,75,850
936,211,115,143,155,839,18,848,95,610,431,626,143,873,328,256,249,525,194,561
422,851,396,242,226,582,224,523,724,705,719,712,404,885,615,807,922,71,374,809
384,268,241,575,708,253,320,840,610,575,363,216,240,892,283,144,129,356,269,163
58,188,717,374,408,627,729,615,934,292,825,497,598,564,207,888,410,943,770,727
999,887,184,404,766,423,610,396,854,213,77,78,432,845,644,936,325,321,644,655
854,197,73,496,87,658,392,515,626,949,766,498,822,938,398,652,846,707,106,182
590,114,96,654,522,882,216,853,947,73,797,568,607,556,939,715,565,154,239,100
619,636,121,128,326,407,229,681,833,415,204,54,247,358,731,288,378,377,386,495
646,418,859,653,882,558,807,643,381,886,209,220,598,703,118,245,406,70,124,619
803,74,835,361,494,717,423,726,522,807,8,626,611,240,668,892,396,673,227,595
422,584,563,146,263,318,72,727,934,125,555,142,722,641,947,372,366,999,662,116
214,557,379,556,713,151,561,616,191,241,806,688,554,390,79,236,816,433,359,887
712,148,218,229,468,840,183,112,501,552,321,728,714,427,605,71,188,636,573,767
598,318,106,154,253,799,580,252,998,394,258,802,819,405,837,383,720,208,201,51
195,234,874,673,241,515,793,650,144,580,233,109,658,123,148,53,264,392,193,672
584,876,364,611,284,263,53,108,188,654,873,280,734,718,113,708,636,74,434,595
628,948,792,678,81,636,118,563,293,103,514,421,386,834,607,706,100,573,202,398
252,385,555,626,269,15,326,88,73,360,247,813,658,681,725,793,430,195,319,834
253,189,814,654,148,765,586,822,262,616,767,73,666,527,290,78,412,402,731,202
128,673,236,726,662,717,330,832,840,722,372,364,383,406,237,996,648,843,389,668
396,108,371,149,843,830,181,416,626,762,387,887,815,616,366,228,215,404,150,461
210,819,141,658,211,214,106,400,371,215,704,936,936,86,601,847,861,216,583,841
605,985,676,319,636,291,428,630,414,890,426,886,108,706,574,72,246,377,576,843
94,670,161,323,665,369,610,403,523,497,587,392,200,427,196,199,123,193,233,70
607,422,889,803,361,74,645,230,583,873,238,217,90,681,316,409,794,151,74,886
113,705,767,721,765,713,838,182,581,376,765,946,940,191,188,936,611,289,916,615
497,381,103,362,71,11,819,287,663,90,656,205,265,853,817,378,650,794,495,384
578,257,858,263,758,94,254,320,902,100,810,401,657,241,318,657,894,656,498,106
245,387,628,639,392,852,650,425,414,840,536,100,235,73,580,149,942,179,673,524
400,199,383,417,676,146,878,894,435,293,991,146,835,715,493,112,894,326,492,384
844,725,78,607,127,603,655,574,230,825,361,817,212,636,95,152,250,707,384,191
586,202,670,155,577,847,646,403,469,893,206,731,811,591,635,236,391,820,509,644
409,798,698,565,552,201,841,854,103,583,859,495,630,254,226,288,223,83,390,406
808,407,657,282,320,654,573,251,404,319,756,795,876,579,203,407,465,207,244,315
858,491,713,244,282,946,323,716,106,677,811,628,84,889,890,707,493,709,767,548
93,857,304,196,836,82,367,416,703,50,948,607,102,83,400,256,80,635,663,716
585,723,108,316,581,647,582,468,187,496,799,757,814,887,638,376,117,491,590,948
640,694,760,948,218,642,853,642,805,243,410,402,933,380,88,882,931,560,836,761
850,554,893,187,857,718,190,767,562,989,720,949,422,108,941,853,291,190,801,676
92,90,556,94,118,587,714,592,659,609,181,890,106,792,654,83,218,245,371,863
630,597,792,121,360,193,104,241,855,609,386,789,617,937,585,705,580,586,391,825
679,562,795,263,892,446,607,942,824,408,400,679,429,218,653,548,800,823,103,191
182,588,424,199,51,851,722,606,607,593,588,715,193,728,129,434,112,576,106,568
582,5,98,206,733,846,632,366,552,713,494,585,640,416,793,466,891,146,596,827
650,715,234,73,418,728,89,293,82,830,860,139,199,673,648,940,662,672,765,563
182,617,435,678,379,714,842,770,707,113,91,812,229,132,675,846,259,947,122,713
637,795,600,715,837,376,286,936,142,564,194,806,663,827,418,728,243,92,365,368
468,194,186,756,117,290,209,126,616,380,948,312,648,269,495,129,114,190,329,222
187,212,795,659,401,673,323,583,575,272,366,646,234,246,629,103,766,379,248,235
760,659,768,78,379,393,150,435,383,192,287,703,674,605,187,194,467,666,657,3
665,850,497,497,543,806,705,203,663,717,843,123,102,562,150,93,658,252,254,496
402,187,947,555,757,103,282,675,432,50,942,714,856,891,648,293,583,767,780,641
639,330,193,318,114,644,282,803,728,141,254,598,409,615,725,639,549,770,289,257
999,154,128,206,123,221,141,734,627,877,116,285,374,446,663,246,431,108,817,587
675,408,280,726,706,392,286,435,196,669,288,93,254,207,839,793,287,364,319,716
186,75,148,643,120,931,271,665,374,209,429,366,804,386,759,555,114,221,122,760
671,761,234,560,362,446,114,944,553,729,524,659,894,210,229,388,728,818,142,742
832,885,253,418,716,648,657,396,205,650,394,604,151,208,252,386,833,423,182,859
854,78,120,668,272,400,206,703,722,126,678,428,211,943,242,220,251,198,256,493
422,585,229,703,77,902,97,188,268,263,792,206,639,634,875,805,123,559,468,213
291,231,407,885,601,73,383,934,398,838,414,122,118,671,360,839,329,106,648,938
940,90,730,422,655,271,617,210,708,818,185,214,129,109,733,418,401,797,200,217
219,719,792,54,319,561,388,768,250,125,605,243,613,496,123,677,153,267,195,786
362,413,213,402,74,412,804,643,118,324,878,615,890,994,937,95,378,433,493,214
406,671,84,889,884,186,564,564,372,769,119,561,385,802,82,757,270,555,632,383
669,731,949,834,494,685,425,187,551,188,574,876,212,949,804,831,356,261,416,382
886,680,239,430,820,258,367,310,717,803,803,328,420,726,844,224,851,678,78,724
629,228,759,595,124,846,421,554,186,840,266,665,814,183,221,91,687,250,852,553
893,223,586,767,850,125,378,71,807,694,227,103,766,665,366,831,197,237,390,842
821,679,265,73,368,412,327,396,884,79,627,149,940,525,87,106,124,931,995,287
818,591,823,617,187,310,75,816,151,716,609,200,703,889,500,580,726,381,396,396
824,90,434,765,358,399,265,563,613,363,826,597,710,704,384,107,91,590,423,919
138,565,257,84,807,199,119,667,667,235,932,634,220,244,814,841,254,931,385,943
389,806,51,839,880,522,643,651,411,129,575,561,652,706,828,767,307,656,803,407
76,759,388,667,99,401,147,885,598,229,226,82,946,714,746,237,397,597,427,722
102,644,193,725,107,466,243,641,491,180,844,925,823,204,712,91,81,641,836,266
330,638,588,278,837,218,638,715,231,654,713,703,247,664,328,885,826,378,713,852
849,115,946,323,413,413,330,233,861,302,727,592,91,225,187,709,402,672,375,723
322,195,841,248,465,137,212,86,240,289,848,362,446,406,426,551,116,285,467,632
414,87,845,118,50,417,941,608,215,797,652,237,421,860,53,199,70,551,307,661
129,764,839,191,225,183,663,760,249,389,199,803,884,325,725,126,975,590,233,552
468,291,644,98,873,412,849,67,257,707,98,292,719,435,662,803,878,430,638,734
734,944,656,816,905,257,946,268,655,376,195,574,626,795,880,236,592,109,946,595
854,722,287,792,378,117,371,198,728,574,844,798,732,202,824,656,563,497,768,483
186,142,887,760,179,108,320,329,428,880,155,741,818,142,521,609,579,645,616,874
422,810,323,259,211,431,728,120,522,715,429,667,143,891,831,579,833,401,729,279
4,610,73,933,935,226,889,756,652,562,802,500,237,939,834,656,381,892,241,813
565,798,613,689,574,221,106,552,382,674,330,655,608,242,819,246,231,944,431,239
799,820,390,876,72,196,73,234,197,712,629,239,997,422,126,141,649,403,432,717
878,837,121,434,292,879,828,989,661,397,196,646,857,813,680,446,767,148,253,128
254,630,265,428,877,654,581,662,86,798,430,58,850,90,365,423,577,805,320,760
818,388,467,424,887,799,933,843,651,708,366,388,522,905,817,220,89,933,879,941
879,153,236,255,78,60,729,419,644,326,654,142,665,947,561,521,842,291,936,496
915,220,290,499,248,719,595,596,885,214,105,638,589,110,607,204,226,119,885,410
141,193,402,414,816,466,255,822,51,191,361,416,290,822,893,799,604,153,401,231
93,372,942,874,520,630,247,129,657,102,614,521,675,93,141,763,500,368,756,52