/****************************************************************************** * * * PRIME LOOK-UP TABLE * * 03/21/16 (dkc) * * * * This table consists of primes of the form p*k+1 for p=3. * * * ******************************************************************************/ unsigned int table3[4784]={ 7, 13, 19, 31, 37, 43, 61, 67, 73, 79, 97, 103, 109, 127, 139, 151, 157, 163, 181, 193, 199, 211, 223, 229, 241, 271, 277, 283, 307, 313, 331, 337, 349, 367, 373, 379, 397, 409, 421, 433, 439, 457, 463, 487, 499, 523, 541, 547, 571, 577, 601, 607, 613, 619, 631, 643, 661, 673, 691, 709, 727, 733, 739, 751, 757, 769, 787, 811, 823, 829, 853, 859, 877, 883, 907, 919, 937, 967, 991, 997, 1009, 1021, 1033, 1039, 1051, 1063, 1069, 1087, 1093, 1117, 1123, 1129, 1153, 1171, 1201, 1213, 1231, 1237, 1249, 1279, 1291, 1297, 1303, 1321, 1327, 1381, 1399, 1423, 1429, 1447, 1453, 1459, 1471, 1483, 1489, 1531, 1543, 1549, 1567, 1579, 1597, 1609, 1621, 1627, 1657, 1663, 1669, 1693, 1699, 1723, 1741, 1747, 1753, 1759, 1777, 1783, 1789, 1801, 1831, 1861, 1867, 1873, 1879, 1933, 1951, 1987, 1993, 1999, 2011, 2017, 2029, 2053, 2083, 2089, 2113, 2131, 2137, 2143, 2161, 2179, 2203, 2221, 2239, 2251, 2269, 2281, 2287, 2293, 2311, 2341, 2347, 2371, 2377, 2383, 2389, 2437, 2467, 2473, 2503, 2521, 2539, 2551, 2557, 2593, 2617, 2647, 2659, 2671, 2677, 2683, 2689, 2707, 2713, 2719, 2731, 2749, 2767, 2791, 2797, 2803, 2833, 2851, 2857, 2887, 2917, 2953, 2971, 3001, 3019, 3037, 3049, 3061, 3067, 3079, 3109, 3121, 3163, 3169, 3181, 3187, 3217, 3229, 3253, 3259, 3271, 3301, 3307, 3313, 3319, 3331, 3343, 3361, 3373, 3391, 3433, 3457, 3463, 3469, 3499, 3511, 3517, 3529, 3541, 3547, 3559, 3571, 3583, 3607, 3613, 3631, 3637, 3643, 3673, 3691, 3697, 3709, 3727, 3733, 3739, 3769, 3793, 3823, 3847, 3853, 3877, 3889, 3907, 3919, 3931, 3943, 3967, 4003, 4021, 4027, 4051, 4057, 4093, 4099, 4111, 4129, 4153, 4159, 4177, 4201, 4219, 4231, 4243, 4261, 4273, 4297, 4327, 4339, 4357, 4363, 4423, 4441, 4447, 4483, 4507, 4513, 4519, 4549, 4561, 4567, 4591, 4597, 4603, 4621, 4639, 4651, 4657, 4663, 4723, 4729, 4759, 4783, 4789, 4801, 4813, 4831, 4861, 4903, 4909, 4933, 4951, 4957, 4969, 4987, 4993, 4999, 5011, 5023, 5059, 5077, 5101, 5107, 5113, 5119, 5167, 5179, 5197, 5209, 5227, 5233, 5281, 5323, 5347, 5407, 5413, 5419, 5431, 5437, 5443, 5449, 5479, 5503, 5521, 5527, 5557, 5563, 5569, 5581, 5623, 5641, 5647, 5653, 5659, 5683, 5689, 5701, 5737, 5743, 5749, 5779, 5791, 5821, 5827, 5839, 5851, 5857, 5869, 5881, 5923, 5953, 6007, 6037, 6043, 6067, 6073, 6079, 6091, 6121, 6133, 6151, 6163, 6199, 6211, 6217, 6229, 6247, 6271, 6277, 6301, 6337, 6343, 6361, 6367, 6373, 6379, 6397, 6421, 6427, 6451, 6469, 6481, 6529, 6547, 6553, 6571, 6577, 6607, 6619, 6637, 6661, 6673, 6679, 6691, 6703, 6709, 6733, 6763, 6781, 6793, 6823, 6829, 6841, 6871, 6883, 6907, 6949, 6961, 6967, 6991, 6997, 7027, 7039, 7057, 7069, 7129, 7159, 7177, 7207, 7213, 7219, 7237, 7243, 7297, 7309, 7321, 7333, 7351, 7369, 7393, 7411, 7417, 7459, 7477, 7489, 7507, 7537, 7549, 7561, 7573, 7591, 7603, 7621, 7639, 7669, 7681, 7687, 7699, 7717, 7723, 7741, 7753, 7759, 7789, 7867, 7873, 7879, 7927, 7933, 7951, 7963, 7993, 8011, 8017, 8053, 8059, 8089, 8101, 8161, 8167, 8179, 8191, 8209, 8221, 8233, 8263, 8269, 8287, 8293, 8311, 8317, 8329, 8353, 8377, 8389, 8419, 8431, 8443, 8461, 8467, 8521, 8527, 8539, 8563, 8581, 8599, 8623, 8629, 8641, 8647, 8677, 8689, 8707, 8713, 8719, 8731, 8737, 8761, 8779, 8803, 8821, 8839, 8863, 8887, 8893, 8923, 8929, 8941, 8971, 9001, 9007, 9013, 9043, 9049, 9067, 9091, 9103, 9109, 9127, 9133, 9151, 9157, 9181, 9187, 9199, 9241, 9277, 9283, 9319, 9337, 9343, 9349, 9391, 9397, 9403, 9421, 9433, 9439, 9463, 9511, 9547, 9601, 9613, 9619, 9631, 9643, 9649, 9661, 9679, 9697, 9721, 9733, 9739, 9769, 9781, 9787, 9811, 9817, 9829, 9859, 9871, 9883, 9901, 9907, 9931, 9949, 9967, 9973, 10009, 10039, 10069, 10093, 10099, 10111, 10141, 10159, 10177, 10243, 10267, 10273, 10303, 10321, 10333, 10357, 10369, 10399, 10429, 10453, 10459, 10477, 10501, 10513, 10531, 10567, 10597, 10627, 10639, 10651, 10657, 10663, 10687, 10711, 10723, 10729, 10753, 10771, 10789, 10831, 10837, 10861, 10867, 10891, 10903, 10909, 10939, 10957, 10987, 10993, 11047, 11059, 11071, 11083, 11113, 11119, 11131, 11149, 11161, 11173, 11197, 11239, 11251, 11257, 11287, 11299, 11311, 11317, 11329, 11353, 11383, 11437, 11443, 11467, 11491, 11497, 11503, 11527, 11551, 11587, 11593, 11617, 11677, 11689, 11701, 11719, 11731, 11743, 11779, 11821, 11827, 11833, 11839, 11863, 11887, 11923, 11941, 11953, 11959, 11971, 12007, 12037, 12043, 12049, 12073, 12097, 12109, 12157, 12163, 12211, 12241, 12253, 12277, 12289, 12301, 12343, 12373, 12379, 12391, 12409, 12421, 12433, 12451, 12457, 12487, 12511, 12517, 12541, 12547, 12553, 12577, 12583, 12589, 12601, 12613, 12619, 12637, 12697, 12703, 12721, 12739, 12757, 12763, 12781, 12799, 12823, 12829, 12841, 12853, 12889, 12907, 12919, 12967, 12973, 12979, 13003, 13009, 13033, 13063, 13093, 13099, 13147, 13159, 13171, 13177, 13183, 13219, 13249, 13267, 13291, 13297, 13309, 13327, 13339, 13381, 13399, 13411, 13417, 13441, 13477, 13513, 13537, 13567, 13591, 13597, 13627, 13633, 13669, 13681, 13687, 13693, 13711, 13723, 13729, 13759, 13789, 13807, 13831, 13873, 13879, 13903, 13921, 13933, 13963, 13999, 14011, 14029, 14071, 14083, 14107, 14143, 14149, 14173, 14197, 14221, 14251, 14281, 14293, 14323, 14341, 14347, 14389, 14401, 14407, 14419, 14431, 14437, 14449, 14461, 14479, 14503, 14533, 14551, 14557, 14563, 14593, 14629, 14653, 14683, 14713, 14731, 14737, 14767, 14779, 14797, 14821, 14827, 14851, 14869, 14887, 14923, 14929, 14947, 14983, 15013, 15031, 15061, 15073, 15091, 15121, 15139, 15187, 15193, 15199, 15217, 15241, 15259, 15271, 15277, 15289, 15307, 15313, 15319, 15331, 15349, 15361, 15373, 15391, 15427, 15439, 15451, 15493, 15511, 15541, 15559, 15583, 15601, 15607, 15619, 15643, 15649, 15661, 15667, 15679, 15727, 15733, 15739, 15787, 15817, 15823, 15859, 15877, 15889, 15901, 15907, 15913, 15919, 15937, 15973, 15991, 16033, 16057, 16063, 16069, 16087, 16111, 16141, 16183, 16189, 16231, 16249, 16267, 16273, 16333, 16339, 16363, 16369, 16381, 16411, 16417, 16447, 16453, 16477, 16519, 16561, 16567, 16573, 16603, 16633, 16651, 16657, 16693, 16699, 16729, 16741, 16747, 16759, 16831, 16843, 16879, 16903, 16921, 16927, 16963, 16981, 16987, 16993, 17011, 17029, 17041, 17047, 17053, 17077, 17107, 17137, 17167, 17191, 17203, 17209, 17239, 17257, 17293, 17299, 17317, 17341, 17359, 17377, 17383, 17389, 17401, 17419, 17431, 17443, 17449, 17467, 17491, 17497, 17509, 17539, 17551, 17569, 17581, 17599, 17623, 17659, 17683, 17707, 17713, 17737, 17749, 17761, 17791, 17827, 17839, 17851, 17863, 17881, 17911, 17923, 17929, 17959, 17971, 17977, 17989, 18013, 18043, 18049, 18061, 18097, 18121, 18127, 18133, 18169, 18181, 18199, 18211, 18217, 18223, 18229, 18253, 18289, 18301, 18307, 18313, 18367, 18379, 18397, 18427, 18433, 18439, 18451, 18457, 18481, 18493, 18517, 18523, 18541, 18553, 18583, 18637, 18661, 18679, 18691, 18757, 18787, 18793, 18859, 18913, 18919, 18973, 18979, 19009, 19051, 19069, 19081, 19087, 19141, 19183, 19207, 19213, 19219, 19231, 19237, 19249, 19267, 19273, 19309, 19333, 19381, 19387, 19417, 19423, 19429, 19441, 19447, 19471, 19477, 19483, 19489, 19501, 19507, 19531, 19543, 19597, 19603, 19609, 19681, 19687, 19699, 19717, 19753, 19759, 19777, 19801, 19813, 19819, 19843, 19861, 19867, 19891, 19927, 19963, 19993, 20011, 20023, 20029, 20047, 20071, 20089, 20101, 20107, 20113, 20143, 20149, 20161, 20173, 20233, 20269, 20287, 20323, 20341, 20347, 20353, 20359, 20389, 20407, 20431, 20443, 20479, 20509, 20521, 20533, 20551, 20563, 20593, 20599, 20611, 20641, 20707, 20719, 20731, 20743, 20749, 20773, 20809, 20857, 20887, 20899, 20929, 20947, 20959, 20983, 21001, 21013, 21019, 21031, 21061, 21067, 21121, 21139, 21157, 21163, 21169, 21187, 21193, 21211, 21247, 21277, 21283, 21313, 21319, 21379, 21391, 21397, 21433, 21481, 21487, 21493, 21499, 21517, 21523, 21529, 21559, 21577, 21589, 21601, 21613, 21649, 21661, 21673, 21727, 21739, 21751, 21757, 21787, 21799, 21817, 21841, 21859, 21871, 21937, 21943, 21961, 21991, 21997, 22003, 22027, 22039, 22051, 22063, 22093, 22111, 22123, 22129, 22147, 22153, 22159, 22171, 22189, 22273, 22279, 22291, 22303, 22369, 22381, 22441, 22447, 22453, 22483, 22501, 22531, 22543, 22549, 22567, 22573, 22621, 22639, 22651, 22669, 22699, 22717, 22741, 22777, 22783, 22807, 22861, 22921, 22963, 22993, 23011, 23017, 23029, 23041, 23053, 23059, 23071, 23131, 23143, 23167, 23173, 23197, 23203, 23209, 23227, 23251, 23269, 23293, 23311, 23371, 23431, 23473, 23497, 23509, 23539, 23557, 23563, 23581, 23593, 23599, 23623, 23629, 23671, 23677, 23689, 23719, 23743, 23761, 23767, 23773, 23827, 23833, 23857, 23869, 23887, 23893, 23899, 23911, 23917, 23929, 23971, 23977, 24001, 24007, 24019, 24043, 24049, 24061, 24091, 24097, 24103, 24109, 24121, 24133, 24151, 24169, 24181, 24223, 24229, 24247, 24337, 24373, 24379, 24391, 24421, 24439, 24469, 24481, 24499, 24517, 24547, 24571, 24631, 24691, 24697, 24709, 24733, 24763, 24781, 24793, 24799, 24841, 24847, 24859, 24877, 24889, 24907, 24919, 24943, 24967, 24979, 25033, 25057, 25087, 25111, 25117, 25147, 25153, 25171, 25183, 25189, 25219, 25237, 25243, 25261, 25303, 25309, 25321, 25339, 25357, 25411, 25423, 25447, 25453, 25471, 25537, 25561, 25579, 25603, 25609, 25621, 25633, 25639, 25657, 25693, 25717, 25741, 25747, 25759, 25771, 25801, 25819, 25849, 25867, 25873, 25903, 25933, 25939, 25951, 25969, 25981, 25999, 26017, 26029, 26041, 26053, 26083, 26107, 26113, 26119, 26161, 26203, 26209, 26227, 26251, 26263, 26293, 26317, 26347, 26371, 26407, 26431, 26437, 26449, 26479, 26497, 26539, 26557, 26641, 26647, 26683, 26701, 26713, 26731, 26737, 26821, 26833, 26839, 26863, 26881, 26893, 26947, 26953, 26959, 27031, 27043, 27061, 27067, 27073, 27091, 27103, 27109, 27127, 27211, 27241, 27253, 27259, 27271, 27277, 27283, 27337, 27361, 27367, 27397, 27409, 27427, 27457, 27481, 27487, 27529, 27541, 27583, 27631, 27673, 27691, 27697, 27733, 27739, 27751, 27763, 27793, 27799, 27817, 27823, 27847, 27883, 27901, 27919, 27943, 27961, 27967, 27997, 28027, 28051, 28057, 28069, 28081, 28087, 28099, 28111, 28123, 28183, 28201, 28219, 28279, 28297, 28309, 28351, 28387, 28393, 28411, 28429, 28447, 28477, 28513, 28537, 28549, 28573, 28579, 28591, 28597, 28603, 28621, 28627, 28657, 28663, 28669, 28687, 28711, 28723, 28729, 28753, 28759, 28771, 28789, 28807, 28813, 28837, 28843, 28867, 28879, 28909, 28921, 28927, 28933, 29017, 29023, 29059, 29077, 29101, 29131, 29137, 29167, 29173, 29179, 29191, 29209, 29221, 29251, 29269, 29287, 29311, 29347, 29383, 29389, 29401, 29437, 29443, 29473, 29527, 29569, 29581, 29587, 29599, 29611, 29629, 29641, 29671, 29683, 29761, 29803, 29833, 29851, 29863, 29881, 29917, 29947, 29959, 29983, 29989, 30013, 30091, 30097, 30103, 30109, 30133, 30139, 30169, 30181, 30187, 30211, 30223, 30241, 30253, 30259, 30271, 30307, 30313, 30319, 30367, 30391, 30403, 30427, 30469, 30493, 30517, 30529, 30553, 30559, 30577, 30631, 30637, 30643, 30649, 30661, 30697, 30703, 30727, 30757, 30763, 30781, 30817, 30829, 30841, 30853, 30859, 30871, 30931, 30937, 30949, 31033, 31039, 31051, 31063, 31069, 31081, 31123, 31147, 31153, 31159, 31177, 31183, 31189, 31219, 31231, 31237, 31249, 31267, 31321, 31327, 31333, 31357, 31387, 31393, 31477, 31489, 31513, 31531, 31543, 31567, 31573, 31627, 31657, 31663, 31687, 31699, 31723, 31729, 31741, 31771, 31849, 31873, 31891, 31957, 31963, 31981, 32029, 32059, 32077, 32083, 32089, 32119, 32143, 32173, 32191, 32203, 32233, 32251, 32257, 32299, 32323, 32341, 32353, 32359, 32371, 32377, 32401, 32413, 32443, 32467, 32479, 32491, 32497, 32503, 32533, 32563, 32569, 32587, 32611, 32647, 32653, 32707, 32713, 32719, 32749, 32779, 32797, 32803, 32833, 32839, 32869, 32887, 32911, 32917, 32941, 32971, 32983, 33013, 33037, 33049, 33073, 33091, 33151, 33181, 33199, 33211, 33223, 33247, 33289, 33301, 33331, 33343, 33349, 33391, 33403, 33409, 33427, 33457, 33469, 33487, 33493, 33529, 33547, 33577, 33589, 33601, 33613, 33619, 33637, 33679, 33703, 33721, 33739, 33751, 33757, 33769, 33811, 33829, 33871, 33889, 33931, 33937, 33961, 33967, 33997, 34033, 34039, 34057, 34123, 34129, 34141, 34147, 34159, 34171, 34183, 34213, 34231, 34261, 34267, 34273, 34297, 34303, 34327, 34351, 34369, 34381, 34429, 34471, 34483, 34501, 34513, 34519, 34537, 34543, 34549, 34591, 34603, 34651, 34687, 34693, 34729, 34747, 34759, 34807, 34819, 34843, 34849, 34897, 34939, 34963, 34981, 35023, 35053, 35059, 35083, 35089, 35107, 35149, 35221, 35227, 35251, 35257, 35281, 35311, 35317, 35323, 35353, 35401, 35407, 35419, 35437, 35449, 35461, 35491, 35509, 35521, 35527, 35533, 35569, 35593, 35617, 35671, 35677, 35731, 35797, 35803, 35809, 35839, 35851, 35863, 35869, 35899, 35911, 35923, 35977, 35983, 36007, 36013, 36037, 36061, 36067, 36073, 36097, 36109, 36151, 36187, 36217, 36229, 36241, 36277, 36307, 36313, 36319, 36343, 36373, 36433, 36451, 36457, 36469, 36493, 36523, 36529, 36541, 36559, 36571, 36583, 36607, 36637, 36643, 36691, 36697, 36709, 36721, 36739, 36781, 36787, 36793, 36847, 36871, 36877, 36901, 36913, 36919, 36931, 36943, 36973, 36979, 36997, 37003, 37021, 37039, 37057, 37087, 37117, 37123, 37159, 37171, 37189, 37201, 37243, 37273, 37309, 37321, 37339, 37357, 37363, 37369, 37423, 37441, 37447, 37483, 37489, 37501, 37507, 37537, 37549, 37561, 37567, 37573, 37579, 37591, 37633, 37657, 37663, 37693, 37699, 37717, 37747, 37783, 37813, 37831, 37861, 37879, 37897, 37951, 37957, 37963, 37987, 37993, 38011, 38047, 38053, 38083, 38113, 38119, 38149, 38167, 38197, 38239, 38281, 38287, 38299, 38317, 38329, 38371, 38377, 38431, 38449, 38461, 38557, 38569, 38593, 38611, 38629, 38653, 38671, 38677, 38707, 38713, 38737, 38749, 38767, 38791, 38803, 38821, 38833, 38839, 38851, 38917, 38923, 38953, 38959, 38971, 38977, 39019, 39043, 39079, 39097, 39103, 39133, 39139, 39157, 39163, 39181, 39199, 39217, 39229, 39241, 39301, 39313, 39343, 39367, 39373, 39397, 39409, 39439, 39451, 39499, 39511, 39541, 39607, 39619, 39631, 39667, 39679, 39703, 39709, 39727, 39733, 39769, 39799, 39829, 39841, 39847, 39877, 39883, 39901, 39937, 39979, 40009, 40039, 40063, 40087, 40093, 40099, 40111, 40123, 40129, 40153, 40177, 40189, 40213, 40231, 40237, 40351, 40357, 40387, 40423, 40429, 40459, 40471, 40483, 40507, 40519, 40531, 40543, 40591, 40597, 40609, 40627, 40639, 40693, 40699, 40759, 40771, 40801, 40813, 40819, 40849, 40867, 40879, 40897, 40903, 40927, 40933, 40939, 40993, 41011, 41017, 41023, 41047, 41077, 41113, 41131, 41143, 41149, 41161, 41179, 41203, 41221, 41227, 41233, 41257, 41263, 41269, 41281, 41299, 41341, 41389, 41413, 41443, 41467, 41479, 41491, 41521, 41539, 41593, 41611, 41617, 41641, 41647, 41659, 41719, 41737, 41761, 41809, 41851, 41863, 41887, 41893, 41911, 41941, 41947, 41953, 41959, 41983, 42013, 42019, 42043, 42061, 42073, 42139, 42157, 42169, 42181, 42187, 42193, 42223, 42283, 42307, 42331, 42337, 42349, 42373, 42379, 42391, 42397, 42403, 42409, 42433, 42451, 42457, 42463, 42487, 42499, 42571, 42577, 42589, 42643, 42649, 42667, 42697, 42703, 42709, 42727, 42751, 42787, 42793, 42829, 42841, 42853, 42859, 42901, 42937, 42943, 42961, 42967, 42979, 43003, 43051, 43063, 43093, 43117, 43159, 43177, 43189, 43201, 43207, 43237, 43261, 43291, 43321, 43399, 43411, 43441, 43543, 43573, 43579, 43591, 43597, 43609, 43627, 43633, 43651, 43669, 43711, 43717, 43753, 43759, 43777, 43783, 43789, 43801, 43867, 43891, 43933, 43951, 43963, 43969, 43987, 44017, 44029, 44041, 44053, 44059, 44071, 44089, 44101, 44119, 44131, 44179, 44203, 44221, 44257, 44263, 44269, 44281, 44293, 44371, 44383, 44389, 44449, 44491, 44497, 44533, 44563, 44587, 44617, 44623, 44641, 44647, 44683, 44701, 44773, 44797, 44809, 44839, 44851, 44887, 44893, 44917, 44953, 44959, 44971, 44983, 45007, 45013, 45061, 45121, 45127, 45139, 45181, 45247, 45259, 45289, 45307, 45319, 45337, 45343, 45361, 45403, 45427, 45433, 45439, 45481, 45523, 45541, 45553, 45589, 45613, 45631, 45667, 45673, 45691, 45697, 45751, 45757, 45763, 45817, 45823, 45841, 45853, 45943, 45949, 45979, 46021, 46027, 46051, 46093, 46099, 46141, 46147, 46153, 46171, 46183, 46219, 46237, 46261, 46273, 46279, 46309, 46327, 46351, 46381, 46399, 46411, 46441, 46447, 46471, 46477, 46489, 46507, 46549, 46567, 46573, 46591, 46633, 46639, 46663, 46681, 46687, 46723, 46747, 46771, 46807, 46819, 46831, 46861, 46867, 46933, 46957, 46993, 47017, 47041, 47059, 47119, 47137, 47143, 47149, 47161, 47221, 47251, 47269, 47287, 47293, 47317, 47353, 47389, 47407, 47419, 47431, 47491, 47497, 47521, 47527, 47533, 47563, 47569, 47581, 47599, 47623, 47629, 47653, 47659, 47701, 47713, 47737, 47743, 47779, 47791, 47797, 47809, 47857, 47869, 47881, 47911, 47917, 47947, 47977, 48049, 48073, 48079, 48091, 48109, 48121, 48157, 48163, 48187, 48193, 48247, 48259, 48271, 48313, 48337, 48397, 48409, 48463, 48481, 48487, 48523, 48541, 48571, 48589, 48619, 48649, 48661, 48673, 48679, 48733, 48751, 48757, 48781, 48787, 48799, 48817, 48823, 48847, 48859, 48871, 48883, 48889, 48907, 48973, 48991, 49003, 49009, 49033, 49057, 49069, 49081, 49117, 49123, 49171, 49177, 49201, 49207, 49261, 49279, 49297, 49333, 49339, 49363, 49369, 49393, 49411, 49417, 49429, 49459, 49477, 49531, 49537, 49549, 49597, 49603, 49627, 49633, 49639, 49663, 49669, 49681, 49711, 49741, 49747, 49783, 49789, 49801, 49807, 49831, 49843, 49891, 49921, 49927, 49939, 49957, 49993, 49999, 50023, 50047, 50053, 50077, 50101, 50119, 50131, 50221, 50227, 50263, 50287, 50311, 50329, 50341, 50359, 50377, 50383, 50461, 50497, 50503, 50527, 50539, 50551, 50581, 50587, 50593, 50599, 50647, 50671, 50683, 50707, 50767, 50773, 50821, 50833, 50839, 50857, 50893, 50923, 50929, 50971, 50989, 51001, 51031, 51043, 51061, 51109, 51133, 51151, 51157, 51169, 51193, 51199, 51217, 51229, 51241, 51283, 51307, 51343, 51349, 51361, 51421, 51427, 51439, 51481, 51487, 51511, 51517, 51577, 51607, 51613, 51631, 51637, 51673, 51679, 51691, 51721, 51769, 51787, 51817, 51829, 51853, 51859, 51871, 51907, 51913, 51949, 51973, 51991, 52009, 52021, 52027, 52051, 52057, 52069, 52081, 52147, 52153, 52177, 52183, 52189, 52201, 52237, 52249, 52267, 52291, 52321, 52363, 52369, 52387, 52453, 52489, 52501, 52543, 52561, 52567, 52579, 52609, 52627, 52639, 52711, 52747, 52783, 52807, 52813, 52837, 52861, 52879, 52903, 52951, 52957, 52963, 52981, 52999, 53017, 53047, 53077, 53089, 53101, 53113, 53149, 53161, 53173, 53197, 53233, 53239, 53269, 53281, 53299, 53323, 53353, 53359, 53377, 53401, 53407, 53419, 53437, 53479, 53503, 53527, 53551, 53569, 53593, 53611, 53617, 53623, 53629, 53653, 53719, 53731, 53773, 53791, 53857, 53881, 53887, 53899, 53917, 53923, 53959, 54001, 54013, 54037, 54049, 54091, 54121, 54133, 54139, 54151, 54163, 54181, 54193, 54217, 54277, 54319, 54331, 54361, 54367, 54403, 54409, 54421, 54469, 54493, 54499, 54517, 54541, 54547, 54559, 54577, 54583, 54601, 54631, 54667, 54673, 54679, 54709, 54721, 54727, 54751, 54787, 54799, 54829, 54877, 54907, 54919, 54949, 54973, 54979, 55009, 55021, 55051, 55057, 55117, 55147, 55171, 55201, 55207, 55213, 55219, 55243, 55249, 55291, 55333, 55339, 55351, 55381, 55399, 55411, 55441, 55501, 55579, 55603, 55609, 55621, 55633, 55639, 55663, 55681, 55711, 55717, 55807, 55813, 55819, 55837, 55843, 55849, 55897, 55903, 55921, 55927, 55933, 55987, 56041, 56053, 56101, 56113, 56131, 56149, 56167, 56179, 56197, 56209, 56239, 56263, 56269, 56299, 56311, 56359, 56377, 56383, 56401, 56431, 56437, 56443, 56467, 56473, 56479, 56503, 56509, 56527, 56533, 56569, 56599, 56611, 56629, 56659, 56671, 56701, 56713, 56731, 56737, 56767, 56773, 56779, 56809, 56821, 56827, 56857, 56893, 56911, 56923, 56929, 56941, 56983, 56989, 57037, 57073, 57097, 57139, 57163, 57193, 57223, 57241, 57259, 57271, 57283, 57301, 57331, 57349, 57367, 57373, 57397, 57427, 57457, 57487, 57493, 57529, 57559, 57571, 57601, 57637, 57649, 57667, 57679, 57697, 57709, 57727, 57751, 57781, 57787, 57793, 57829, 57847, 57853, 57859, 57901, 57943, 57973, 57991, 58027, 58057, 58099, 58111, 58129, 58147, 58153, 58171, 58189, 58207, 58231, 58237, 58243, 58309, 58321, 58363, 58369, 58393, 58411, 58417, 58441, 58453, 58477, 58537, 58543, 58549, 58567, 58573, 58579, 58603, 58657, 58687, 58693, 58699, 58711, 58741, 58771, 58789, 58831, 58897, 58909, 58921, 58963, 59011, 59023, 59029, 59053, 59077, 59083, 59107, 59113, 59119, 59149, 59167, 59197, 59209, 59221, 59233, 59239, 59263, 59281, 59341, 59359, 59377, 59407, 59419, 59443, 59467, 59473, 59497, 59509, 59539, 59557, 59581, 59611, 59617, 59629, 59659, 59671, 59707, 59743, 59779, 59791, 59797, 59809, 59833, 59863, 59887, 59929, 59971, 60013, 60037, 60091, 60103, 60127, 60133, 60139, 60169, 60217, 60223, 60259, 60271, 60289, 60331, 60337, 60343, 60373, 60397, 60427, 60457, 60493, 60589, 60601, 60607, 60631, 60637, 60649, 60661, 60679, 60703, 60727, 60733, 60757, 60763, 60793, 60811, 60859, 60889, 60901, 60913, 60919, 60937, 60943, 60961, 61027, 61051, 61057, 61099, 61129, 61141, 61153, 61231, 61261, 61291, 61297, 61333, 61339, 61357, 61363, 61381, 61417, 61441, 61471, 61483, 61507, 61519, 61543, 61561, 61603, 61609, 61627, 61651, 61657, 61681, 61687, 61717, 61723, 61729, 61813, 61819, 61837, 61843, 61861, 61879, 61909, 61927, 61933, 61981, 61987, 62011, 62017, 62047, 62053, 62071, 62119, 62131, 62137, 62143, 62191, 62233, 62299, 62311, 62323, 62347, 62383, 62401, 62467, 62473, 62497, 62533, 62539, 62563, 62581, 62617, 62653, 62659, 62683, 62701, 62731, 62743, 62761, 62773, 62791, 62827, 62851, 62869, 62929, 62971, 62983, 62989, 63031, 63067, 63073, 63079, 63097, 63103, 63127, 63199, 63211, 63241, 63247, 63277, 63313, 63331, 63337, 63361, 63367, 63391, 63397, 63409, 63421, 63439, 63463, 63487, 63493, 63499, 63541, 63559, 63577, 63589, 63601, 63607, 63649, 63667, 63691, 63697, 63703, 63709, 63727, 63781, 63793, 63799, 63823, 63841, 63853, 63901, 63907, 63913, 63949, 63997, 64033, 64063, 64081, 64123, 64153, 64171, 64189, 64231, 64237, 64279, 64303, 64327, 64333, 64381, 64399, 64453, 64483, 64489, 64513, 64567, 64579, 64591, 64609, 64621, 64627, 64633, 64663, 64693, 64717, 64747, 64783, 64849, 64879, 64891, 64921, 64927, 64951, 64969, 65011, 65029, 65053, 65071, 65089, 65101, 65119, 65167, 65173, 65179, 65203, 65239, 65257, 65269, 65287, 65293, 65323, 65353, 65371, 65407, 65413, 65419, 65437, 65449, 65479, 65497, 65521, 65539, 65551, 65557, 65563, 65581, 65587, 65599, 65617, 65629, 65647, 65677, 65701, 65707, 65713, 65719, 65731, 65761, 65809, 65827, 65839, 65851, 65881, 65899, 65929, 65983, 66037, 66067, 66103, 66109, 66169, 66271, 66301, 66337, 66343, 66361, 66373, 66403, 66457, 66463, 66499, 66523, 66529, 66541, 66553, 66571, 66601, 66643, 66697, 66721, 66733, 66739, 66751, 66763, 66841, 66853, 66877, 66883, 66889, 66919, 66931, 66943, 66949, 66973, 67003, 67021, 67033, 67057, 67129, 67141, 67153, 67189, 67213, 67219, 67231, 67261, 67273, 67339, 67369, 67399, 67411, 67429, 67447, 67453, 67477, 67489, 67531, 67537, 67567, 67579, 67651, 67699, 67723, 67741, 67759, 67777, 67783, 67789, 67801, 67807, 67819, 67843, 67867, 67891, 67927, 67933, 67939, 67957, 67987, 67993, 68023, 68041, 68053, 68059, 68071, 68113, 68161, 68209, 68227, 68239, 68281, 68311, 68329, 68371, 68389, 68437, 68443, 68449, 68473, 68491, 68521, 68539, 68581, 68611, 68659, 68683, 68713, 68737, 68743, 68749, 68767, 68791, 68821, 68863, 68881, 68899, 68917, 68947, 69001, 69019, 69031, 69061, 69067, 69073, 69109, 69127, 69151, 69163, 69193, 69247, 69259, 69313, 69337, 69379, 69403, 69427, 69439, 69457, 69463, 69481, 69493, 69499, 69661, 69691, 69697, 69709, 69739, 69763, 69829, 69847, 69859, 69877, 69931, 69991, 69997, 70003, 70009, 70039, 70051, 70099, 70111, 70117, 70123, 70141, 70177, 70183, 70201, 70207, 70237, 70249, 70297, 70309, 70321, 70327, 70351, 70381, 70393, 70423, 70429, 70459, 70489, 70501, 70507, 70537, 70549, 70573, 70621, 70627, 70639, 70657, 70663, 70687, 70717, 70729, 70753, 70783, 70843, 70849, 70867, 70879, 70891, 70921, 70951, 70957, 70969, 70981, 70999, 71011, 71023, 71059, 71089, 71119, 71143, 71161, 71167, 71191, 71209, 71233, 71257, 71263, 71287, 71293, 71317, 71329, 71341, 71347, 71353, 71359, 71389, 71413, 71419, 71437, 71443, 71473, 71479, 71503, 71527, 71551, 71563, 71569, 71593, 71647, 71671, 71707, 71713, 71719, 71761, 71809, 71821, 71881, 71887, 71899, 71917, 71941, 71947, 71971, 71983, 72019, 72031, 72043, 72073, 72091, 72103, 72109, 72139, 72169, 72211, 72223, 72229, 72253, 72271, 72277, 72307, 72313, 72337, 72367, 72379, 72421, 72469, 72481, 72493, 72547, 72559, 72577, 72613, 72643, 72649, 72661, 72673, 72679, 72727, 72733, 72739, 72763, 72817, 72823, 72859, 72871, 72883, 72889, 72901, 72907, 72931, 72937, 72949, 72973, 72997, 73009, 73039, 73063, 73141, 73189, 73237, 73243, 73291, 73303, 73309, 73327, 73351, 73363, 73369, 73387, 73417, 73453, 73459, 73471, 73477, 73483, 73561, 73597, 73609, 73651, 73681, 73693, 73699, 73771, 73783, 73819, 73849, 73867, 73897, 73939, 73951, 73999, 74017, 74047, 74071, 74077, 74101, 74131, 74143, 74149, 74161, 74167, 74197, 74203, 74209, 74257, 74287, 74293, 74311, 74317, 74323, 74353, 74377, 74383, 74413, 74419, 74449, 74509, 74521, 74527, 74551, 74587, 74611, 74623, 74653, 74707, 74713, 74719, 74731, 74761, 74779, 74797, 74821, 74827, 74857, 74869, 74887, 74923, 74929, 74941, 74959, 75013, 75037, 75079, 75109, 75133, 75169, 75181, 75193, 75211, 75217, 75223, 75253, 75277, 75289, 75307, 75337, 75367, 75391, 75403, 75511, 75541, 75553, 75571, 75577, 75583, 75619, 75679, 75703, 75709, 75721, 75781, 75787, 75793, 75853, 75883, 75913, 75931, 75937, 75967, 75979, 75991, 75997, 76003, 76039, 76081, 76099, 76123, 76129, 76147, 76159, 76207, 76213, 76231, 76243, 76249, 76261, 76303, 76333, 76369, 76387, 76423, 76441, 76471, 76507, 76519, 76537, 76543, 76561, 76579, 76597, 76603, 76651, 76717, 76753, 76771, 76777, 76801, 76819, 76831, 76837, 76873, 76963, 77017, 77023, 77029, 77041, 77047, 77101, 77137, 77167, 77191, 77239, 77263, 77269, 77317, 77323, 77347, 77359, 77377, 77383, 77419, 77431, 77479, 77491, 77509, 77521, 77527, 77551, 77557, 77563, 77569, 77587, 77611, 77617, 77641, 77647, 77659, 77689, 77713, 77719, 77731, 77743, 77761, 77773, 77797, 77839, 77863, 77893, 77899, 77929, 77977, 77983, 78007, 78031, 78049, 78079, 78121, 78139, 78157, 78163, 78193, 78229, 78241, 78259, 78277, 78283, 78301, 78307, 78367, 78427, 78439, 78487, 78511, 78517, 78541, 78553, 78571, 78577, 78583, 78607, 78643, 78649, 78691, 78697, 78721, 78781, 78787, 78823, 78853, 78877, 78889, 78901, 78919, 78979, 79039, 79063, 79087, 79111, 79147, 79153, 79159, 79201, 79231, 79273, 79279, 79309, 79333, 79357, 79393, 79399, 79411, 79423, 79531, 79537, 79549, 79561, 79579, 79609, 79621, 79627, 79633, 79657, 79669, 79687, 79693, 79699, 79777, 79801, 79813, 79843, 79861, 79867, 79873, 79903, 79939, 79987, 79999, 80071, 80077, 80107, 80149, 80167, 80173, 80191, 80209, 80221, 80233, 80239, 80251, 80263, 80287, 80317, 80329, 80341, 80347, 80407, 80449, 80473, 80491, 80527, 80557, 80599, 80611, 80629, 80671, 80677, 80683, 80701, 80713, 80737, 80749, 80761, 80779, 80803, 80809, 80833, 80863, 80911, 80917, 80923, 80929, 80953, 80989, 81001, 81013, 81019, 81031, 81043, 81049, 81097, 81157, 81163, 81181, 81199, 81223, 81283, 81307, 81331, 81343, 81349, 81373, 81409, 81421, 81439, 81457, 81463, 81517, 81547, 81553, 81559, 81619, 81637, 81649, 81667, 81703, 81727, 81769, 81799, 81817, 81847, 81853, 81883, 81901, 81919, 81931, 81937, 81943, 81967, 81973, 82003, 82009, 82021, 82039, 82051, 82129, 82141, 82153, 82171, 82183, 82189, 82207, 82219, 82231, 82237, 82261, 82267, 82279, 82339, 82351, 82387, 82393, 82471, 82483, 82507, 82531, 82549, 82561, 82567, 82591, 82609, 82633, 82651, 82657, 82699, 82723, 82729, 82759, 82813, 82837, 82891, 82903, 82939, 82963, 82981, 83023, 83047, 83059, 83071, 83077, 83089, 83101, 83137, 83203, 83221, 83227, 83233, 83257, 83269, 83299, 83311, 83341, 83383, 83389, 83401, 83407, 83431, 83437, 83443, 83449, 83497, 83557, 83563, 83617, 83641, 83653, 83689, 83701, 83719, 83737, 83761, 83773, 83791, 83833, 83857, 83869, 83911, 83983, 84061, 84067, 84121, 84127, 84163, 84181, 84199, 84211, 84223, 84229, 84247, 84307, 84313, 84319, 84349, 84391, 84421, 84457, 84463, 84481, 84499, 84523, 84559, 84589, 84631, 84649, 84673, 84691, 84697, 84751, 84787, 84793, 84811, 84859, 84871, 84913, 84919, 84961, 84967, 84979, 84991, 85009, 85021, 85027, 85081, 85087, 85093, 85147, 85159, 85201, 85213, 85237, 85243, 85297, 85303, 85333, 85363, 85369, 85381, 85411, 85429, 85447, 85453, 85513, 85531, 85549, 85597, 85621, 85627, 85639, 85669, 85711, 85717, 85819, 85831, 85837, 85843, 85903, 85909, 85933, 85999, 86011, 86017, 86029, 86077, 86083, 86113, 86131, 86137, 86143, 86161, 86179, 86197, 86209, 86239, 86257, 86263, 86269, 86287, 86293, 86311, 86323, 86341, 86353, 86371, 86389, 86413, 86461, 86467, 86491, 86509, 86533, 86539, 86587, 86599, 86629, 86677, 86689, 86719, 86743, 86767, 86851, 86857, 86869, 86923, 86929, 86959, 87013, 87037, 87049, 87103, 87121, 87133, 87151, 87181, 87187, 87211, 87223, 87253, 87277, 87313, 87337, 87403, 87421, 87427, 87433, 87481, 87511, 87517, 87523, 87541, 87547, 87553, 87559, 87583, 87589, 87613, 87631, 87643, 87649, 87679, 87691, 87697, 87721, 87739, 87751, 87793, 87811, 87853, 87877, 87931, 87943, 87961, 87973, 87991, 88003, 88069, 88093, 88117, 88129, 88177, 88237, 88261, 88321, 88327, 88339, 88411, 88423, 88471, 88513, 88591, 88609, 88651, 88657, 88663, 88681, 88729, 88741, 88747, 88771, 88789, 88801, 88807, 88813, 88819, 88843, 88861, 88867, 88873, 88897, 88903, 88951, 88969, 88993, 89017, 89041, 89071, 89083, 89101, 89107, 89113, 89119, 89137, 89203, 89209, 89227, 89269, 89293, 89317, 89329, 89371, 89413, 89431, 89443, 89449, 89491, 89521, 89527, 89533, 89563, 89599, 89611, 89653, 89659, 89671, 89689, 89767, 89779, 89797, 89809, 89821, 89833, 89839, 89899, 89917, 89923, 89959, 89977, 89983, 89989, 90001, 90007, 90019, 90031, 90067, 90073, 90121, 90127, 90163, 90187, 90199, 90217, 90247, 90271, 90289, 90313, 90373, 90379, 90397, 90403, 90439, 90469, 90481, 90499, 90511, 90523, 90529, 90547, 90583, 90619, 90631, 90679, 90697, 90703, 90709, 90787, 90793, 90823, 90841, 90847, 90901, 90907, 90931, 90997, 91009, 91033, 91081, 91099, 91129, 91141, 91153, 91159, 91183, 91237, 91243, 91249, 91291, 91297, 91303, 91309, 91369, 91381, 91387, 91393, 91411, 91423, 91453, 91459, 91513, 91573, 91591, 91621, 91639, 91711, 91753, 91771, 91801, 91807, 91813, 91837, 91867, 91873, 91909, 91921, 91939, 91951, 91957, 91969, 92041, 92077, 92083, 92107, 92119, 92143, 92173, 92179, 92203, 92221, 92227, 92233, 92251, 92269, 92311, 92317, 92347, 92353, 92377, 92383, 92401, 92413, 92419, 92431, 92461, 92467, 92479, 92503, 92551, 92557, 92569, 92581, 92593, 92623, 92641, 92647, 92671, 92683, 92707, 92737, 92761, 92767, 92779, 92791, 92809, 92821, 92857, 92863, 92893, 92899, 92941, 92959, 93001, 93097, 93103, 93133, 93139, 93151, 93169, 93187, 93199, 93229, 93241, 93253, 93283, 93307, 93319, 93337, 93427, 93463, 93481, 93487, 93493, 93523, 93529, 93553, 93559, 93601, 93607, 93637, 93703, 93739, 93763, 93787, 93811, 93871, 93889, 93901, 93913, 93937, 93949, 93967, 93979, 93997, 94009, 94033, 94057, 94063, 94099, 94111, 94117, 94153, 94201, 94207, 94219, 94261, 94273, 94291, 94309, 94321, 94327, 94351, 94399, 94441, 94447, 94477, 94483, 94513, 94531, 94543, 94561, 94573, 94597, 94603, 94621, 94651, 94687, 94693, 94723, 94747, 94771, 94777, 94789, 94819, 94837, 94849, 94873, 94903, 94933, 94951, 94993, 94999, 95071, 95083, 95089, 95101, 95107, 95131, 95143, 95191, 95203, 95233, 95239, 95257, 95287, 95311, 95317, 95383, 95401, 95413, 95419, 95443, 95461, 95467, 95479, 95527, 95539, 95569, 95581, 95617, 95629, 95701, 95707, 95713, 95731, 95737, 95773, 95791, 95803, 95857, 95869, 95881, 95911, 95917, 95923, 95929, 95947, 95959, 95971, 95989, 96001, 96013, 96043, 96079, 96097, 96157, 96181, 96199, 96211, 96223, 96259, 96289, 96331, 96337, 96451, 96457, 96469, 96487, 96493, 96517, 96553, 96589, 96601, 96643, 96661, 96667, 96697, 96703, 96739, 96757, 96763, 96769, 96787, 96799, 96823, 96847, 96907, 96931, 96973, 96979, 96997, 97003, 97021, 97039, 97081, 97117, 97159, 97171, 97177, 97213, 97231, 97303, 97327, 97369, 97381, 97387, 97423, 97429, 97441, 97453, 97459, 97501, 97549, 97561, 97579, 97609, 97651, 97687, 97711, 97729, 97771, 97777, 97789, 97813, 97843, 97849, 97861, 97879, 97927, 97987, 98011, 98017, 98041, 98047, 98101, 98143, 98179, 98221, 98227, 98251, 98257, 98269, 98299, 98317, 98323, 98347, 98377, 98389, 98407, 98419, 98443, 98467, 98473, 98479, 98491, 98533, 98563, 98641, 98689, 98713, 98731, 98737, 98773, 98779, 98809, 98869, 98887, 98893, 98899, 98911, 98929, 98947, 98953, 99013, 99079, 99103, 99109, 99133, 99139, 99181, 99223, 99241, 99259, 99277, 99289, 99349, 99367, 99391, 99397, 99409, 99439, 99469, 99487, 99523, 99529, 99559, 99571, 99577, 99607, 99643, 99661, 99667, 99679, 99709, 99721, 99733, 99787, 99793, 99817, 99823, 99829, 99859, 99871, 99877, 99901, 99907, 99961, 99991};