Classical vs DQI: polynomial intersection, GF(2¹⁰), n = 60

Polynomial intersection submission #27

zihan_chen · submitted · verified 7 d ago · Accepted CC BY 4.0

Satisfied constraints651

Verifier report

field
binary
q
1024
n
60
m
1023
degree
59
satisfied
651
signed max linsat
279
check
Q (degree 59; n = 60 coefficients) evaluated exactly at all 1023 nonzero points; 651 of the 1023 values lie in their target sets
verify seconds
0.06
View raw report
{
 "field": "binary",
 "q": 1024,
 "n": 60,
 "m": 1023,
 "degree": 59,
 "satisfied": 651,
 "signed_max_linsat": 279,
 "check": "Q (degree 59; n = 60 coefficients) evaluated exactly at all 1023 nonzero points; 651 of the 1023 values lie in their target sets",
 "verify_seconds": 0.06
}

Submission file

Download submission JSON under Creative Commons Attribution 4.0 International (license file)

sha256 1bff0eeffb114b33a9ffb4b7d38fcd2cbb884b1dbb1532327c16b4d485a12575 · 250 bytes · verifier 0183d00bf58d

License

License: Creative Commons Attribution 4.0 International (CC BY 4.0, the default). Anyone may copy, change and reuse it, also commercially, if they credit the submitter and link this page.

Credit: zihan_chen, QArena submission Polynomial intersection #27, with a link to this page. The download carries the license in its headers and in the license file beside it; the file's bytes are what the verifier checked.

Builds on

This submission names no earlier submission.

Cited by

No other submission names this submission yet.

How citations count

Attached code

b10-n60-solve.py 70.4 KB

#!/usr/bin/env python3
"""Standalone OPI search reproduction; no network access or third-party Python deps.

Run: OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 TMPDIR="$PWD/.tmp" python3 -I solve.py OUTPUT.json
Requires a C++17 compiler (g++/libstdc++). On HPC, compile and run only inside a
compute allocation. Original source and fixed-trial source versions, scientific
run statistics, seed, exact replay count, and expected output hash are embedded.
The C++ search uses integer arithmetic and mt19937_64; std::shuffle is supplied
by libstdc++. Output hash verification catches any toolchain-dependent changes.
"""
import hashlib
import json
import os
from pathlib import Path
import shutil
import subprocess
import sys
import tempfile

LICENSE_TEXT='MIT License\n\nCopyright (c) 2026 this workspace\'s authors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n'
RECIPE={'method': 'binary-xp', 'instance': 'b10-n60', 'seed': 2017, 'replay_count': 946995734, 'count_unit': 'polynomials', 'tail_argument': '18', 'expected_score': 651, 'expected_artifact_sha256': '1bff0eeffb114b33a9ffb4b7d38fcd2cbb884b1dbb1532327c16b4d485a12575', 'original_cpp_sha256': 'a07ac8bdc73931f91f77f52f51a7ac7deda254f828388b860eef8b06588338be', 'fixed_trial_cpp_sha256': 'bdc6ee02ece8283e568238840766c2ad54b0ca2304bb9e13b8dc012084fb4fae', 'original_run': {'seed': 2017, 'satisfied': 651, 'candidates': 5118365696, 'bases': 19526, 'inconsistent_bases': 0, 'free_bits': 18, 'forced_points_of_best': 97, 'cpu_seconds': 299.11, 'elapsed_seconds': 300.006}, 'scientific_seconds_requested': 300.0, 'local_validation': {'status': 'accepted', 'score': {'satisfied': 651}, 'detail': {'field': 'binary', 'q': 1024, 'n': 60, 'm': 1023, 'degree': 59, 'satisfied': 651, 'signed_max_linsat': 279, 'check': 'Q (degree 59; n = 60 coefficients) evaluated exactly at all 1023 nonzero points; 651 of the 1023 values lie in their target sets'}}, 'incumbent_log_line': 'best=651 trials=946995734 bases=3613 forced=97 elapsed_s=55.5032', 'compile_command': ['g++', '-std=c++17', '-O3', '-march=native', 'search.cpp', '-o', 'search'], 'source_provenance': 'Original implementation; Jordan et al. arXiv:2408.08292; Khattar et al. arXiv:2510.10967 (CC BY 4.0); MIT license for implementation. Official QArena instance data. No contestant artifact.'}
INSTANCE={'board': 'opi', 'instance': 'b10-n60', 'mode': 'ranked', 'cpu_seconds': 10, 'mem_mb': 128, 'field': 'binary', 'q': 1024, 'b': 10, 'modulus': 1033, 'n': 60, 'm': 1023, 'r': 496, 'generator': 'SplitMix64 from seed (q << 32) | n, b rows per point by U(q), whole matrix redrawn until rank b (SPEC_w2b_opi)', 'seed': 4398046511164, 'convention': 'matrices[i] is H_y for the evaluation point y = i + 1 (field elements as integers, bit j = coefficient of z^j): x_j = parity(matrices[i][j] & v) for j < b, and v is in F_y iff XOR_{j<b/2} x_j x_{j+b/2} = 1', 'matrices': [[497, 370, 459, 275, 272, 973, 1013, 135, 104, 661], [832, 724, 917, 396, 277, 981, 419, 259, 423, 455], [890, 404, 650, 972, 25, 417, 963, 571, 234, 507], [278, 574, 853, 330, 672, 185, 629, 554, 583, 300], [907, 553, 716, 643, 504, 367, 994, 846, 693, 1008], [227, 52, 773, 613, 1013, 663, 756, 490, 241, 776], [518, 860, 356, 500, 30, 715, 181, 215, 814, 7], [189, 497, 682, 198, 717, 29, 254, 65, 507, 978], [674, 949, 675, 723, 135, 538, 308, 582, 637, 506], [310, 111, 808, 261, 660, 131, 363, 564, 996, 544], [169, 220, 84, 189, 302, 419, 971, 98, 241, 794], [372, 925, 373, 33, 130, 972, 809, 896, 948, 862], [878, 307, 755, 743, 224, 845, 164, 958, 91, 105], [758, 411, 41, 67, 753, 686, 273, 462, 348, 249], [576, 441, 418, 593, 583, 313, 853, 538, 938, 838], [1010, 870, 555, 957, 967, 918, 879, 101, 199, 942], [713, 782, 994, 266, 608, 931, 983, 476, 965, 526], [96, 212, 712, 958, 614, 323, 745, 265, 492, 400], [805, 18, 667, 217, 262, 21, 171, 407, 749, 212], [46, 534, 53, 514, 118, 387, 527, 626, 132, 1019], [615, 671, 133, 627, 873, 618, 123, 363, 755, 959], [118, 531, 293, 946, 461, 436, 1015, 566, 149, 156], [144, 49, 215, 813, 518, 159, 529, 89, 677, 896], [1021, 900, 358, 856, 783, 411, 608, 800, 620, 351], [200, 262, 188, 397, 354, 398, 66, 31, 821, 853], [98, 839, 951, 33, 41, 817, 364, 11, 90, 712], [737, 144, 385, 33, 18, 401, 999, 679, 43, 694], [713, 926, 656, 906, 12, 794, 674, 272, 138, 76], [494, 413, 42, 105, 777, 749, 991, 392, 406, 488], [3, 709, 619, 893, 605, 82, 85, 384, 974, 637], [649, 160, 907, 889, 673, 627, 911, 423, 958, 131], [118, 979, 641, 905, 926, 426, 504, 542, 875, 904], [699, 731, 133, 901, 28, 421, 175, 958, 685, 880], [172, 98, 653, 917, 463, 704, 958, 180, 1016, 83], [684, 906, 971, 132, 220, 1010, 87, 73, 481, 46], [747, 520, 17, 670, 397, 303, 446, 838, 308, 872], [359, 980, 319, 565, 816, 970, 169, 507, 50, 31], [41, 924, 82, 979, 588, 713, 335, 550, 750, 737], [106, 707, 57, 472, 380, 844, 290, 470, 363, 37], [522, 140, 962, 575, 411, 230, 999, 58, 443, 97], [228, 325, 150, 758, 509, 674, 452, 487, 760, 804], [627, 365, 886, 238, 1010, 571, 738, 65, 801, 844], [824, 555, 644, 730, 668, 137, 278, 610, 475, 681], [633, 69, 713, 14, 693, 723, 261, 1008, 449, 885], [584, 113, 546, 618, 417, 174, 924, 997, 593, 728], [149, 938, 909, 657, 99, 542, 153, 349, 538, 450], [944, 933, 422, 870, 28, 539, 611, 237, 969, 990], [768, 500, 902, 977, 946, 972, 174, 333, 393, 37], [901, 383, 798, 959, 394, 158, 342, 69, 253, 521], [811, 24, 462, 576, 385, 448, 880, 941, 159, 491], [537, 697, 976, 581, 347, 261, 785, 131, 993, 398], [887, 94, 315, 160, 560, 90, 221, 305, 977, 505], [263, 127, 214, 272, 685, 39, 893, 606, 511, 4], [200, 922, 420, 549, 696, 344, 79, 316, 816, 872], [701, 119, 999, 439, 116, 927, 854, 1023, 319, 787], [221, 456, 134, 425, 559, 765, 229, 803, 494, 883], [656, 995, 142, 980, 800, 584, 321, 119, 804, 983], [495, 384, 270, 383, 509, 683, 260, 883, 423, 352], [800, 106, 44, 371, 524, 204, 322, 202, 492, 912], [105, 531, 468, 38, 22, 147, 925, 653, 437, 146], [84, 817, 811, 603, 189, 525, 399, 612, 146, 501], [407, 134, 587, 572, 545, 443, 26, 895, 721, 603], [96, 845, 246, 708, 862, 822, 52, 305, 83, 950], [611, 592, 750, 445, 895, 740, 444, 369, 99, 59], [696, 134, 593, 645, 668, 18, 407, 68, 837, 81], [545, 439, 583, 167, 371, 900, 368, 887, 140, 47], [61, 174, 152, 762, 212, 552, 706, 436, 332, 179], [814, 896, 678, 132, 851, 100, 473, 728, 866, 306], [26, 959, 79, 8, 210, 493, 214, 701, 176, 195], [863, 708, 698, 893, 1002, 504, 48, 964, 447, 629], [926, 603, 393, 968, 60, 735, 770, 531, 178, 718], [429, 625, 695, 880, 705, 663, 361, 529, 935, 602], [70, 550, 339, 679, 922, 275, 240, 759, 328, 324], [78, 294, 904, 466, 54, 763, 365, 648, 698, 971], [763, 313, 209, 347, 194, 503, 75, 375, 20, 433], [994, 401, 681, 751, 920, 455, 614, 886, 938, 268], [950, 756, 428, 628, 59, 146, 676, 479, 969, 774], [452, 354, 864, 845, 362, 177, 924, 644, 516, 328], [820, 309, 176, 742, 186, 524, 685, 778, 447, 803], [322, 756, 706, 287, 875, 220, 1008, 378, 720, 676], [85, 556, 718, 867, 117, 277, 502, 242, 244, 703], [162, 492, 15, 462, 446, 588, 618, 963, 184, 541], [514, 278, 638, 957, 525, 544, 563, 632, 711, 862], [168, 713, 528, 977, 114, 615, 981, 922, 352, 87], [335, 265, 964, 251, 612, 763, 269, 158, 841, 677], [258, 898, 475, 117, 490, 242, 587, 256, 985, 682], [273, 628, 733, 308, 999, 908, 54, 136, 777, 411], [666, 370, 128, 487, 798, 802, 658, 438, 645, 564], [718, 263, 502, 461, 599, 35, 91, 291, 562, 185], [83, 390, 604, 127, 307, 617, 370, 56, 147, 130], [614, 818, 677, 713, 655, 533, 180, 36, 714, 983], [576, 145, 354, 346, 125, 988, 105, 588, 985, 916], [602, 932, 34, 716, 850, 994, 624, 178, 63, 482], [40, 105, 1011, 870, 452, 810, 476, 675, 584, 277], [188, 506, 692, 861, 769, 932, 888, 569, 110, 703], [213, 892, 798, 1015, 123, 704, 717, 762, 109, 583], [527, 103, 160, 115, 87, 405, 774, 429, 480, 276], [557, 254, 313, 743, 51, 92, 425, 813, 973, 651], [293, 892, 275, 80, 970, 559, 790, 255, 637, 671], [635, 321, 319, 279, 101, 184, 705, 244, 631, 252], [530, 979, 1006, 625, 737, 902, 710, 401, 980, 431], [335, 751, 39, 483, 456, 550, 518, 446, 166, 711], [687, 96, 454, 111, 261, 722, 972, 141, 194, 981], [785, 486, 795, 559, 367, 981, 96, 221, 984, 487], [672, 265, 952, 611, 441, 109, 636, 605, 323, 585], [266, 310, 43, 370, 135, 623, 210, 681, 810, 579], [716, 947, 930, 638, 1013, 765, 174, 262, 91, 1020], [391, 812, 636, 697, 979, 724, 386, 454, 93, 624], [157, 383, 541, 266, 897, 756, 17, 414, 445, 176], [146, 165, 115, 275, 327, 975, 476, 395, 513, 772], [38, 714, 504, 823, 379, 178, 491, 341, 658, 402], [1013, 932, 747, 784, 127, 52, 1008, 502, 850, 429], [283, 667, 862, 298, 225, 711, 316, 973, 1014, 2], [165, 994, 402, 534, 667, 24, 339, 385, 354, 499], [424, 491, 547, 233, 661, 821, 167, 780, 34, 715], [935, 185, 797, 495, 387, 94, 820, 1007, 987, 220], [926, 16, 478, 110, 67, 138, 999, 467, 863, 609], [553, 424, 576, 850, 58, 185, 810, 817, 364, 1012], [958, 574, 866, 361, 796, 979, 406, 823, 572, 592], [52, 153, 392, 278, 172, 252, 828, 651, 763, 41], [807, 155, 264, 203, 275, 497, 331, 874, 103, 82], [186, 783, 61, 666, 412, 718, 999, 758, 575, 426], [292, 964, 127, 268, 993, 229, 15, 172, 635, 117], [597, 34, 572, 336, 480, 520, 173, 383, 280, 66], [629, 428, 220, 861, 421, 619, 29, 928, 119, 113], [493, 160, 53, 724, 92, 328, 579, 310, 314, 761], [187, 659, 326, 674, 47, 464, 161, 606, 437, 579], [161, 376, 639, 706, 17, 419, 707, 797, 86, 79], [887, 99, 545, 127, 252, 626, 18, 683, 800, 802], [314, 99, 393, 95, 482, 696, 619, 845, 640, 823], [854, 245, 760, 732, 250, 130, 170, 508, 281, 781], [120, 968, 233, 675, 268, 16, 12, 138, 654, 422], [696, 464, 205, 313, 781, 396, 35, 676, 532, 155], [857, 527, 53, 381, 984, 480, 21, 823, 105, 819], [40, 355, 319, 120, 502, 110, 288, 956, 697, 980], [801, 897, 919, 205, 350, 320, 899, 309, 237, 527], [627, 841, 400, 199, 1000, 87, 750, 339, 770, 29], [236, 124, 87, 764, 233, 794, 287, 329, 525, 967], [365, 703, 49, 67, 791, 512, 307, 336, 74, 195], [554, 1010, 855, 580, 399, 729, 90, 95, 424, 935], [1023, 16, 921, 230, 725, 886, 785, 544, 832, 457], [315, 709, 684, 728, 959, 172, 443, 348, 822, 592], [584, 367, 927, 1008, 877, 241, 943, 841, 40, 125], [40, 587, 715, 905, 379, 445, 696, 949, 608, 319], [534, 453, 278, 200, 303, 427, 897, 246, 86, 596], [183, 605, 807, 90, 338, 676, 547, 622, 860, 578], [551, 592, 547, 261, 763, 760, 749, 82, 864, 109], [118, 84, 153, 959, 224, 448, 824, 114, 614, 1008], [720, 339, 232, 554, 818, 173, 531, 182, 439, 762], [331, 951, 988, 170, 77, 965, 773, 634, 636, 375], [472, 913, 420, 432, 792, 53, 841, 67, 739, 838], [19, 139, 534, 213, 423, 390, 493, 70, 516, 477], [595, 719, 625, 482, 593, 344, 620, 601, 873, 48], [194, 548, 362, 917, 639, 126, 284, 685, 871, 655], [361, 519, 676, 111, 103, 723, 13, 955, 907, 978], [655, 620, 715, 746, 837, 36, 108, 750, 412, 507], [938, 868, 18, 779, 975, 995, 792, 343, 406, 588], [920, 333, 901, 422, 527, 120, 616, 192, 1015, 952], [668, 665, 275, 314, 816, 732, 540, 43, 333, 563], [65, 981, 355, 33, 872, 253, 606, 912, 308, 775], [885, 970, 384, 705, 618, 286, 667, 330, 866, 256], [993, 395, 984, 294, 926, 691, 271, 89, 876, 820], [329, 334, 915, 831, 99, 763, 189, 15, 417, 744], [393, 759, 59, 452, 901, 941, 873, 626, 971, 758], [969, 238, 922, 941, 144, 802, 900, 157, 638, 882], [486, 378, 285, 192, 941, 559, 448, 885, 10, 1006], [272, 682, 438, 1020, 997, 56, 785, 616, 369, 331], [568, 814, 701, 828, 649, 572, 567, 998, 228, 182], [281, 325, 436, 14, 347, 583, 918, 501, 894, 809], [406, 335, 919, 803, 595, 642, 172, 457, 776, 982], [170, 1004, 724, 88, 610, 598, 379, 930, 463, 519], [578, 227, 34, 358, 725, 31, 995, 693, 771, 1008], [92, 687, 622, 340, 53, 199, 99, 1002, 188, 990], [753, 66, 841, 933, 142, 254, 5, 227, 637, 628], [529, 959, 236, 880, 706, 477, 528, 325, 835, 219], [416, 397, 992, 345, 1007, 914, 325, 830, 637, 563], [770, 500, 85, 455, 145, 951, 348, 950, 323, 781], [916, 981, 342, 644, 563, 611, 900, 383, 198, 743], [110, 697, 894, 60, 306, 333, 227, 365, 400, 46], [213, 715, 256, 380, 465, 231, 907, 578, 466, 116], [305, 769, 484, 480, 390, 100, 392, 692, 252, 444], [570, 502, 655, 382, 982, 839, 599, 818, 612, 581], [267, 169, 581, 811, 750, 111, 303, 306, 965, 127], [797, 156, 689, 492, 924, 305, 183, 849, 99, 435], [809, 45, 712, 486, 1005, 59, 542, 388, 224, 770], [688, 211, 158, 185, 936, 19, 17, 764, 215, 531], [969, 13, 155, 106, 915, 148, 472, 326, 200, 509], [549, 287, 346, 917, 727, 217, 710, 116, 582, 531], [959, 417, 741, 743, 337, 408, 638, 10, 204, 937], [911, 113, 818, 737, 423, 137, 631, 458, 476, 792], [215, 346, 89, 792, 342, 698, 718, 906, 575, 795], [422, 879, 838, 698, 102, 559, 787, 666, 328, 913], [954, 307, 813, 891, 215, 401, 701, 673, 16, 450], [602, 471, 196, 614, 383, 145, 283, 709, 817, 600], [806, 624, 180, 887, 912, 933, 478, 655, 169, 277], [1012, 340, 327, 832, 77, 763, 711, 259, 241, 303], [983, 431, 451, 297, 152, 489, 500, 644, 716, 373], [577, 222, 37, 309, 425, 428, 901, 332, 929, 427], [874, 620, 665, 432, 52, 461, 536, 840, 984, 884], [206, 73, 529, 526, 639, 936, 933, 247, 117, 741], [512, 527, 807, 575, 210, 957, 459, 599, 835, 622], [195, 640, 213, 50, 765, 170, 553, 913, 111, 894], [597, 654, 593, 837, 67, 447, 264, 231, 3, 149], [1, 181, 318, 63, 934, 643, 471, 580, 78, 629], [953, 965, 289, 202, 36, 547, 121, 1023, 866, 249], [382, 28, 198, 357, 558, 441, 44, 5, 129, 662], [729, 586, 605, 354, 625, 864, 582, 580, 690, 801], [927, 118, 157, 768, 317, 335, 899, 662, 854, 340], [640, 82, 162, 674, 573, 108, 140, 687, 106, 970], [359, 704, 976, 502, 711, 363, 731, 923, 473, 322], [960, 271, 840, 991, 944, 80, 463, 811, 982, 532], [221, 647, 606, 106, 33, 826, 489, 552, 201, 290], [205, 348, 659, 480, 893, 1023, 589, 605, 551, 841], [888, 201, 374, 911, 588, 115, 702, 937, 522, 545], [456, 320, 169, 772, 166, 342, 802, 573, 762, 146], [811, 528, 27, 550, 397, 898, 989, 723, 490, 331], [747, 452, 901, 549, 740, 7, 628, 900, 764, 428], [952, 597, 250, 707, 215, 402, 743, 97, 643, 440], [500, 302, 142, 795, 865, 290, 104, 946, 422, 1], [433, 736, 548, 556, 316, 657, 286, 28, 52, 205], [292, 69, 783, 933, 47, 961, 196, 861, 162, 228], [824, 159, 33, 63, 494, 13, 877, 83, 288, 468], [729, 173, 329, 739, 676, 655, 153, 460, 838, 323], [667, 552, 940, 820, 421, 960, 770, 661, 306, 216], [175, 715, 505, 93, 870, 889, 215, 114, 380, 162], [599, 860, 157, 799, 752, 555, 660, 960, 293, 991], [730, 653, 991, 583, 354, 352, 627, 280, 241, 909], [993, 588, 881, 540, 262, 96, 366, 661, 460, 191], [617, 131, 197, 943, 237, 765, 1016, 265, 608, 397], [339, 281, 501, 882, 867, 709, 1003, 946, 299, 679], [960, 376, 689, 68, 154, 115, 110, 57, 355, 488], [326, 462, 373, 342, 851, 945, 156, 92, 363, 346], [42, 348, 463, 365, 927, 546, 875, 267, 262, 253], [719, 40, 160, 283, 614, 798, 120, 820, 44, 601], [641, 435, 909, 570, 230, 237, 216, 891, 710, 288], [393, 54, 543, 801, 805, 890, 8, 653, 459, 913], [947, 348, 549, 538, 764, 234, 1009, 507, 375, 934], [335, 390, 499, 844, 564, 48, 462, 828, 302, 427], [195, 101, 391, 645, 724, 50, 490, 88, 705, 766], [507, 798, 223, 230, 183, 609, 58, 38, 4, 958], [964, 7, 596, 431, 419, 414, 522, 362, 478, 523], [902, 991, 308, 608, 660, 206, 596, 465, 976, 870], [612, 276, 304, 688, 74, 299, 327, 166, 823, 268], [585, 1000, 874, 594, 77, 171, 6, 87, 480, 391], [918, 242, 471, 732, 692, 174, 362, 482, 708, 263], [393, 597, 716, 55, 787, 814, 893, 562, 143, 816], [24, 506, 748, 878, 146, 579, 554, 582, 337, 388], [429, 345, 131, 941, 1007, 459, 589, 114, 668, 324], [690, 812, 591, 747, 100, 766, 880, 630, 541, 154], [710, 941, 564, 617, 889, 484, 305, 645, 173, 965], [209, 698, 156, 700, 408, 1006, 574, 906, 217, 104], [970, 592, 584, 157, 382, 199, 144, 681, 653, 237], [790, 545, 793, 571, 898, 135, 503, 35, 1023, 851], [593, 963, 774, 55, 1001, 172, 985, 737, 303, 14], [5, 358, 416, 927, 997, 158, 741, 404, 212, 60], [647, 480, 747, 99, 868, 204, 317, 26, 266, 35], [993, 571, 350, 325, 225, 351, 892, 84, 565, 820], [496, 613, 670, 837, 10, 431, 337, 427, 334, 13], [947, 250, 742, 146, 922, 798, 722, 652, 818, 501], [603, 1010, 622, 121, 558, 363, 157, 848, 1004, 260], [174, 930, 2, 366, 877, 853, 531, 550, 72, 765], [776, 382, 806, 854, 70, 73, 860, 268, 389, 6], [971, 680, 456, 465, 285, 224, 724, 610, 453, 238], [884, 106, 134, 78, 794, 459, 412, 710, 641, 373], [262, 662, 891, 1003, 166, 622, 755, 577, 491, 751], [948, 156, 501, 786, 287, 831, 699, 874, 617, 1003], [371, 42, 910, 602, 215, 669, 46, 341, 138, 266], [82, 542, 747, 681, 963, 651, 926, 797, 578, 574], [857, 583, 859, 222, 1023, 341, 715, 328, 320, 200], [40, 745, 61, 678, 951, 898, 788, 83, 116, 854], [685, 625, 152, 336, 984, 326, 117, 480, 382, 127], [125, 643, 984, 753, 201, 268, 812, 199, 204, 363], [424, 800, 713, 912, 486, 84, 272, 609, 467, 224], [242, 654, 746, 778, 325, 463, 70, 1000, 147, 885], [203, 594, 1012, 901, 684, 550, 338, 987, 791, 218], [785, 27, 252, 148, 310, 431, 608, 336, 977, 313], [789, 718, 463, 419, 809, 420, 781, 196, 919, 52], [387, 923, 600, 212, 569, 929, 696, 227, 203, 1014], [884, 764, 308, 705, 644, 793, 695, 55, 45, 702], [564, 160, 731, 683, 791, 371, 452, 381, 903, 859], [791, 812, 884, 549, 949, 397, 410, 785, 163, 825], [12, 599, 933, 601, 168, 190, 113, 359, 324, 374], [532, 46, 97, 26, 357, 738, 295, 448, 47, 647], [591, 83, 845, 555, 997, 866, 250, 757, 810, 32], [682, 813, 478, 901, 562, 877, 641, 450, 484, 247], [204, 50, 959, 669, 463, 247, 85, 570, 765, 726], [342, 943, 74, 1017, 265, 19, 121, 774, 973, 778], [225, 586, 148, 930, 453, 350, 493, 895, 762, 988], [901, 268, 96, 852, 321, 69, 750, 336, 682, 513], [447, 560, 786, 949, 21, 35, 538, 542, 834, 52], [538, 356, 430, 650, 540, 885, 740, 663, 166, 688], [947, 175, 517, 356, 793, 415, 155, 761, 273, 656], [520, 862, 508, 845, 645, 789, 883, 186, 787, 373], [274, 117, 34, 144, 100, 998, 793, 862, 177, 525], [443, 686, 656, 743, 141, 865, 747, 1000, 354, 328], [166, 114, 516, 104, 106, 1011, 832, 821, 601, 102], [126, 271, 498, 151, 981, 477, 472, 882, 241, 173], [116, 770, 735, 678, 142, 159, 497, 664, 801, 489], [350, 1021, 184, 467, 314, 730, 917, 996, 268, 279], [91, 869, 832, 430, 461, 879, 951, 805, 968, 612], [512, 341, 834, 861, 64, 424, 433, 411, 877, 96], [571, 716, 351, 396, 718, 28, 300, 178, 107, 698], [210, 473, 273, 847, 759, 268, 627, 304, 810, 851], [954, 834, 901, 187, 185, 87, 401, 393, 752, 303], [849, 682, 573, 829, 1008, 393, 549, 513, 392, 801], [354, 624, 588, 210, 229, 40, 956, 796, 900, 424], [532, 943, 322, 715, 39, 600, 491, 289, 514, 486], [977, 242, 416, 319, 555, 47, 513, 364, 111, 900], [258, 192, 12, 607, 611, 421, 499, 640, 570, 585], [951, 552, 146, 275, 798, 1000, 378, 196, 749, 341], [790, 896, 1015, 389, 184, 654, 127, 492, 80, 480], [782, 149, 513, 233, 663, 210, 756, 696, 642, 575], [61, 790, 217, 535, 754, 1022, 617, 300, 219, 1018], [973, 835, 640, 793, 728, 870, 477, 461, 65, 29], [223, 1020, 890, 710, 252, 239, 698, 260, 720, 450], [988, 779, 495, 156, 105, 146, 370, 344, 267, 766], [1000, 911, 572, 428, 533, 786, 79, 565, 119, 785], [920, 954, 877, 960, 147, 130, 979, 83, 415, 89], [391, 642, 463, 786, 217, 676, 22, 613, 348, 902], [256, 720, 163, 116, 717, 912, 922, 906, 365, 968], [485, 114, 617, 56, 847, 956, 546, 338, 619, 870], [548, 537, 829, 684, 347, 539, 545, 998, 682, 778], [533, 261, 176, 313, 80, 734, 998, 243, 233, 72], [384, 855, 645, 235, 39, 828, 515, 98, 687, 794], [553, 237, 408, 13, 482, 302, 435, 417, 518, 560], [597, 88, 208, 901, 941, 760, 523, 253, 746, 533], [777, 91, 688, 510, 257, 223, 628, 1011, 580, 923], [877, 521, 483, 463, 981, 151, 631, 241, 680, 378], [442, 172, 809, 525, 742, 548, 404, 956, 402, 702], [449, 73, 788, 610, 641, 192, 655, 773, 268, 490], [904, 429, 949, 134, 990, 8, 4, 845, 591, 859], [740, 196, 475, 219, 949, 424, 857, 790, 847, 1013], [392, 665, 426, 432, 498, 977, 117, 746, 403, 980], [112, 455, 423, 1012, 684, 199, 873, 37, 80, 831], [831, 21, 971, 802, 48, 962, 832, 550, 1014, 62], [448, 104, 711, 653, 821, 490, 443, 154, 480, 1019], [230, 706, 276, 10, 459, 744, 390, 33, 907, 782], [97, 61, 357, 937, 373, 425, 329, 864, 964, 286], [224, 676, 843, 338, 524, 710, 620, 600, 88, 941], [133, 320, 321, 851, 544, 65, 464, 971, 344, 732], [405, 289, 713, 737, 965, 76, 276, 220, 463, 376], [650, 894, 370, 447, 393, 730, 107, 296, 149, 92], [132, 495, 529, 796, 544, 28, 123, 156, 942, 328], [338, 134, 548, 407, 152, 375, 351, 62, 406, 488], [355, 65, 388, 23, 758, 991, 445, 137, 312, 801], [39, 68, 257, 850, 408, 944, 288, 137, 329, 621], [17, 211, 295, 480, 875, 803, 693, 139, 835, 811], [860, 846, 174, 426, 412, 524, 183, 414, 55, 567], [689, 503, 194, 16, 356, 518, 639, 219, 852, 653], [470, 626, 496, 918, 601, 116, 910, 841, 164, 107], [914, 379, 322, 459, 997, 594, 234, 946, 685, 825], [430, 621, 136, 897, 88, 903, 996, 200, 514, 69], [214, 417, 975, 665, 711, 541, 633, 562, 995, 506], [313, 1003, 519, 126, 659, 551, 201, 486, 745, 138], [456, 696, 124, 999, 984, 138, 558, 746, 123, 429], [509, 254, 934, 393, 467, 280, 174, 143, 35, 558], [768, 322, 576, 571, 474, 758, 379, 191, 107, 95], [262, 894, 1019, 223, 510, 950, 855, 212, 132, 328], [383, 1001, 336, 860, 837, 737, 230, 21, 677, 289], [211, 346, 298, 642, 877, 550, 990, 57, 894, 264], [499, 777, 872, 847, 703, 497, 515, 916, 373, 118], [390, 1005, 415, 650, 221, 913, 530, 249, 609, 503], [604, 429, 252, 674, 111, 157, 692, 481, 317, 524], [265, 357, 289, 629, 413, 599, 827, 1015, 753, 329], [714, 804, 110, 381, 571, 813, 851, 169, 324, 547], [259, 222, 11, 884, 169, 121, 986, 549, 821, 466], [484, 954, 631, 274, 694, 549, 411, 878, 477, 403], [286, 747, 334, 4, 17, 220, 412, 52, 444, 532], [923, 698, 705, 62, 903, 815, 456, 643, 151, 375], [40, 813, 450, 1018, 846, 397, 712, 995, 486, 302], [136, 539, 352, 590, 19, 132, 619, 1009, 857, 747], [475, 5, 275, 926, 380, 995, 657, 105, 81, 445], [721, 694, 576, 689, 450, 741, 659, 15, 1008, 23], [795, 64, 151, 839, 677, 671, 31, 789, 502, 115], [861, 922, 239, 258, 957, 47, 759, 247, 944, 1012], [474, 86, 405, 797, 597, 720, 325, 753, 102, 95], [873, 891, 88, 360, 721, 1006, 8, 690, 453, 5], [986, 580, 1000, 734, 103, 783, 817, 118, 212, 567], [608, 1011, 479, 175, 79, 878, 48, 828, 597, 710], [783, 880, 752, 566, 419, 137, 662, 531, 619, 329], [356, 586, 962, 371, 85, 436, 608, 917, 494, 627], [807, 17, 171, 524, 872, 417, 131, 660, 642, 936], [111, 318, 685, 888, 870, 462, 773, 137, 383, 85], [231, 776, 929, 75, 898, 157, 788, 62, 484, 937], [184, 281, 347, 762, 1010, 632, 170, 424, 709, 367], [767, 921, 295, 76, 34, 968, 680, 399, 425, 768], [366, 492, 115, 837, 523, 138, 525, 910, 828, 759], [983, 450, 886, 720, 453, 425, 270, 792, 816, 117], [465, 59, 190, 721, 584, 176, 681, 483, 24, 571], [829, 304, 900, 626, 460, 726, 621, 273, 183, 680], [34, 259, 216, 861, 742, 5, 224, 392, 729, 810], [610, 914, 776, 545, 623, 850, 810, 66, 700, 445], [211, 677, 138, 991, 290, 219, 537, 847, 183, 465], [26, 535, 858, 175, 277, 844, 552, 541, 180, 659], [524, 607, 850, 640, 135, 393, 744, 203, 786, 796], [852, 660, 334, 187, 13, 1011, 106, 739, 165, 826], [107, 632, 21, 881, 370, 939, 714, 342, 754, 163], [115, 722, 56, 349, 175, 881, 282, 44, 901, 785], [655, 231, 45, 112, 245, 760, 708, 193, 234, 819], [53, 177, 102, 901, 524, 635, 963, 558, 780, 249], [149, 118, 292, 366, 697, 794, 680, 228, 953, 230], [515, 599, 711, 705, 715, 286, 242, 988, 478, 460], [758, 439, 822, 220, 339, 827, 674, 19, 511, 332], [417, 725, 873, 199, 32, 952, 455, 84, 517, 242], [974, 610, 751, 887, 543, 193, 979, 708, 495, 628], [335, 546, 964, 935, 42, 969, 105, 576, 603, 595], [298, 325, 274, 191, 384, 602, 481, 193, 118, 1020], [95, 198, 624, 232, 573, 667, 842, 9, 881, 920], [911, 20, 232, 751, 41, 517, 666, 523, 199, 709], [43, 286, 1003, 586, 175, 262, 411, 581, 567, 868], [744, 180, 246, 1004, 392, 998, 595, 759, 809, 309], [325, 570, 524, 421, 353, 795, 168, 241, 238, 689], [847, 365, 364, 560, 518, 193, 327, 424, 646, 848], [861, 56, 733, 277, 574, 165, 185, 161, 59, 646], [963, 275, 620, 68, 593, 788, 272, 528, 863, 331], [11, 826, 866, 234, 1019, 923, 364, 103, 329, 533], [122, 407, 184, 620, 354, 419, 432, 944, 874, 687], [607, 108, 898, 7, 521, 240, 426, 328, 492, 154], [901, 778, 22, 962, 453, 493, 798, 325, 759, 630], [676, 285, 822, 961, 134, 647, 663, 100, 470, 897], [235, 476, 601, 513, 609, 1012, 419, 488, 92, 297], [456, 669, 846, 289, 834, 156, 678, 982, 453, 702], [958, 512, 162, 17, 339, 264, 642, 558, 999, 704], [204, 163, 619, 739, 216, 309, 589, 104, 478, 537], [318, 169, 617, 295, 978, 621, 351, 552, 701, 829], [668, 596, 355, 574, 247, 751, 55, 361, 648, 628], [300, 454, 727, 975, 626, 844, 522, 53, 748, 467], [270, 79, 228, 334, 757, 448, 800, 499, 844, 686], [159, 730, 175, 2, 800, 392, 471, 522, 610, 795], [670, 730, 95, 448, 329, 300, 256, 804, 154, 1009], [332, 161, 303, 993, 520, 540, 721, 796, 991, 122], [841, 504, 57, 716, 489, 696, 435, 2, 224, 141], [165, 66, 764, 110, 458, 785, 225, 713, 390, 989], [1008, 169, 201, 35, 730, 321, 417, 463, 219, 700], [338, 340, 67, 302, 125, 703, 603, 274, 787, 565], [754, 960, 144, 93, 957, 475, 941, 501, 688, 888], [725, 921, 836, 1021, 790, 729, 811, 302, 828, 626], [562, 518, 530, 831, 143, 826, 714, 881, 121, 210], [204, 1023, 739, 910, 171, 39, 133, 25, 441, 554], [588, 360, 1021, 82, 266, 851, 507, 441, 702, 78], [822, 626, 306, 28, 774, 688, 93, 604, 672, 493], [822, 563, 339, 623, 872, 851, 297, 995, 344, 573], [899, 168, 226, 32, 640, 757, 257, 850, 823, 4], [45, 769, 142, 343, 594, 373, 471, 411, 353, 721], [427, 694, 118, 957, 457, 705, 282, 715, 45, 1009], [79, 156, 116, 166, 687, 930, 888, 392, 700, 265], [690, 365, 772, 319, 330, 164, 198, 560, 970, 973], [1012, 539, 618, 504, 703, 805, 926, 861, 325, 779], [612, 524, 119, 224, 123, 184, 604, 265, 70, 135], [563, 678, 411, 126, 660, 80, 808, 134, 665, 705], [986, 222, 849, 464, 678, 340, 644, 92, 147, 688], [80, 221, 615, 486, 262, 664, 222, 493, 196, 924], [804, 306, 421, 270, 938, 514, 541, 830, 993, 689], [118, 623, 372, 762, 176, 800, 386, 172, 271, 661], [122, 806, 601, 928, 654, 528, 560, 783, 699, 910], [4, 568, 495, 214, 534, 640, 293, 419, 589, 408], [793, 199, 972, 88, 625, 572, 212, 180, 64, 594], [526, 18, 40, 186, 687, 111, 721, 891, 924, 391], [510, 458, 181, 817, 276, 963, 552, 626, 616, 643], [794, 870, 790, 262, 336, 500, 505, 774, 747, 222], [5, 265, 697, 430, 364, 935, 475, 322, 63, 175], [862, 318, 547, 59, 726, 170, 498, 887, 940, 317], [805, 12, 102, 660, 808, 19, 868, 257, 468, 523], [445, 609, 291, 920, 508, 599, 279, 313, 719, 77], [1017, 727, 814, 892, 318, 112, 615, 606, 191, 514], [804, 254, 664, 466, 915, 544, 116, 940, 628, 397], [384, 83, 348, 720, 248, 492, 788, 1016, 66, 56], [221, 702, 54, 403, 18, 740, 455, 314, 907, 21], [753, 486, 779, 422, 148, 185, 522, 415, 268, 550], [998, 435, 67, 292, 817, 981, 820, 97, 616, 971], [933, 507, 848, 590, 789, 581, 817, 791, 651, 431], [413, 906, 591, 26, 583, 849, 575, 733, 611, 599], [835, 860, 1002, 95, 263, 422, 215, 488, 51, 1], [205, 849, 187, 143, 484, 350, 108, 623, 157, 471], [671, 764, 225, 2, 447, 235, 291, 1008, 887, 137], [138, 639, 657, 780, 684, 145, 586, 453, 184, 122], [622, 950, 49, 995, 427, 508, 407, 751, 233, 478], [685, 321, 745, 201, 118, 845, 353, 538, 400, 577], [683, 29, 1019, 588, 151, 235, 960, 952, 307, 665], [536, 720, 363, 208, 647, 433, 325, 112, 864, 540], [544, 202, 700, 712, 393, 893, 556, 1013, 244, 374], [499, 909, 947, 423, 699, 725, 628, 232, 441, 292], [575, 713, 718, 535, 632, 355, 987, 734, 960, 444], [231, 331, 487, 258, 98, 726, 706, 656, 599, 196], [747, 981, 788, 743, 777, 255, 833, 945, 102, 37], [797, 105, 570, 694, 698, 576, 829, 522, 572, 676], [96, 447, 55, 250, 608, 716, 553, 907, 385, 593], [567, 602, 767, 457, 847, 895, 998, 421, 195, 14], [586, 746, 840, 270, 690, 751, 26, 128, 616, 219], [901, 567, 948, 525, 507, 258, 446, 642, 377, 82], [104, 910, 500, 911, 82, 776, 601, 882, 529, 631], [155, 418, 813, 701, 830, 972, 978, 846, 303, 185], [121, 230, 814, 693, 1022, 832, 631, 2, 522, 182], [8, 615, 362, 549, 334, 221, 165, 250, 168, 887], [277, 319, 910, 218, 516, 257, 557, 641, 473, 912], [14, 23, 742, 980, 719, 613, 600, 482, 692, 513], [713, 532, 394, 18, 485, 1011, 429, 624, 690, 618], [629, 577, 62, 807, 23, 660, 229, 263, 870, 599], [214, 377, 235, 948, 911, 190, 296, 744, 889, 53], [522, 531, 451, 871, 11, 633, 845, 345, 754, 844], [859, 413, 208, 58, 237, 20, 843, 145, 813, 785], [65, 323, 900, 834, 478, 342, 523, 946, 942, 835], [4, 970, 61, 719, 141, 518, 402, 104, 846, 869], [1013, 243, 1018, 299, 163, 610, 668, 601, 409, 142], [395, 38, 886, 786, 159, 164, 462, 921, 874, 16], [861, 587, 320, 715, 944, 770, 575, 882, 18, 524], [440, 549, 905, 342, 811, 953, 936, 242, 911, 81], [933, 307, 277, 575, 641, 365, 475, 9, 399, 468], [350, 404, 747, 247, 153, 159, 251, 563, 990, 342], [202, 703, 7, 523, 784, 973, 285, 905, 460, 608], [998, 446, 88, 727, 559, 271, 191, 878, 968, 829], [953, 690, 988, 445, 314, 112, 497, 1009, 537, 439], [473, 649, 701, 633, 621, 881, 166, 484, 792, 300], [852, 219, 901, 140, 424, 297, 521, 198, 96, 17], [575, 468, 229, 126, 272, 168, 142, 999, 27, 942], [272, 210, 345, 616, 520, 920, 748, 935, 889, 120], [750, 1014, 148, 196, 665, 82, 28, 240, 169, 740], [603, 285, 825, 504, 305, 937, 332, 974, 132, 695], [499, 272, 662, 510, 456, 710, 930, 554, 270, 600], [541, 745, 911, 643, 283, 477, 29, 788, 307, 776], [1001, 862, 639, 831, 530, 303, 1021, 872, 265, 640], [871, 440, 222, 554, 298, 673, 701, 599, 341, 135], [740, 607, 990, 132, 845, 907, 870, 369, 265, 824], [425, 603, 720, 199, 1004, 209, 554, 42, 654, 926], [156, 328, 460, 20, 651, 40, 501, 548, 462, 289], [557, 285, 884, 570, 458, 377, 45, 785, 331, 53], [364, 863, 502, 754, 247, 505, 738, 393, 722, 189], [844, 592, 162, 488, 860, 752, 700, 751, 753, 817], [142, 152, 198, 827, 396, 660, 385, 447, 474, 387], [86, 216, 547, 555, 976, 925, 221, 495, 138, 728], [455, 565, 54, 707, 969, 187, 878, 996, 872, 216], [694, 446, 979, 820, 578, 612, 299, 670, 959, 996], [284, 12, 543, 1022, 555, 58, 922, 283, 76, 990], [870, 834, 789, 273, 521, 549, 213, 872, 374, 182], [468, 668, 401, 640, 687, 534, 818, 40, 897, 158], [437, 354, 598, 52, 357, 191, 498, 712, 717, 547], [719, 905, 13, 350, 713, 378, 474, 233, 175, 509], [753, 241, 550, 87, 873, 445, 25, 103, 961, 18], [753, 606, 71, 48, 490, 409, 555, 685, 133, 915], [926, 669, 973, 29, 797, 1009, 102, 127, 716, 104], [551, 782, 80, 1001, 430, 457, 812, 333, 402, 101], [778, 691, 962, 891, 288, 906, 156, 11, 1015, 448], [915, 822, 75, 512, 89, 41, 800, 477, 964, 373], [646, 736, 875, 769, 791, 325, 498, 929, 747, 70], [304, 789, 34, 881, 557, 981, 90, 264, 924, 990], [742, 185, 478, 760, 870, 529, 889, 447, 650, 365], [424, 572, 795, 506, 843, 120, 698, 598, 886, 452], [154, 136, 402, 491, 82, 324, 1013, 855, 681, 383], [761, 34, 205, 456, 469, 947, 448, 794, 162, 221], [90, 663, 666, 623, 775, 1014, 773, 662, 645, 966], [480, 166, 839, 976, 244, 145, 261, 905, 954, 1009], [886, 252, 986, 995, 864, 128, 519, 316, 681, 171], [335, 983, 724, 345, 808, 592, 715, 692, 491, 1008], [659, 484, 690, 397, 465, 787, 722, 292, 54, 526], [708, 830, 401, 587, 125, 433, 177, 73, 712, 515], [931, 579, 478, 634, 465, 407, 41, 497, 339, 638], [895, 513, 594, 621, 62, 539, 1013, 997, 952, 303], [645, 706, 902, 319, 951, 711, 628, 966, 941, 315], [595, 691, 80, 1, 539, 95, 851, 760, 661, 943], [491, 857, 970, 296, 234, 124, 159, 258, 900, 881], [88, 47, 898, 709, 165, 950, 564, 956, 254, 587], [178, 459, 155, 714, 324, 795, 1022, 423, 602, 745], [720, 404, 930, 40, 459, 684, 58, 83, 959, 891], [168, 548, 138, 405, 725, 631, 202, 180, 275, 677], [160, 138, 922, 3, 931, 632, 134, 908, 398, 390], [368, 71, 793, 760, 573, 999, 654, 729, 985, 450], [865, 610, 683, 171, 165, 704, 455, 656, 962, 554], [693, 638, 83, 860, 950, 1018, 899, 818, 4, 808], [8, 770, 186, 834, 170, 98, 667, 501, 426, 629], [971, 148, 395, 861, 309, 268, 297, 923, 182, 163], [521, 74, 883, 603, 407, 960, 1023, 512, 509, 682], [691, 108, 737, 271, 188, 836, 802, 1004, 478, 942], [830, 135, 589, 270, 1012, 981, 808, 775, 750, 355], [926, 958, 516, 353, 345, 314, 308, 50, 708, 782], [114, 186, 1023, 666, 573, 789, 887, 60, 222, 707], [742, 114, 229, 502, 369, 759, 451, 158, 889, 220], [806, 645, 96, 62, 378, 459, 113, 448, 605, 431], [660, 778, 141, 371, 1011, 768, 696, 733, 983, 402], [685, 440, 365, 778, 21, 491, 121, 646, 892, 541], [988, 233, 657, 151, 545, 191, 679, 412, 76, 124], [500, 639, 564, 778, 567, 809, 408, 54, 628, 253], [240, 497, 872, 544, 998, 771, 594, 331, 844, 684], [845, 361, 907, 803, 173, 683, 544, 247, 754, 747], [699, 234, 586, 774, 937, 156, 626, 718, 318, 857], [668, 919, 566, 77, 9, 688, 190, 275, 1005, 712], [84, 208, 972, 447, 167, 693, 419, 846, 543, 1002], [425, 949, 790, 802, 635, 337, 338, 528, 67, 351], [872, 734, 475, 128, 3, 561, 895, 631, 95, 255], [679, 946, 76, 599, 968, 564, 554, 426, 183, 171], [611, 462, 701, 593, 1020, 507, 932, 470, 461, 427], [471, 707, 482, 1022, 960, 297, 649, 93, 125, 486], [301, 876, 316, 568, 443, 142, 303, 549, 746, 276], [158, 481, 663, 257, 70, 458, 602, 653, 193, 462], [568, 931, 650, 702, 442, 960, 763, 29, 456, 501], [884, 341, 675, 665, 824, 968, 74, 379, 1022, 572], [191, 413, 242, 875, 652, 904, 415, 905, 918, 731], [116, 637, 1001, 181, 663, 31, 991, 191, 177, 564], [575, 492, 20, 373, 13, 596, 1011, 245, 350, 546], [109, 504, 508, 963, 344, 909, 964, 826, 446, 928], [545, 589, 235, 574, 711, 778, 855, 539, 315, 159], [611, 784, 478, 166, 157, 641, 95, 198, 897, 1003], [959, 19, 126, 130, 889, 801, 720, 894, 30, 481], [448, 857, 821, 562, 788, 876, 692, 193, 872, 750], [666, 1000, 62, 802, 914, 634, 468, 347, 878, 938], [493, 809, 162, 327, 881, 167, 81, 207, 849, 233], [507, 242, 835, 391, 777, 717, 214, 731, 967, 414], [867, 925, 2, 117, 421, 802, 846, 336, 693, 334], [337, 95, 716, 1002, 875, 167, 340, 995, 618, 986], [522, 347, 349, 681, 13, 46, 751, 644, 807, 466], [596, 251, 817, 447, 879, 338, 979, 34, 232, 119], [56, 33, 333, 318, 995, 636, 761, 213, 800, 848], [399, 788, 872, 671, 821, 208, 373, 305, 882, 433], [33, 643, 407, 809, 35, 733, 461, 851, 212, 911], [443, 165, 374, 198, 964, 307, 676, 267, 162, 419], [842, 542, 552, 351, 536, 792, 3, 209, 617, 494], [618, 257, 503, 544, 537, 495, 277, 723, 83, 167], [474, 330, 107, 350, 927, 292, 415, 878, 511, 364], [317, 494, 148, 292, 648, 620, 890, 213, 281, 579], [562, 359, 901, 992, 157, 548, 398, 859, 903, 820], [875, 402, 122, 845, 181, 208, 339, 163, 641, 211], [670, 401, 733, 32, 864, 618, 577, 127, 500, 867], [466, 711, 254, 145, 837, 708, 745, 292, 608, 49], [468, 699, 618, 673, 128, 439, 743, 636, 876, 689], [271, 726, 317, 164, 227, 320, 962, 398, 545, 120], [695, 995, 104, 786, 530, 613, 413, 736, 666, 127], [607, 520, 819, 570, 401, 243, 166, 998, 916, 820], [941, 177, 529, 1020, 50, 125, 642, 183, 412, 17], [446, 806, 119, 1022, 60, 521, 646, 22, 776, 736], [612, 709, 194, 742, 561, 176, 807, 945, 310, 925], [264, 536, 874, 656, 90, 510, 427, 857, 794, 985], [186, 600, 193, 8, 985, 461, 237, 203, 584, 118], [770, 947, 849, 476, 314, 514, 305, 100, 706, 153], [568, 498, 215, 186, 659, 961, 640, 231, 105, 66], [918, 206, 234, 37, 864, 853, 494, 197, 559, 843], [879, 714, 882, 85, 464, 919, 224, 843, 476, 576], [190, 199, 752, 480, 728, 977, 251, 886, 373, 80], [195, 996, 567, 343, 963, 492, 604, 286, 140, 592], [55, 186, 199, 84, 197, 680, 373, 753, 895, 778], [823, 331, 493, 113, 86, 406, 588, 760, 780, 854], [877, 657, 739, 766, 35, 526, 804, 192, 809, 152], [1023, 326, 804, 451, 628, 491, 252, 841, 178, 895], [33, 555, 450, 485, 492, 851, 506, 764, 922, 182], [513, 64, 536, 454, 168, 522, 570, 585, 124, 591], [542, 992, 398, 790, 603, 185, 13, 25, 670, 375], [233, 154, 424, 897, 173, 180, 626, 915, 349, 927], [668, 978, 692, 897, 779, 951, 881, 75, 543, 843], [677, 592, 1018, 612, 111, 848, 46, 74, 355, 390], [328, 1003, 597, 92, 19, 160, 637, 567, 27, 977], [935, 670, 144, 698, 908, 942, 967, 121, 844, 644], [440, 846, 810, 151, 740, 72, 869, 274, 36, 812], [78, 129, 866, 571, 218, 926, 446, 919, 775, 616], [656, 818, 758, 199, 440, 196, 804, 73, 75, 641], [44, 864, 674, 559, 522, 955, 547, 98, 46, 21], [875, 123, 807, 726, 598, 303, 242, 109, 742, 219], [312, 313, 190, 917, 1022, 706, 237, 128, 453, 567], [91, 976, 727, 648, 218, 192, 556, 291, 763, 808], [220, 225, 411, 810, 697, 993, 366, 601, 148, 546], [624, 518, 827, 229, 1020, 817, 476, 545, 534, 89], [366, 338, 445, 544, 743, 996, 908, 264, 939, 610], [556, 931, 215, 918, 824, 189, 291, 967, 470, 116], [559, 686, 573, 939, 666, 248, 677, 904, 701, 513], [248, 224, 338, 7, 107, 1012, 265, 569, 251, 600], [793, 555, 590, 292, 258, 883, 998, 713, 185, 798], [861, 613, 827, 479, 573, 955, 197, 940, 158, 65], [988, 876, 300, 961, 53, 451, 955, 143, 794, 1009], [137, 231, 607, 887, 984, 77, 634, 504, 452, 224], [148, 740, 848, 845, 348, 875, 471, 180, 286, 1010], [873, 461, 481, 487, 47, 362, 349, 127, 181, 912], [79, 373, 397, 758, 305, 724, 251, 701, 781, 860], [967, 855, 370, 932, 505, 890, 433, 500, 175, 68], [209, 751, 456, 125, 588, 811, 104, 960, 135, 243], [407, 855, 852, 355, 254, 453, 545, 45, 221, 684], [387, 483, 157, 940, 756, 522, 546, 827, 685, 633], [948, 251, 217, 212, 604, 848, 479, 817, 651, 123], [715, 45, 498, 974, 952, 990, 354, 122, 212, 225], [521, 149, 56, 851, 220, 798, 457, 675, 261, 902], [934, 146, 165, 735, 265, 1, 1001, 204, 516, 1020], [162, 913, 291, 962, 797, 904, 396, 82, 424, 866], [690, 163, 380, 133, 244, 41, 839, 522, 29, 835], [846, 69, 134, 817, 252, 369, 886, 213, 602, 679], [61, 834, 570, 650, 993, 263, 278, 35, 844, 273], [106, 560, 63, 991, 55, 73, 526, 584, 190, 284], [464, 485, 205, 906, 967, 526, 87, 755, 91, 503], [110, 311, 9, 24, 982, 674, 687, 580, 942, 795], [520, 157, 786, 159, 882, 748, 1017, 107, 681, 794], [163, 753, 941, 838, 802, 664, 15, 602, 315, 180], [907, 435, 520, 516, 660, 525, 543, 281, 577, 155], [13, 938, 525, 577, 962, 229, 213, 800, 90, 611], [288, 255, 886, 532, 719, 91, 950, 951, 780, 427], [545, 21, 841, 272, 758, 432, 859, 527, 876, 121], [297, 397, 72, 754, 253, 753, 790, 846, 643, 348], [371, 712, 441, 189, 97, 585, 280, 23, 1022, 180], [856, 118, 429, 992, 695, 361, 418, 239, 186, 570], [926, 228, 879, 628, 370, 836, 130, 440, 67, 259], [26, 593, 28, 962, 1013, 937, 908, 419, 414, 255], [819, 10, 340, 47, 812, 179, 412, 793, 729, 751], [459, 559, 550, 726, 635, 883, 114, 286, 327, 193], [957, 928, 395, 226, 132, 117, 543, 212, 1001, 766], [405, 288, 238, 587, 451, 749, 101, 448, 207, 92], [44, 736, 545, 914, 906, 876, 410, 145, 132, 607], [639, 852, 725, 442, 421, 386, 395, 920, 375, 647], [24, 847, 258, 495, 554, 901, 728, 292, 450, 926], [585, 857, 512, 615, 19, 637, 429, 72, 352, 596], [222, 523, 870, 812, 719, 754, 856, 78, 312, 243], [165, 150, 20, 556, 370, 349, 126, 43, 758, 642], [304, 209, 177, 4, 489, 42, 535, 454, 352, 643], [392, 591, 1009, 962, 712, 960, 760, 804, 662, 65], [776, 258, 185, 611, 644, 49, 459, 266, 33, 470], [468, 476, 128, 925, 753, 567, 606, 479, 938, 712], [751, 850, 499, 457, 236, 59, 37, 802, 376, 483], [112, 914, 904, 455, 330, 22, 951, 510, 875, 882], [624, 99, 444, 657, 480, 217, 408, 275, 334, 958], [617, 689, 725, 888, 741, 47, 916, 726, 449, 826], [464, 772, 90, 895, 376, 722, 749, 36, 189, 578], [513, 1009, 565, 619, 962, 183, 47, 250, 787, 524], [669, 892, 226, 395, 404, 730, 707, 503, 13, 403], [275, 539, 215, 885, 845, 470, 850, 326, 290, 258], [379, 607, 128, 910, 754, 43, 809, 272, 852, 178], [805, 560, 452, 533, 466, 992, 368, 787, 89, 615], [698, 632, 466, 771, 84, 293, 768, 672, 624, 612], [761, 797, 600, 860, 98, 121, 229, 269, 875, 916], [101, 989, 419, 472, 886, 120, 411, 376, 521, 511], [802, 142, 135, 388, 173, 717, 792, 310, 509, 177], [972, 375, 342, 918, 142, 111, 324, 21, 273, 172], [193, 796, 974, 929, 28, 190, 585, 789, 55, 501], [170, 340, 338, 258, 764, 1021, 111, 705, 537, 46], [129, 406, 766, 97, 520, 736, 914, 951, 515, 234], [142, 551, 89, 407, 591, 243, 347, 381, 327, 855], [566, 87, 69, 667, 45, 858, 881, 994, 298, 264], [233, 154, 770, 215, 555, 700, 824, 733, 372, 8], [380, 133, 283, 772, 496, 286, 326, 762, 519, 952], [859, 232, 976, 173, 1001, 358, 1016, 106, 67, 158], [609, 844, 437, 510, 935, 273, 290, 981, 498, 466], [595, 315, 110, 6, 1013, 225, 1018, 345, 642, 991], [559, 390, 761, 275, 232, 477, 421, 729, 492, 332], [12, 662, 691, 765, 413, 964, 320, 529, 57, 705], [363, 426, 880, 1006, 58, 287, 565, 494, 793, 276], [344, 677, 508, 9, 139, 992, 17, 311, 65, 316], [296, 303, 493, 989, 307, 108, 874, 830, 1023, 627], [140, 110, 865, 445, 35, 325, 118, 306, 525, 771], [41, 463, 694, 563, 125, 771, 492, 292, 190, 868], [91, 732, 840, 602, 756, 820, 849, 662, 498, 972], [283, 734, 82, 287, 162, 872, 1013, 779, 516, 825], [726, 890, 271, 968, 377, 207, 303, 856, 746, 946], [808, 104, 822, 78, 226, 556, 724, 630, 193, 12], [730, 493, 859, 683, 607, 591, 982, 222, 359, 510], [423, 243, 954, 644, 847, 973, 282, 258, 485, 392], [930, 397, 103, 413, 769, 444, 314, 187, 764, 829], [312, 775, 866, 393, 727, 933, 583, 323, 917, 221], [923, 419, 424, 602, 536, 104, 233, 252, 631, 920], [779, 78, 940, 876, 485, 992, 400, 580, 138, 294], [169, 1010, 391, 369, 231, 16, 536, 808, 861, 899], [466, 553, 858, 14, 350, 613, 885, 837, 432, 654], [1007, 67, 685, 763, 640, 853, 384, 992, 991, 483], [470, 647, 937, 808, 489, 844, 452, 7, 310, 595], [909, 366, 776, 353, 779, 225, 662, 822, 234, 172], [458, 917, 397, 322, 524, 209, 242, 368, 857, 608], [401, 798, 698, 900, 623, 835, 173, 332, 261, 19], [998, 261, 918, 849, 649, 523, 762, 798, 18, 889], [749, 894, 959, 198, 713, 751, 958, 385, 235, 785], [935, 982, 822, 88, 245, 332, 1017, 87, 347, 552], [755, 921, 272, 481, 269, 626, 192, 1021, 431, 916], [598, 548, 368, 701, 720, 277, 730, 60, 760, 208], [738, 285, 709, 810, 523, 441, 185, 136, 898, 395], [714, 609, 401, 807, 316, 897, 90, 511, 614, 693], [601, 668, 268, 284, 219, 814, 362, 394, 461, 862], [553, 857, 446, 451, 692, 202, 584, 742, 1001, 343], [436, 151, 57, 348, 129, 952, 383, 443, 1014, 160], [742, 524, 33, 482, 957, 883, 991, 774, 961, 333], [916, 888, 692, 975, 710, 870, 191, 330, 627, 313], [187, 595, 351, 385, 865, 823, 814, 914, 570, 6], [742, 143, 673, 746, 881, 717, 180, 535, 155, 532], [609, 382, 863, 747, 1006, 150, 50, 58, 485, 499], [653, 759, 1014, 312, 99, 150, 94, 445, 331, 253], [263, 450, 707, 84, 2, 740, 562, 249, 955, 143], [487, 59, 734, 731, 578, 433, 387, 183, 203, 938], [656, 546, 715, 100, 27, 534, 377, 522, 743, 477], [30, 265, 825, 116, 369, 282, 431, 499, 917, 630], [353, 649, 704, 278, 1022, 765, 543, 300, 106, 187], [899, 443, 32, 997, 283, 240, 44, 380, 567, 995], [295, 767, 297, 463, 745, 595, 680, 183, 844, 925], [700, 840, 254, 275, 852, 204, 168, 646, 1, 441], [840, 777, 575, 601, 457, 184, 82, 158, 469, 831], [1009, 494, 446, 11, 369, 382, 156, 661, 75, 754], [259, 134, 287, 97, 334, 352, 413, 210, 765, 151], [380, 796, 977, 605, 638, 704, 756, 194, 135, 438], [773, 238, 747, 118, 359, 120, 422, 96, 856, 452], [306, 225, 679, 958, 339, 585, 860, 822, 719, 688], [108, 427, 342, 881, 616, 286, 13, 246, 624, 279], [656, 57, 755, 297, 718, 147, 542, 482, 218, 855], [471, 6, 18, 23, 172, 42, 937, 195, 661, 524], [204, 467, 633, 256, 856, 183, 863, 395, 1017, 615], [964, 532, 763, 138, 687, 558, 296, 681, 919, 191], [610, 164, 539, 116, 555, 437, 553, 272, 469, 185], [334, 297, 345, 665, 274, 878, 45, 866, 838, 258], [365, 721, 982, 917, 564, 187, 656, 517, 208, 789], [593, 833, 913, 518, 382, 896, 637, 231, 496, 573], [245, 637, 257, 744, 132, 488, 902, 797, 943, 226], [139, 780, 637, 1009, 87, 386, 883, 824, 851, 260], [232, 163, 187, 858, 384, 519, 410, 4, 355, 844], [211, 724, 548, 969, 561, 343, 133, 345, 822, 860], [1015, 7, 605, 457, 78, 683, 695, 303, 304, 841], [828, 699, 932, 691, 24, 7, 401, 789, 500, 97], [439, 95, 724, 978, 917, 175, 215, 416, 12, 775], [83, 877, 967, 629, 315, 440, 667, 374, 643, 125], [682, 971, 835, 572, 361, 1021, 528, 313, 939, 181], [509, 601, 753, 734, 756, 708, 224, 860, 249, 947], [536, 605, 477, 721, 732, 650, 727, 662, 522, 123], [199, 257, 752, 104, 64, 300, 298, 801, 99, 29], [508, 254, 474, 791, 104, 151, 395, 618, 524, 235], [296, 159, 53, 200, 420, 1010, 772, 543, 434, 768], [231, 281, 1021, 697, 593, 240, 596, 987, 94, 449], [671, 703, 144, 499, 502, 422, 627, 603, 420, 410], [804, 989, 503, 641, 13, 386, 45, 328, 306, 796], [412, 73, 653, 455, 828, 288, 209, 460, 963, 695], [362, 591, 6, 749, 441, 24, 396, 767, 998, 1017], [903, 547, 900, 289, 299, 762, 706, 307, 238, 551], [519, 391, 322, 775, 862, 165, 317, 259, 267, 498], [860, 405, 60, 150, 375, 913, 980, 781, 286, 684], [40, 560, 366, 772, 282, 69, 303, 673, 657, 753], [256, 370, 467, 318, 583, 166, 696, 560, 745, 784], [888, 976, 153, 941, 293, 356, 867, 520, 872, 497], [808, 801, 581, 526, 1020, 965, 694, 402, 419, 7], [990, 46, 1003, 59, 322, 974, 100, 931, 619, 85], [388, 969, 442, 278, 939, 757, 315, 271, 67, 738], [972, 600, 928, 773, 647, 367, 190, 913, 611, 293], [488, 948, 919, 83, 47, 563, 176, 246, 671, 816], [10, 660, 948, 367, 467, 753, 178, 274, 123, 456], [845, 739, 974, 806, 170, 696, 967, 844, 950, 491], [769, 899, 915, 4, 888, 628, 433, 847, 362, 234], [284, 531, 665, 798, 477, 175, 769, 394, 530, 334], [849, 939, 525, 751, 471, 239, 255, 30, 1012, 725], [181, 894, 635, 973, 507, 816, 45, 463, 707, 537], [157, 433, 235, 164, 556, 401, 122, 17, 162, 341], [682, 636, 89, 193, 936, 946, 536, 915, 480, 1008], [890, 849, 450, 260, 1021, 685, 184, 598, 114, 271], [741, 925, 871, 505, 581, 105, 919, 820, 396, 1006], [91, 936, 894, 50, 888, 246, 92, 298, 449, 737], [537, 440, 320, 559, 421, 348, 969, 325, 539, 690], [923, 190, 354, 746, 634, 772, 299, 263, 775, 66], [611, 33, 920, 246, 896, 421, 781, 389, 837, 189], [69, 769, 320, 843, 356, 481, 58, 1020, 160, 232], [898, 675, 187, 994, 913, 701, 462, 346, 423, 279], [354, 417, 436, 815, 100, 267, 578, 445, 331, 622], [741, 920, 669, 773, 23, 712, 769, 987, 245, 253], [410, 429, 233, 872, 980, 316, 991, 199, 820, 503], [561, 1023, 948, 421, 782, 263, 179, 527, 609, 711], [249, 349, 912, 501, 29, 27, 779, 594, 509, 893], [803, 68, 119, 452, 65, 568, 163, 315, 390, 334], [41, 926, 648, 171, 234, 760, 989, 291, 754, 302], [509, 25, 410, 507, 229, 342, 726, 617, 463, 544], [980, 885, 440, 308, 694, 508, 770, 352, 897, 690], [377, 587, 409, 720, 657, 143, 687, 454, 311, 895], [867, 280, 462, 620, 400, 371, 600, 278, 242, 266], [383, 1009, 358, 707, 134, 845, 213, 700, 560, 247], [941, 795, 759, 444, 287, 660, 804, 412, 153, 491], [639, 254, 421, 27, 942, 140, 749, 579, 481, 215], [876, 987, 396, 175, 109, 981, 897, 959, 487, 976], [871, 145, 131, 575, 750, 452, 945, 3, 596, 413], [704, 682, 817, 471, 609, 296, 496, 436, 922, 830], [299, 164, 871, 880, 293, 565, 493, 902, 670, 402], [297, 950, 162, 384, 96, 795, 330, 414, 274, 718], [530, 665, 550, 6, 886, 99, 723, 771, 119, 186], [952, 421, 658, 378, 743, 832, 972, 967, 444, 56], [785, 185, 492, 493, 182, 195, 893, 82, 138, 375], [108, 202, 215, 944, 987, 865, 181, 253, 324, 627], [1020, 146, 20, 67, 632, 848, 118, 949, 996, 497], [851, 815, 425, 578, 426, 933, 1019, 37, 595, 506], [939, 714, 346, 423, 215, 606, 176, 96, 111, 452], [686, 914, 39, 767, 582, 18, 83, 541, 188, 220], [820, 707, 426, 358, 365, 807, 786, 134, 591, 176], [459, 488, 578, 956, 896, 624, 339, 426, 134, 28], [395, 370, 213, 1004, 78, 18, 991, 696, 469, 260], [433, 140, 586, 667, 303, 138, 678, 909, 139, 384], [947, 641, 191, 267, 76, 93, 758, 92, 714, 250], [900, 366, 964, 70, 742, 710, 993, 931, 527, 349], [631, 314, 593, 943, 256, 942, 590, 657, 131, 738], [903, 215, 258, 1017, 996, 932, 836, 695, 711, 865], [947, 948, 345, 82, 575, 795, 466, 8, 320, 520], [413, 488, 891, 16, 615, 133, 87, 540, 542, 783], [449, 746, 282, 529, 876, 707, 186, 518, 650, 932], [473, 996, 73, 425, 602, 239, 95, 597, 560, 485], [87, 4, 889, 959, 605, 58, 1015, 97, 620, 423], [800, 380, 638, 475, 250, 757, 732, 927, 371, 602], [240, 236, 54, 120, 124, 445, 276, 548, 31, 393], [70, 923, 18, 954, 968, 362, 261, 195, 830, 648], [737, 953, 259, 911, 430, 407, 702, 927, 222, 411], [294, 407, 322, 873, 871, 840, 384, 396, 685, 537], [240, 992, 294, 997, 926, 325, 284, 181, 441, 649], [787, 904, 212, 190, 868, 605, 310, 294, 38, 852], [780, 180, 796, 67, 976, 245, 408, 192, 153, 311], [987, 671, 567, 618, 131, 58, 728, 156, 1006, 122], [568, 522, 441, 332, 216, 211, 924, 294, 114, 118], [16, 638, 974, 787, 788, 74, 29, 269, 452, 753], [219, 28, 895, 896, 468, 98, 851, 415, 54, 427], [309, 611, 679, 140, 919, 167, 200, 261, 781, 718], [128, 648, 911, 353, 713, 909, 107, 323, 741, 505], [51, 707, 42, 346, 316, 259, 847, 44, 317, 1015], [842, 788, 253, 22, 375, 83, 693, 132, 911, 179], [241, 262, 118, 829, 190, 534, 877, 537, 974, 927], [465, 396, 676, 660, 105, 723, 154, 894, 482, 836], [1017, 524, 798, 1021, 239, 709, 615, 697, 281, 765], [80, 716, 527, 619, 98, 589, 393, 334, 109, 401], [286, 164, 101, 556, 671, 524, 17, 145, 947, 813], [973, 761, 873, 622, 779, 763, 704, 6, 191, 208], [325, 523, 833, 900, 693, 277, 247, 458, 922, 540], [290, 423, 807, 757, 42, 303, 689, 770, 921, 663], [994, 308, 537, 383, 382, 990, 159, 674, 1013, 1023], [119, 748, 932, 346, 277, 331, 965, 444, 190, 942], [425, 622, 716, 1004, 577, 367, 670, 478, 87, 94], [923, 68, 650, 70, 7, 601, 60, 810, 150, 535], [56, 795, 229, 503, 563, 968, 18, 248, 191, 100], [265, 207, 766, 564, 367, 893, 695, 596, 158, 941], [497, 982, 882, 29, 989, 68, 182, 28, 372, 808], [861, 124, 55, 138, 442, 556, 696, 558, 784, 103], [979, 494, 825, 601, 846, 283, 365, 1003, 498, 401], [454, 979, 460, 951, 204, 819, 654, 594, 503, 357], [313, 235, 108, 701, 367, 745, 356, 74, 659, 260], [531, 90, 936, 761, 710, 776, 417, 353, 679, 40], [486, 223, 699, 413, 66, 608, 833, 850, 626, 362], [320, 453, 848, 267, 296, 948, 333, 715, 489, 113], [829, 769, 235, 785, 714, 333, 108, 585, 270, 581], [840, 178, 416, 1002, 81, 561, 282, 63, 911, 710], [498, 795, 348, 328, 1021, 233, 980, 93, 258, 225], [101, 680, 133, 692, 378, 873, 279, 752, 181, 173], [715, 1014, 859, 401, 13, 375, 810, 1012, 523, 1008], [971, 42, 683, 342, 170, 315, 299, 108, 593, 914], [236, 675, 998, 105, 31, 412, 596, 547, 795, 110], [577, 597, 494, 445, 993, 251, 152, 476, 847, 73], [79, 155, 311, 943, 461, 663, 346, 863, 507, 150], [660, 47, 280, 197, 909, 378, 762, 727, 970, 612], [767, 285, 970, 177, 568, 349, 619, 873, 505, 745], [976, 699, 325, 277, 49, 343, 75, 665, 720, 527], [611, 548, 208, 672, 695, 767, 566, 34, 88, 429], [407, 231, 742, 825, 725, 284, 668, 11, 335, 494], [942, 566, 101, 347, 57, 810, 134, 761, 696, 1009], [462, 1002, 825, 858, 404, 684, 92, 276, 873, 22], [716, 928, 751, 192, 693, 803, 174, 346, 931, 138], [737, 94, 23, 734, 665, 547, 90, 110, 997, 55], [983, 1000, 635, 201, 925, 442, 665, 971, 670, 817], [924, 723, 517, 979, 105, 915, 65, 416, 687, 265], [460, 588, 491, 117, 202, 392, 803, 308, 876, 198], [72, 85, 915, 369, 592, 99, 466, 245, 234, 972], [37, 704, 953, 414, 584, 770, 292, 203, 739, 388], [103, 265, 460, 166, 191, 53, 851, 259, 21, 545], [141, 427, 312, 69, 940, 42, 587, 518, 976, 213], [968, 258, 132, 25, 513, 918, 908, 619, 394, 432], [211, 520, 468, 379, 119, 995, 958, 71, 727, 1002], [512, 254, 55, 1009, 914, 587, 2, 556, 769, 508], [426, 928, 526, 270, 528, 310, 501, 9, 946, 968], [3, 215, 358, 1012, 456, 338, 518, 486, 353, 387], [921, 975, 676, 715, 874, 895, 104, 787, 708, 23], [154, 464, 367, 84, 818, 385, 132, 846, 381, 197], [617, 684, 474, 851, 690, 399, 891, 900, 948, 127], [57, 994, 943, 699, 737, 40, 818, 776, 808, 210], [145, 330, 913, 269, 792, 488, 675, 301, 258, 956], [546, 976, 15, 675, 618, 392, 193, 931, 157, 961], [805, 45, 925, 444, 915, 861, 520, 521, 157, 678], [8, 806, 459, 1, 745, 994, 476, 102, 672, 164], [922, 999, 300, 284, 853, 10, 64, 103, 396, 918], [568, 554, 825, 515, 608, 73, 27, 169, 189, 504], [400, 271, 856, 584, 42, 627, 817, 402, 823, 881], [289, 684, 239, 654, 740, 1022, 934, 141, 577, 316], [183, 262, 722, 688, 875, 368, 138, 659, 940, 551], [132, 950, 516, 87, 981, 844, 756, 267, 313, 397], [527, 546, 362, 832, 647, 818, 418, 658, 580, 387], [365, 3, 161, 990, 967, 572, 766, 814, 511, 542], [783, 514, 502, 643, 377, 552, 580, 426, 588, 977], [600, 7, 41, 971, 917, 437, 820, 407, 988, 273], [959, 707, 715, 112, 108, 348, 955, 273, 526, 378], [920, 307, 807, 202, 373, 960, 494, 529, 703, 1015], [449, 337, 29, 752, 274, 1005, 327, 283, 737, 316], [437, 874, 173, 873, 432, 704, 505, 959, 175, 683], [933, 978, 558, 743, 78, 138, 967, 168, 594, 216], [761, 980, 575, 725, 793, 69, 642, 58, 281, 874], [489, 377, 40, 219, 508, 826, 792, 110, 728, 973], [14, 798, 542, 655, 460, 479, 25, 523, 371, 406], [78, 716, 1006, 279, 861, 774, 540, 541, 435, 803], [706, 472, 268, 153, 775, 231, 937, 28, 271, 287], [140, 94, 645, 290, 775, 91, 865, 893, 565, 379], [48, 735, 343, 331, 100, 341, 131, 188, 976, 701], [454, 201, 741, 423, 807, 512, 750, 532, 752, 492], [335, 829, 522, 111, 536, 477, 426, 271, 609, 31], [549, 377, 206, 614, 971, 519, 284, 193, 869, 791], [744, 48, 301, 863, 372, 1019, 553, 838, 642, 398], [796, 580, 235, 598, 612, 986, 93, 798, 689, 774], [790, 830, 153, 625, 267, 677, 401, 571, 990, 529], [206, 901, 460, 340, 588, 768, 509, 104, 953, 984], [340, 570, 779, 73, 781, 85, 1002, 500, 110, 134], [959, 256, 342, 120, 645, 552, 646, 613, 234, 915], [937, 127, 980, 613, 886, 170, 424, 439, 870, 133], [1019, 805, 10, 17, 179, 102, 1022, 936, 522, 832], [133, 302, 98, 444, 853, 1009, 738, 36, 20, 716], [299, 425, 553, 936, 297, 982, 55, 281, 413, 452], [29, 560, 101, 1012, 840, 810, 118, 94, 923, 704], [1017, 38, 110, 313, 692, 832, 330, 168, 507, 845], [828, 138, 620, 619, 495, 59, 678, 173, 849, 157], [326, 669, 113, 703, 555, 905, 109, 573, 659, 256], [172, 529, 461, 851, 378, 490, 550, 424, 696, 462], [341, 465, 1000, 119, 687, 402, 786, 789, 580, 297], [20, 625, 175, 174, 616, 432, 524, 467, 282, 399], [874, 552, 197, 730, 494, 195, 765, 435, 602, 264], [217, 338, 992, 688, 986, 553, 394, 333, 328, 790], [325, 34, 29, 661, 896, 234, 1022, 829, 523, 832], [774, 177, 682, 527, 385, 821, 63, 592, 222, 815], [761, 807, 629, 616, 109, 399, 92, 762, 980, 229], [1012, 138, 338, 777, 179, 13, 913, 381, 286, 382], [556, 482, 107, 647, 797, 554, 331, 238, 342, 769], [755, 372, 327, 272, 337, 615, 62, 137, 452, 412], [783, 694, 686, 829, 78, 943, 687, 304, 63, 559], [536, 415, 1017, 634, 467, 1023, 558, 287, 288, 323], [848, 1015, 842, 461, 835, 285, 683, 810, 423, 104], [7, 27, 182, 476, 17, 299, 200, 543, 972, 249], [181, 366, 709, 530, 180, 413, 595, 981, 234, 1021], [714, 309, 601, 956, 1022, 992, 985, 443, 107, 405], [619, 386, 288, 90, 316, 644, 522, 900, 221, 276], [902, 951, 101, 374, 163, 195, 765, 111, 921, 825], [215, 866, 111, 528, 933, 533, 398, 152, 439, 608], [679, 195, 957, 588, 634, 948, 591, 346, 134, 990], [65, 3, 874, 192, 946, 620, 761, 787, 740, 240], [291, 336, 866, 825, 452, 136, 923, 43, 515, 286], [810, 483, 169, 874, 279, 671, 816, 937, 955, 236], [627, 186, 654, 420, 830, 833, 348, 578, 188, 450]]}
ORIGINAL_CPP='// Original Extended Prange attack with bit-sliced quadratic Gray enumeration.\n// Source for the XP affine subspaces: Khattar et al., arXiv:2510.10967,\n// Section III.2 (CC BY 4.0). No third-party implementation code is copied.\n// Copyright (c) 2026 this workspace\'s authors. MIT license; see LICENSE.\n#include <algorithm>\n#include <chrono>\n#include <cstdint>\n#include <ctime>\n#include <fstream>\n#include <iostream>\n#include <numeric>\n#include <random>\n#include <stdexcept>\n#include <string>\n#include <vector>\nusing namespace std;\nusing Bits=vector<uint64_t>;\n\nstruct Problem {\n int b,n,q,m,mod,N,RW,PW;\n vector<int> exp,log,H,power;\n explicit Problem(const string&path){\n  ifstream f(path);f>>b>>n>>mod;\n  if(!f||b<4||b>12||b%2||n<2||n>1024)throw runtime_error("bad header");\n  q=1<<b;m=q-1;N=n*b;RW=(N+1+63)/64;PW=(m+63)/64;\n  H.resize(m*b);for(int&h:H)f>>h;if(!f)throw runtime_error("bad matrix table");\n  exp.resize(2*m);log.assign(q,-1);int x=1;\n  for(int i=0;i<m;++i){if(log[x]>=0)throw runtime_error("nonprimitive modulus");exp[i]=x;log[x]=i;x<<=1;if(x&q)x^=mod;}\n  for(int i=0;i<m;++i)exp[i+m]=exp[i];\n  power.resize(m*n);for(int y=1;y<q;++y){int x=1;for(int j=0;j<n;++j){power[(y-1)*n+j]=x;x=mul(x,y);}}\n }\n int mul(int x,int y)const{return x&&y?exp[log[x]+log[y]]:0;}\n int target(int y,int value)const{int s=0;for(int j=0;j<b/2;++j)s^=(__builtin_parity((unsigned)(H[y*b+j]&value))&__builtin_parity((unsigned)(H[y*b+j+b/2]&value)));return s;}\n Bits row(int y,int coordinate,int rhs)const{\n  Bits r(RW);int h=H[y*b+coordinate];\n  for(int j=0;j<n;++j)for(int u=0;u<b;++u)if(__builtin_parity((unsigned)(h&mul(power[y*n+j],1<<u)))){int i=j*b+u;r[i/64]|=1ULL<<(i%64);}\n  if(rhs)r[N/64]|=1ULL<<(N%64);return r;\n }\n vector<int> coeffs(const Bits&x)const{vector<int>c(n);for(int j=0;j<n;++j)for(int u=0;u<b;++u){int i=j*b+u;if(x[i/64]>>(i%64)&1)c[j]|=1<<u;}return c;}\n vector<int> evaluate(const Bits&x)const{\n  vector<int>c=coeffs(x),v(m);for(int y=1;y<q;++y){int a=0;for(int j=n-1;j>=0;--j)a=mul(a,y)^c[j];v[y-1]=a;}return v;\n }\n};\n\nstatic void xor_into(Bits&a,const Bits&b){for(size_t w=0;w<a.size();++w)a[w]^=b[w];}\nstruct Echelon{\n int N,W,rank=0;vector<Bits> piv;\n Echelon(int n,int w):N(n),W(w),piv(n){}\n bool add(Bits r){\n  for(int i=0;i<N;++i)if(r[i/64]>>(i%64)&1){if(piv[i].empty()){piv[i]=move(r);++rank;return true;}for(int w=i/64;w<W;++w)r[w]^=piv[i][w];}\n  return !(r[N/64]>>(N%64)&1);\n }\n Bits solve(int freebit,bool homogeneous)const{\n  Bits x(W);if(freebit>=0)x[freebit/64]|=1ULL<<(freebit%64);\n  for(int i=N-1;i>=0;--i)if(!piv[i].empty()){\n   int v=homogeneous?0:(piv[i][N/64]>>(N%64)&1);\n   for(int w=i/64;w<W;++w)v^=__builtin_parityll(piv[i][w]&x[w]);\n   if(v)x[i/64]|=1ULL<<(i%64);\n  }return x;\n }\n};\n\nint main(int argc,char**argv){\n if(argc!=6){cerr<<"usage: binary_xp MATRIX.txt SEED SECONDS OUTPUT.json FREE_BITS\\n";return 2;}\n auto start=chrono::steady_clock::now();clock_t cpu_start=clock();\n Problem p(argv[1]);uint64_t seed=stoull(argv[2]);double seconds=stod(argv[3]);int K=stoi(argv[5]);\n if(K<1||K>24||K>=p.N)throw runtime_error("free bits outside supported [1,24]");\n mt19937_64 rng(seed);int best=-1;uint64_t trials=0,bases=0,inconsistent=0;int forced_min=0;\n auto elapsed=[&](){return chrono::duration<double>(chrono::steady_clock::now()-start).count();};\n while(elapsed()<seconds){\n  vector<int>order(p.m);iota(order.begin(),order.end(),0);shuffle(order.begin(),order.end(),rng);\n  Echelon e(p.N,p.RW);int need=p.N-K,pos=0,forced=0;bool okay=true;\n  while(need>0){\n   int take=min(need,p.b/2+1);vector<pair<int,int>>eq;\n   if(take==1)eq.push_back({0,1});\n   else{eq.push_back({0,1});eq.push_back({p.b/2,1});for(int j=1;j<take-1;++j)eq.push_back({p.b/2+j,0});}\n   for(auto [coordinate,rhs]:eq)if(!e.add(p.row(order[pos],coordinate,rhs))){okay=false;break;}\n   if(take==p.b/2+1)++forced;need-=take;++pos;if(!okay)break;\n  }\n  ++bases;if(!okay){++inconsistent;continue;}\n  vector<int>free;for(int i=0;i<p.N;++i)if(e.piv[i].empty())free.push_back(i);\n  if((int)free.size()<K)throw runtime_error("too few free variables");\n  Bits part=e.solve(-1,false);vector<Bits>basis;for(int i=0;i<K;++i)basis.push_back(e.solve(free[i],true));\n  vector<int>v0=p.evaluate(part);vector<vector<int>>delta;for(const Bits&d:basis)delta.push_back(p.evaluate(d));\n  const int W=p.PW,C=(K+7)/8;Bits current(W);vector<Bits>linear(K,Bits(W));vector<vector<Bits>>pair(K,vector<Bits>(K,Bits(W)));\n  for(int y=0;y<p.m;++y){\n   int f0=p.target(y,v0[y]);if(f0)current[y/64]|=1ULL<<(y%64);\n   vector<int>f(K);for(int i=0;i<K;++i){f[i]=p.target(y,delta[i][y]);if(p.target(y,v0[y]^delta[i][y])^f0)linear[i][y/64]|=1ULL<<(y%64);}\n   for(int i=0;i<K;++i)for(int j=0;j<i;++j)if(p.target(y,delta[i][y]^delta[j][y])^f[i]^f[j]){pair[i][j][y/64]|=1ULL<<(y%64);pair[j][i][y/64]|=1ULL<<(y%64);}\n  }\n  vector<uint64_t>table((size_t)K*C*256*W);\n  for(int i=0;i<K;++i)for(int c=0;c<C;++c)for(int s=1;s<256;++s){int bit=__builtin_ctz((unsigned)s),prev=s&(s-1),j=c*8+bit;size_t off=((size_t)i*C+c)*256*W;\n   for(int w=0;w<W;++w)table[off+s*W+w]=table[off+prev*W+w]^(j<K?pair[i][j][w]:0);\n  }\n  auto record=[&](int score,uint32_t gray){\n   if(score<=best)return;Bits x=part;for(int i=0;i<K;++i)if(gray>>i&1)xor_into(x,basis[i]);\n   auto values=p.evaluate(x);int checked=0;for(int y=0;y<p.m;++y)checked+=p.target(y,values[y]);if(checked!=score)throw runtime_error("independent quadratic/Horner score mismatch");\n   best=score;forced_min=forced;auto c=p.coeffs(x);ofstream out(argv[4]);out<<"{\\"coeffs\\":[";for(int i=0;i<p.n;++i)out<<(i?",":"")<<c[i];out<<"]}\\n";out.close();\n   cerr<<"best="<<best<<" trials="<<trials<<" bases="<<bases<<" forced="<<forced<<" elapsed_s="<<elapsed()<<"\\n";\n  };\n  int score=0;for(uint64_t x:current)score+=__builtin_popcountll(x);++trials;record(score,0);\n  uint32_t gray=0;for(uint32_t step=1;step<(1U<<K);++step){\n   if((step&4095)==0&&elapsed()>=seconds)break;\n   int i=__builtin_ctz(step);score=0;size_t off=(size_t)i*C*256*W;\n   const uint64_t*t0=&table[off+(gray&255)*W];\n   const uint64_t*t1=C>1?&table[off+256*W+((gray>>8)&255)*W]:nullptr;\n   const uint64_t*t2=C>2?&table[off+512*W+((gray>>16)&255)*W]:nullptr;\n   for(int w=0;w<W;++w){current[w]^=linear[i][w]^t0[w]^(t1?t1[w]:0)^(t2?t2[w]:0);score+=__builtin_popcountll(current[w]);}\n   gray^=1U<<i;++trials;if(score>best)record(score,gray);\n  }\n  if(best==p.m)break;\n }\n cout<<"{\\"seed\\":"<<seed<<",\\"satisfied\\":"<<best<<",\\"candidates\\":"<<trials<<",\\"bases\\":"<<bases<<",\\"inconsistent_bases\\":"<<inconsistent<<",\\"free_bits\\":"<<K<<",\\"forced_points_of_best\\":"<<forced_min<<",\\"cpu_seconds\\":"<<double(clock()-cpu_start)/CLOCKS_PER_SEC<<",\\"elapsed_seconds\\":"<<elapsed()<<"}\\n";\n}\n'
FIXED_TRIAL_CPP='// Original Extended Prange attack with bit-sliced quadratic Gray enumeration.\n// Source for the XP affine subspaces: Khattar et al., arXiv:2510.10967,\n// Section III.2 (CC BY 4.0). No third-party implementation code is copied.\n// Copyright (c) 2026 this workspace\'s authors. MIT license; see LICENSE.\n#include <algorithm>\n#include <chrono>\n#include <cstdint>\n#include <ctime>\n#include <fstream>\n#include <iostream>\n#include <numeric>\n#include <random>\n#include <stdexcept>\n#include <string>\n#include <vector>\nusing namespace std;\nusing Bits=vector<uint64_t>;\n\nstruct Problem {\n int b,n,q,m,mod,N,RW,PW;\n vector<int> exp,log,H,power;\n explicit Problem(const string&path){\n  ifstream f(path);f>>b>>n>>mod;\n  if(!f||b<4||b>12||b%2||n<2||n>1024)throw runtime_error("bad header");\n  q=1<<b;m=q-1;N=n*b;RW=(N+1+63)/64;PW=(m+63)/64;\n  H.resize(m*b);for(int&h:H)f>>h;if(!f)throw runtime_error("bad matrix table");\n  exp.resize(2*m);log.assign(q,-1);int x=1;\n  for(int i=0;i<m;++i){if(log[x]>=0)throw runtime_error("nonprimitive modulus");exp[i]=x;log[x]=i;x<<=1;if(x&q)x^=mod;}\n  for(int i=0;i<m;++i)exp[i+m]=exp[i];\n  power.resize(m*n);for(int y=1;y<q;++y){int x=1;for(int j=0;j<n;++j){power[(y-1)*n+j]=x;x=mul(x,y);}}\n }\n int mul(int x,int y)const{return x&&y?exp[log[x]+log[y]]:0;}\n int target(int y,int value)const{int s=0;for(int j=0;j<b/2;++j)s^=(__builtin_parity((unsigned)(H[y*b+j]&value))&__builtin_parity((unsigned)(H[y*b+j+b/2]&value)));return s;}\n Bits row(int y,int coordinate,int rhs)const{\n  Bits r(RW);int h=H[y*b+coordinate];\n  for(int j=0;j<n;++j)for(int u=0;u<b;++u)if(__builtin_parity((unsigned)(h&mul(power[y*n+j],1<<u)))){int i=j*b+u;r[i/64]|=1ULL<<(i%64);}\n  if(rhs)r[N/64]|=1ULL<<(N%64);return r;\n }\n vector<int> coeffs(const Bits&x)const{vector<int>c(n);for(int j=0;j<n;++j)for(int u=0;u<b;++u){int i=j*b+u;if(x[i/64]>>(i%64)&1)c[j]|=1<<u;}return c;}\n vector<int> evaluate(const Bits&x)const{\n  vector<int>c=coeffs(x),v(m);for(int y=1;y<q;++y){int a=0;for(int j=n-1;j>=0;--j)a=mul(a,y)^c[j];v[y-1]=a;}return v;\n }\n};\n\nstatic void xor_into(Bits&a,const Bits&b){for(size_t w=0;w<a.size();++w)a[w]^=b[w];}\nstruct Echelon{\n int N,W,rank=0;vector<Bits> piv;\n Echelon(int n,int w):N(n),W(w),piv(n){}\n bool add(Bits r){\n  for(int i=0;i<N;++i)if(r[i/64]>>(i%64)&1){if(piv[i].empty()){piv[i]=move(r);++rank;return true;}for(int w=i/64;w<W;++w)r[w]^=piv[i][w];}\n  return !(r[N/64]>>(N%64)&1);\n }\n Bits solve(int freebit,bool homogeneous)const{\n  Bits x(W);if(freebit>=0)x[freebit/64]|=1ULL<<(freebit%64);\n  for(int i=N-1;i>=0;--i)if(!piv[i].empty()){\n   int v=homogeneous?0:(piv[i][N/64]>>(N%64)&1);\n   for(int w=i/64;w<W;++w)v^=__builtin_parityll(piv[i][w]&x[w]);\n   if(v)x[i/64]|=1ULL<<(i%64);\n  }return x;\n }\n};\n\nint main(int argc,char**argv){\n if(argc!=6){cerr<<"usage: binary_xp MATRIX.txt SEED SECONDS OUTPUT.json FREE_BITS\\n";return 2;}\n auto start=chrono::steady_clock::now();clock_t cpu_start=clock();\n Problem p(argv[1]);uint64_t seed=stoull(argv[2]);uint64_t replay_limit=stoull(argv[3]);int K=stoi(argv[5]);\n if(K<1||K>24||K>=p.N)throw runtime_error("free bits outside supported [1,24]");\n mt19937_64 rng(seed);int best=-1;uint64_t trials=0,bases=0,inconsistent=0;int forced_min=0;\n auto elapsed=[&](){return chrono::duration<double>(chrono::steady_clock::now()-start).count();};\n while(trials<replay_limit){\n  vector<int>order(p.m);iota(order.begin(),order.end(),0);shuffle(order.begin(),order.end(),rng);\n  Echelon e(p.N,p.RW);int need=p.N-K,pos=0,forced=0;bool okay=true;\n  while(need>0){\n   int take=min(need,p.b/2+1);vector<pair<int,int>>eq;\n   if(take==1)eq.push_back({0,1});\n   else{eq.push_back({0,1});eq.push_back({p.b/2,1});for(int j=1;j<take-1;++j)eq.push_back({p.b/2+j,0});}\n   for(auto [coordinate,rhs]:eq)if(!e.add(p.row(order[pos],coordinate,rhs))){okay=false;break;}\n   if(take==p.b/2+1)++forced;need-=take;++pos;if(!okay)break;\n  }\n  ++bases;if(!okay){++inconsistent;continue;}\n  vector<int>free;for(int i=0;i<p.N;++i)if(e.piv[i].empty())free.push_back(i);\n  if((int)free.size()<K)throw runtime_error("too few free variables");\n  Bits part=e.solve(-1,false);vector<Bits>basis;for(int i=0;i<K;++i)basis.push_back(e.solve(free[i],true));\n  vector<int>v0=p.evaluate(part);vector<vector<int>>delta;for(const Bits&d:basis)delta.push_back(p.evaluate(d));\n  const int W=p.PW,C=(K+7)/8;Bits current(W);vector<Bits>linear(K,Bits(W));vector<vector<Bits>>pair(K,vector<Bits>(K,Bits(W)));\n  for(int y=0;y<p.m;++y){\n   int f0=p.target(y,v0[y]);if(f0)current[y/64]|=1ULL<<(y%64);\n   vector<int>f(K);for(int i=0;i<K;++i){f[i]=p.target(y,delta[i][y]);if(p.target(y,v0[y]^delta[i][y])^f0)linear[i][y/64]|=1ULL<<(y%64);}\n   for(int i=0;i<K;++i)for(int j=0;j<i;++j)if(p.target(y,delta[i][y]^delta[j][y])^f[i]^f[j]){pair[i][j][y/64]|=1ULL<<(y%64);pair[j][i][y/64]|=1ULL<<(y%64);}\n  }\n  vector<uint64_t>table((size_t)K*C*256*W);\n  for(int i=0;i<K;++i)for(int c=0;c<C;++c)for(int s=1;s<256;++s){int bit=__builtin_ctz((unsigned)s),prev=s&(s-1),j=c*8+bit;size_t off=((size_t)i*C+c)*256*W;\n   for(int w=0;w<W;++w)table[off+s*W+w]=table[off+prev*W+w]^(j<K?pair[i][j][w]:0);\n  }\n  auto record=[&](int score,uint32_t gray){\n   if(score<=best)return;Bits x=part;for(int i=0;i<K;++i)if(gray>>i&1)xor_into(x,basis[i]);\n   auto values=p.evaluate(x);int checked=0;for(int y=0;y<p.m;++y)checked+=p.target(y,values[y]);if(checked!=score)throw runtime_error("independent quadratic/Horner score mismatch");\n   best=score;forced_min=forced;auto c=p.coeffs(x);ofstream out(argv[4]);out<<"{\\"coeffs\\":[";for(int i=0;i<p.n;++i)out<<(i?",":"")<<c[i];out<<"]}\\n";out.close();\n   cerr<<"best="<<best<<" trials="<<trials<<" bases="<<bases<<" forced="<<forced<<" elapsed_s="<<elapsed()<<"\\n";\n  };\n  int score=0;for(uint64_t x:current)score+=__builtin_popcountll(x);++trials;record(score,0);\n  uint32_t gray=0;for(uint32_t step=1;step<(1U<<K);++step){\n   if(trials>=replay_limit)break;\n   int i=__builtin_ctz(step);score=0;size_t off=(size_t)i*C*256*W;\n   const uint64_t*t0=&table[off+(gray&255)*W];\n   const uint64_t*t1=C>1?&table[off+256*W+((gray>>8)&255)*W]:nullptr;\n   const uint64_t*t2=C>2?&table[off+512*W+((gray>>16)&255)*W]:nullptr;\n   for(int w=0;w<W;++w){current[w]^=linear[i][w]^t0[w]^(t1?t1[w]:0)^(t2?t2[w]:0);score+=__builtin_popcountll(current[w]);}\n   gray^=1U<<i;++trials;if(score>best)record(score,gray);\n  }\n  if(best==p.m)break;\n }\n cout<<"{\\"seed\\":"<<seed<<",\\"satisfied\\":"<<best<<",\\"candidates\\":"<<trials<<",\\"bases\\":"<<bases<<",\\"inconsistent_bases\\":"<<inconsistent<<",\\"free_bits\\":"<<K<<",\\"forced_points_of_best\\":"<<forced_min<<",\\"cpu_seconds\\":"<<double(clock()-cpu_start)/CLOCKS_PER_SEC<<",\\"elapsed_seconds\\":"<<elapsed()<<"}\\n";\n}\n'

def main():
    if len(sys.argv)>1 and sys.argv[1]=='--metadata':
        print(json.dumps(RECIPE,indent=2))
        return
    output=Path(sys.argv[1] if len(sys.argv)>1 else 'candidate.json').resolve()
    output.parent.mkdir(parents=True,exist_ok=True)
    tmp_root=Path(os.environ.get('TMPDIR',str(Path.cwd()/'.opi_replay_tmp')))
    tmp_root.mkdir(parents=True,exist_ok=True)
    for name in ['OPENBLAS_NUM_THREADS','OMP_NUM_THREADS','MKL_NUM_THREADS']:
        os.environ[name]='1'
    with tempfile.TemporaryDirectory(prefix='opi-replay-',dir=tmp_root) as tmp:
        work=Path(tmp)
        (work/'search.cpp').write_text(FIXED_TRIAL_CPP)
        table=work/'targets.txt'
        with table.open('w') as f:
            if INSTANCE['field']=='prime':
                f.write(f"{INSTANCE['q']} {INSTANCE['n']}\n")
                for mask in INSTANCE['targets']:
                    bits=int(mask,16)
                    values=[v for v in range(INSTANCE['q']) if bits>>v&1]
                    f.write(str(len(values))+' '+' '.join(map(str,values))+'\n')
            else:
                f.write(f"{INSTANCE['b']} {INSTANCE['n']} {INSTANCE['modulus']}\n")
                for rows in INSTANCE['matrices']:
                    f.write(' '.join(map(str,rows))+'\n')
        compiler=shutil.which('g++')
        if not compiler:
            raise RuntimeError('g++ with C++17 support is required')
        subprocess.run([compiler,'-std=c++17','-O3','-march=native',str(work/'search.cpp'),'-o',str(work/'search')],check=True)
        print(json.dumps({'recipe':RECIPE,'compiler':subprocess.check_output([compiler,'--version'],text=True).splitlines()[0]}),flush=True)
        subprocess.run([str(work/'search'),str(table),str(RECIPE['seed']),str(RECIPE['replay_count']),str(output),RECIPE['tail_argument']],check=True)
    observed=hashlib.sha256(output.read_bytes()).hexdigest()
    if observed!=RECIPE['expected_artifact_sha256']:
        raise RuntimeError(f"Replay hash differs: expected {RECIPE['expected_artifact_sha256']}, got {observed}. Check libstdc++ std::shuffle/compiler version.")
    print(json.dumps({'output':str(output),'sha256':observed,'reproduced':True}))

if __name__=='__main__':
    main()