P18223 [HackerEarth] Gazu succeeded in finding the correct the bulb positions in “Power House” now he is with the teacher. When the field trip got over teacher gathered all the students in the hall and was a
普及
题目描述

Gazu succeeded in finding the correct the bulb positions in “Power House” now he is with the teacher. When the field trip got over teacher gathered all the students in the hall and was about to leave when she found the one and only exit door of the power house was sealed shut. Adjacent to the door there was a 8192x8192 grid of ON-OFF switches with a audio tape labelled as ‘play me’. They played that tape and the message in it was

‘Hello my students I am curator of the power house and I want to play a game, in front of you there is a grid of switches labelled from 0 to (81928192)-1, there is a special switch in this grid which when toggled will open the seal of the exit door. Behind the board there is an envelope hidden, inside it index of the special switch is written. Rules of my game are, you have to divide yourself into two groups, only first group will open the envelope and is allowed to toggle any 1 switch from the grid. Second group can not see first group during this time. Now the second group students will come and will deduce index of the special switch from the resulting grid. If the second group toggles the wrong switch, the seal will become permanent and this house will become your tomb. Remember I am watching you. Make your choice’*

Gazu helped students to solve this problem, he made a solution. The students then got divided and Gazu was in group 1 after their job was over. Group 2 students came but unfortunately all of them forgot the solution only thing they remember was ‘choose OFF state’. So all the group 2 asks you for help.

Input
First line contains number of testcases 1<T<100, for each testcase you will be given index of the switches which were in OFF state after group 1 completed their job. These indices are space separated and terminated by -1

Output
One line containing the index of the special switch.

SAMPLE INPUT
3
3 7 20 37 61 -1
6 9 69 -1
5 23 54 81 90 -1

SAMPLE OUTPUT
8
74
47

输入格式

见题面

输出格式

见题面

样例输入
50 298 1134 268 1159 452 81 258 1076 925 667 452 428 796 231 337 558 548 542 960 1099 598 1179 318 438 248 574 7 555 613 1029 330 786 613 840 1080 1123 1183 1059 1197 59 92 -1 563 864 253 759 1187 1042 160 1000 269 915 798 1047 330 568 137 474 496 672 884 1132 1126 245 947 1019 633 320 966 1156 926 674 928 731 856 512 -1 48 189 238 1042 798 692 720 1094 262 561 573 945 412 596 1109 437 -1 463 148 299 959 951 679 80 154 1181 1199 623 264 1133 1059 96 56 854 427 34 346 331 187 964 815 825 700 523 173 11 513 815 695 811 1000 1014 716 458 79 69 223 689 618 916 168 264 882 241 1161 919 -1 88 547 331 843 882 713 -1 238 892 1141 13 125 394 906 899 -1 650 379 1081 97 333 378 259 460 516 691 626 117 24 217 936 598 1133 1137 172 440 279 350 208 650 958 301 113 272 478 562 607 734 1042 434 1053 197 1073 83 555 188 185 816 995 851 828 66 576 -1 1176 588 902 524 220 1029 190 41 200 1131 1024 643 131 694 598 896 435 666 542 866 1081 818 529 612 58 25 786 837 965 394 569 1108 370 268 976 61 360 -1 925 1186 610 681 226 14 514 13 -1 230 55 428 84 753 875 447 1116 745 1120 597 617 146 476 507 25 955 178 377 148 707 883 217 231 1006 229 1197 175 120 915 1185 137 -1 405 671 119 457 1041 882 342 1141 226 413 174 -1 296 892 777 355 240 315 744 1079 470 -1 770 725 536 625 190 585 780 585 948 48 629 906 527 1043 386 515 613 0 616 983 714 576 1153 549 177 676 212 714 293 817 727 837 999 974 -1 75 233 395 455 573 507 404 623 487 819 358 550 490 594 754 106 1084 533 496 976 30 697 1125 423 206 1027 216 560 366 622 961 366 325 1094 19 1179 357 613 605 124 93 412 779 -1 1199 101 882 1057 260 790 203 1179 335 697 1055 752 687 745 229 697 601 399 135 546 982 510 492 753 697 252 354 1012 68 194 905 265 1082 470 600 308 -1 423 554 381 880 152 521 184 854 289 335 729 159 1042 216 791 22 745 364 1104 865 294 1163 -1 1059 685 1194 200 132 588 1101 75 1102 398 469 587 1161 463 1020 117 633 497 767 680 502 350 1132 739 1085 639 683 720 949 1196 81 1169 1076 -1 355 521 83 32 585 287 815 388 1187 271 194 1046 592 865 1186 914 1020 94 312 140 185 976 643 231 850 89 189 38 1036 791 830 209 62 -1 993 1099 355 983 596 337 637 96 307 1173 748 548 103 988 975 884 283 420 554 997 0 667 825 788 305 684 1092 744 1161 1003 611 871 964 866 660 283 884 557 810 790 1045 436 840 532 -1 902 239 321 1193 46 853 410 396 225 759 392 1066 117 688 698 814 297 1017 242 214 1072 787 948 214 895 483 474 734 42 830 -1 634 378 1110 269 936 498 675 232 63 1058 725 237 1022 75 872 -1 323 995 393 1185 413 1004 1097 121 756 1105 928 931 551 224 83 64 726 238 441 625 722 71 1051 294 673 517 522 620 375 580 533 695 65 275 171 28 643 1101 525 418 645 -1 936 873 921 798 242 236 944 475 914 1075 174 150 853 637 59 1028 239 332 507 409 463 1105 1008 480 774 -1 1071 92 648 872 545 592 691 837 218 1068 689 758 975 153 329 1006 99 776 395 947 51 581 155 1093 852 594 301 221 825 257 50 242 377 257 50 257 592 -1 571 126 964 290 312 886 539 272 645 327 187 834 962 1122 19 673 7 352 920 1014 119 307 82 927 -1 974 1193 964 418 328 313 762 37 1068 766 439 176 724 220 999 783 312 477 271 117 706 657 672 555 -1 577 943 871 604 -1 674 1104 550 231 333 720 914 743 845 316 520 175 213 849 953 1002 8 415 264 1089 550 1194 1017 295 410 718 729 134 67 147 831 728 1090 929 337 1019 403 -1 761 175 176 518 201 97 658 178 796 669 41 972 480 191 686 201 1089 1163 263 904 584 719 1163 1043 84 917 902 692 -1 701 767 1082 388 538 329 315 423 683 647 779 1158 637 243 110 -1 271 384 955 66 455 702 979 744 307 959 800 707 179 408 496 80 837 873 1108 427 560 945 500 1194 133 1132 246 1118 418 862 478 821 394 132 312 66 98 809 900 97 460 470 130 821 345 174 830 341 -1 585 1197 1159 665 639 -1 651 599 56 744 604 197 17 1044 482 710 274 903 827 484 398 1014 459 49 666 1184 1058 513 401 1078 589 55 1191 684 303 14 61 -1 225 345 580 716 952 748 630 135 871 1084 737 65 724 836 117 191 111 1067 801 626 592 1010 265 79 496 -1 426 1178 28 1029 129 500 1141 387 921 872 747 17 1091 1072 859 533 939 445 1014 412 792 727 724 784 548 1089 1113 532 973 97 167 994 220 559 676 1000 -1 236 254 253 77 404 1180 682 161 263 678 183 246 228 296 803 846 775 67 889 171 -1 820 303 39 85 793 640 883 818 673 1117 702 558 1044 191 136 505 323 385 104 1139 721 315 1115 606 418 961 270 711 34 1118 1182 454 58 -1 45 1123 1134 293 1112 1052 587 766 1095 1109 1055 994 1108 479 329 300 688 124 1075 458 1154 514 1036 975 897 734 651 1191 148 826 481 96 1176 978 575 -1 1026 964 1096 1 342 247 760 940 552 1069 1157 69 848 299 324 587 323 1160 1087 963 127 868 438 77 791 732 260 599 288 11 963 1008 331 499 1058 1040 549 860 1158 423 -1 860 847 931 993 504 445 661 837 857 914 1078 64 499 473 326 317 306 -1 1014 605 806 338 423 249 208 176 770 586 125 177 281 630 707 1151 189 699 698 245 -1 897 1197 46 768 779 961 1166 236 687 197 167 694 822 1066 37 980 1126 420 1131 271 894 210 338 508 -1 779 430 349 646 570 1188 1161 591 507 249 154 218 918 1053 757 213 1020 424 496 -1 527 259 479 392 599 714 927 616 338 160 1174 83 380 660 714 682 927 738 882 1159 492 1005 1146 291 523 764 987 294 303 483 202 352 974 996 863 1063 720 629 554 -1 294 355 1137 454 157 791 252 95 738 952 341 929 696 242 794 47 855 629 837 252 1080 1105 -1 736 223 368 366 477 1096 756 696 770 613 596 900 976 262 1089 731 204 826 -1 442 212 70 62 144 742 148 400 202 557 157 857 370 396 441 992 531 256 150 624 801 674 1096 618 582 714 992 1193 1183 938 1008 938 505 -1 1038 747 1110 127 327 1091 628 802 950 1187 832 46 -1 11 119 1146 611 336 1181 968 1094 685 -1 988 947 391 577 1025 -1
样例输出
15445 3013 6692 10730 5327 10496 7836 4830 7151 14626 14200 9703 10008 11989 9310 3653 13324 6794 7708 6393 12655 8517 5466 14348 7860 15139 4606 14313 10841 11559 7607 14878 1621 5178 8526 3621 6939 1313 11320 42 15048 14667 12723 11602 8844 14392 12099 3272 3346 3886 15930 5056 5358 3368 1380 2796 9590 1581 1986 9741 16069 8258 14710 14174 3333 2191 14288 6130 6229 3207 14426 231 14295 7277 6050 15860 6256 2348 13431 11300 2946 5571 2349 8153 6763 1063 12307 8275 14157 3688 2920 8447 13135 11724 9567 9513 14946 7938 8228