-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest9.4_Numpy.py
More file actions
571 lines (486 loc) · 53.1 KB
/
Copy pathtest9.4_Numpy.py
File metadata and controls
571 lines (486 loc) · 53.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
import math
import time
from operator import itemgetter
import numpy as np
'''
Run-Time of this algorithm is essentially
O((n^3)*R), where R is the specified ratio
beforehand of how "fine" the gradient of
movement is for each iteration (so I typically
use spacing = 5000, with an updated step of
1 unit length for all nodes per iteration/round
of simulated movement -- so 5000/1 makes it
O(5000*n^3)
...
However, if you have a way of solving this
as a simplified version of the N-Body Problem,
or even using a GPU with concurrent processing,
you can essentially reduce this down to O(R*n^2)
I think...
'''
def graphConv(filename):
graph = {}
size = 0
with open(filename, 'r') as file:
for line in file:
contents = line.split()
if contents[0] == 'p':
size = int(contents[2])
break
for i in range(1, size + 1):
graph[i] = []
with open(filename, 'r') as file:
for line in file:
edge = line.split()
if edge[0] == 'e':
e1 = int(edge[1])
e2 = int(edge[2])
graph[e1].append(e2)
graph[e2].append(e1)
return graph
def checkClique(clique, graph):
flag = True
for member in range(len(clique)-1):
neighbors = graph[clique[member]]
for other in range(member+1, len(clique)):
if clique[other] not in neighbors:
flag = False
break
print("Return_Set: {0}".format(clique))
print("Size of Return_Set: {0}".format(len(clique)))
print("Return_Set is a Clique? -- {0}".format(flag))
def equidistant_vectors(N, spacing):
dims = N-1
coords = {}
first = [0.0]*dims
second = [float(spacing)] + [0.0]*(dims-1)
third = [float(spacing/2.0), float(spacing/2.0)*math.sqrt(3)] + [0.0]*(dims-2)
coords[1] = first
coords[2] = second
coords[3] = third
#initialize N equidistant vectors
for i in range(4, N+1):
node_coord = [0.0]*dims
for dimension in range(0, i-2):
temp = 0.0
for prevNode in range(1, i):
temp += coords[prevNode][dimension]
temp /= float(i-1)
node_coord[dimension] = temp
temp = 0.0
for prevDims in range(0, i-2):
temp += (node_coord[prevDims]**2)
last_dim_solution = math.sqrt(float(spacing)**2 - temp)
node_coord[i-2] = last_dim_solution
coords[i] = node_coord
return coords
def distance(point_list1, point_list2):
return np.linalg.norm(point_list1 - point_list2)
def unitVector(vector):
return (vector / np.linalg.norm(vector))
def nextDirection(node, neighbors, coords):
position = coords[node]
final = np.zeros(len(position))
for neighbor in neighbors:
final += unitVector(coords[neighbor] - position)
return unitVector(final)
def updatePosition(coords, node, toMoveNext):
coords[node] += toMoveNext
def hasConverged(distances):
for key in distances.keys():
edgeDict = distances[key]
for edge in edgeDict.keys():
if edgeDict[edge][1] == False:
return False
return True
def updateDistances(coords, distances):
for node in distances.keys():
relativesDict = distances[node]
position = coords[node]
for relative in relativesDict.keys():
spacing = relativesDict[relative]
dist = distance(position, coords[relative])
spacing[0] = dist
if dist < 2.0:#Arbitrary value, based on step-distance = 1.0 for unit vector
spacing[1] = True
#Can spacing ever grow to be > 2.0 after it's converged?
def avgPosition(coords, nodes):
average = np.zeros(len(coords[nodes[0]]))
for node in nodes:
average += coords[node]
return (average / float(len(nodes)))
def convergence(coordinates, adjacency, space, onResume = False, resumedCoords = {}):
#start = time.time()
nodes = adjacency.keys()
distances = {}
if onResume:
coords = resumedCoords
for i in range(len(nodes) - 1):
lesser = nodes[i]
distances[lesser] = {}
for j in range(i+1, len(nodes)):
greater = nodes[j]
distances[lesser][greater] = [distance(resumedCoords[lesser], resumedCoords[nodes[j]]), False]
if distances[lesser][greater][0] < 2.0:
distances[lesser][greater][1] = True
else:
coords = coordinates
for i in range(len(nodes)-1):
lesser = nodes[i]
distances[lesser] = {}
for j in range(i+1, len(nodes)):
distances[lesser][nodes[j]] = [space, False]
iter = 0
while not hasConverged(distances):
#startTime = time.time()
iter += 1
#print("Round {0}".format(iter))
moveUpdates = []
for node in nodes:
moveUpdates.append(nextDirection(node, adjacency[node], coords))
for x in range(len(nodes)):
updatePosition(coords, nodes[x], moveUpdates[x])
updateDistances(coords, distances)
#if (iter%100 == 0):
# for key in coords.keys():
# print("{0}: {1},".format(key, coords[key]))
# print("Round {0} ending".format(iter))
#print(time.time() - startTime)
#print("Time to Converge: {0}".format(time.time() - start))
return avgPosition(coords, nodes)
def main(filename, origSize, sample = False, sampleGraph = {}, onResume = False, resumeCoords = {}):
graph = {}
if sample:
for key in sampleGraph.keys():
temp = []
for neighbor in sampleGraph[key]:
temp.append(neighbor)
graph[key] = temp
else:
graph = graphConv(filename)
#toDel = []
toDel = [36, 83, 108, 76, 51, 90, 64, 15, 95, 68, 42, 97, 88, 16, 94, 75, 102, 55, 43, 27, 33, 112, 87, 56, 21, 100, 73, 121, 107, 105, 3, 14]
#toDel = [36, 83, 108, 75, 76, 51, 90, 73, 88, 42, 113, 15, 97, 16, 64, 95, 94, 3, 21, 102, 55, 116, 33, 27, 50, 87, 105, 78, 124, 112, 12, 100, 121, 106, 14, 56, 84, 120, 32, 53, 43, 37, 109, 28, 4,]
for node in toDel:
neighbors = graph[node]
for neighbor in neighbors:
graph[neighbor].remove(node)
graph.pop(node, None)
order = []
#Typically, spacing is 5000
spacing = 50000
coords = equidistant_vectors(origSize, spacing)
convergencePoints = []
iterDistances = []
while True:
coordsCopy = {}
for key in coords.keys():
coordsCopy[key] = np.asarray(coords[key])
cPoint = convergence(coordsCopy, graph, spacing, onResume, resumeCoords)
convergencePoints.append(cPoint)
#print(cPoint)
distResults = []
for node in graph.keys():
distResults.append((node, distance(cPoint, coords[node])))
distResults = sorted(distResults, key=itemgetter(1), reverse=True)
iterDistances.append(distResults)
#print(distResults)
parsed = []
for item in distResults:
parsed.append(item[0])
order.append(parsed)
#print(parsed)
#return distResults[0][0]
print(order[-1])
if abs(distResults[0][1] - distResults[-1][1]) < 0.0000001:
print(" Closest-Farthest Error Difference: {0}".format(abs(distResults[0][1] - distResults[-1][1])))
break
else:
nextToDel = distResults[0][0]
print(" Closest-Farthest Error Difference: {0}".format(abs(distResults[0][1] - distResults[-1][1])))
print(" 1st_Farthest-2nd Error Difference: {0}".format(abs(distResults[0][1] - distResults[1][1])))
print(" <DELETING NODE {0}>".format(nextToDel))
for neighbor in graph[nextToDel]:
graph[neighbor].remove(nextToDel)
toDel.append(nextToDel)
print(" Size of remaining graph: {0}".format(origSize - len(toDel)))
print(" Deleted so far: {0}".format(toDel))
graph.pop(nextToDel, None)
print(time.ctime())
a = 1
b = 1
for point in convergencePoints:
print("After Iteration {0}: {1}".format(a, point))
a += 1
for iterDist in iterDistances:
print("After Iteration {0}: {1}".format(b, iterDist))
b += 1
if sample:
origGraph = sampleGraph
else:
origGraph = graphConv(filename)
clique = []
for key in origGraph.keys():
if key not in toDel:
clique.append(key)
checkClique(clique, origGraph)
for ordering in order:
print(ordering)
#1 Iteration took 0.6 sec
#Size 4 took 3868 simulated rounds
graph1 = {1:[2,3,4], 2:[1,3], 3:[1,2], 4:[1]}
#1 Iteration took 1.74 sec
#Size 7 took 3440 simulated rounds
graph2 = {1:[2,3,4,6], 2:[1,3,5,7], 3:[1,2,4,5], 4:[1,3,5,6,7], 5:[2,3,4,6,7], 6:[1,4,5,7], 7: [2,4,5,6]}
#1 Iteration took 1.3 sec
graph2ver2 = {1:[2,4,6], 2:[1,5,7], 4:[1,5,6,7], 5:[2,4,6,7], 6:[1,4,5,7], 7: [2,4,5,6]}
#1 Iteration took 1.0 sec
graph2ver3 = {1:[4,6], 4:[1,5,6,7], 5:[4,6,7], 6:[1,4,5,7], 7: [4,5,6]}
#1 Iteration took 0.6 sec
graph2ver4 = {4:[5,6,7], 5:[4,6,7], 6:[4,5,7], 7: [4,5,6]}
graph3 = {1: [3, 4], 2: [3, 4, 5], 3: [1, 2], 4: [1, 2, 5], 5: [2, 4]}
graph = graph3
#main("c125.txt", 7, True, graph)
#'''
#(SPACING = 5000)
#1 Iteration took 687 sec (~0.19 seconds/round)
#HOLY SHIT, using Numpy makes this run like 15x faster
#Size 125 took 3526 simulated rounds
#Note to self: Converged at... [2500.1606507561632, 1442.297368316359, 1020.9035173351026, 790.785856318066, 645.8978943025529, 546.780878827789, 473.54237984520347, 416.6814071002168, 372.9346475198153, 337.7651684992841, 306.51289554920527, 282.87369095514794, 261.1904799309855, 242.45481892597658, 226.79674719720086, 213.50343814068427, 202.9363278769302, 192.44613404664068, 181.14223321611146, 171.84367302585264, 165.0118714827357, 156.9617862348561, 151.22024426072954, 144.57052309055285, 138.43254493037603, 133.21253740075556, 128.12656293375687, 125.03317070810411, 120.10125643266791, 115.92598780626956, 111.77610144562067, 107.85094011460671, 106.06061849071692, 102.50518518682027, 97.20686682844537, 96.72556952458811, 93.6688605552854, 92.66237650205935, 90.5313997528022, 87.6097190125494, 83.81641237507291, 83.04803859240326, 81.37941778421214, 80.97639167809864, 78.00210626524475, 76.79105055578769, 74.70182672337468, 73.8700940266351, 70.47985909838101, 68.35085557828651, 68.9494522965366, 67.15506063883844, 67.81642204926685, 64.1803035053063, 63.263473610474975, 62.62974105755576, 61.54690200492055, 60.97076611110323, 61.1350066893735, 57.97261298095041, 57.259912915578475, 55.87062323095282, 54.27455439531492, 55.34835220024454, 53.772732842528974, 54.144291137386176, 51.439188907041995, 51.65807840705602, 51.61842438628762, 49.69983994825094, 49.496681891558346, 47.1304434520029, 48.40525408914543, 45.58119223959545, 44.986307490534685, 46.79760723835413, 45.008888162710534, 45.13633276078471, 45.78243361653749, 43.05593024706185, 43.95763112615007, 40.53187058436222, 42.22093094721457, 42.196137780573785, 41.70535544361472, 40.5149772615826, 39.070176512929145, 39.36026790353056, 37.95235473044288, 39.23086163283957, 39.27864289014676, 37.88714180151359, 36.53653005618709, 36.14553675120005, 37.433319615377776, 35.3705773023133, 37.40330528309892, 37.284444024326774, 34.748258868911506, 36.565506646976985, 34.282233062240955, 33.68497693171059, 35.77969430901654, 33.27500676022936, 33.43224778109444, 33.124239700056954, 30.86281342774412, 32.773403380319564, 33.67990482506363, 33.61056635902326, 31.154523222616273, 30.137018117798718, 32.99954590664156, 31.02700405829687, 29.795995788605772, 30.500453773282228, 30.247979408465053, 30.226916319766907, 29.26186779081025, 29.263168756770042, 29.001778269039683, 29.49490611499247, 28.307327970685638, 29.48597598692083]
DIMACS1 = "c125.txt"
#1 Iteration took ___ sec (~0.84 seconds/round, so predicted -- ~3000 seconds, which is about 50 minutes)
DIMACS2 = "c250.txt"
#1 Iteration took ___ sec (~3.66 seconds/round, so predicted -- ~13,176 seconds, which is about 220 minutes)
DIMACS3 = "c500.txt"
filename = DIMACS1
main(filename, 125)
#'''
#solution1 = [7, 9, 11, 13, 19, 22, 25, 29, 33, 34, 40, 44, 49, 52, 54, 55, 66, 67, 68, 70, 79, 80, 93, 96, 98, 99, 103, 104, 110, 111, 114, 117, 122, 125]
#solution2 = [1, 2, 5, 7, 9, 11, 17, 18, 19, 25, 29, 31, 34, 40, 44, 45, 48, 49, 54, 70, 71, 77, 79, 80, 99, 101, 110, 114, 115, 117, 121, 122, 123, 125]
# unique1 = [13, 22, 33, 52, 55, 66, 67, 68, 93, 96, 98, 103, 104, 111]
# unique2 = [1, 2, 5, 17, 18, 31, 45, 48, 71, 77, 101, 115, 121, 123]
#shared = [7, 9, 11, 19, 25, 29, 34, 40, 44, 49, 54, 70, 79, 80, 99, 110, 114, 117, 122, 125]
#Parsed: [36, 83, 108, 75, 76, 51, 90, 73, 88, 42, 113, 15, 97, 16, 64, 95, 94, 3, 68, 103, 33, 17, 116, 50, 12, 81, 100, 89, 55, 14, 63, 38, 105, 78, 21,
#102, 112, 71, 93, 28, 56, 32, 61, 120, 87, 124, 122, 66, 23, 26, 53, 62, 84, 20, 27, 106, 37, 43, 107, 121, 79, 35, 117, 115, 31, 69, 13, 5, 118, 4, 1, 91,
#57, 44, 109, 72, 58, 25, 2, 9, 96, 85, 48, 86, 119, 52, 30, 46, 74, 41, 6, 77, 82, 123, 22, 34, 92, 65, 10, 59, 70, 47, 24, 18, 39, 67, 125, 40, 29, 11, 49,
#98, 80, 7, 110, 99, 101, 19, 8, 45, 111, 104, 54, 114, 60]
#Time from first convergence -- 670 sec
#2nd Convergence -- 681 sec
#etc. --[670, 681, 652, 634, 632, 620, 610, 598, 586, 576, 566, 559, 548, 540, 529, 520, 509, 507, 514, 496, 476, 468, 470, 468, 449,
# 434, 425, 415, 407, 400, 390, 383, 375, 368, 360, 353, 344, 337, 329, 321, 314, 308, 300, 293, 287, 280, 273, 267, 259, 253,
# 246, 240, 234, 228, 222, 215, 209, 204, 198, 192, 187, 181, 176, 172, 166, 160, 155, 149, 145, 142, 139, 130, 126, 120, 116,
# 112, 107, 104, 100, 95, 92, 88, 83, 79, 76, 72, 68, 65, 62, 58, 55, 52, 49, 46, 44, 41, 38, 36]
# -- so in total, 28,427 seconds (or about 8 hours)
# Batch of deleted nodes from Vector-Projection-Method, from test8.py:
#[36, 83, 108, 76, 51, 90, 64, 15, 95, 68, 42, 97, 88, 16, 94, 75, 102, 55, 27, 33, 43, 112, 87, 56, 100, 21, 73, 121, 107, 105, 3, 14]
#[113, 61, 109, 50, 124, 84, 72, 32, 37, 4, 57, 78, 20, 116, 28, 12, 53, 120, 106, 65, 98, 46, 115, 23, 62, 30, 118, 74, 52, 39, 111, 6]
#[58, 103, 91, 89, 38, 86, 63, 81, 119, 10, 49, 92, 26]
# This algorithm's batch of deleted nodes:
#[36, 83, 108, 76, 51, 90, 64, 15, 95, 68*, 97, 42, 88,
# 21 (0.002), 112 (0.0015), 94 (0.3), 55* (0.002), 103* (0.004), 50 (0.00002), 33* (0.0008), 113 (0.001),
# 73 (0.001), 3 (0.35), 121** (0.0016), 102 (0.00007), 100 (0.004), 124 (0.37), 84 (0.0002), 116 (0.0005),
# 75 (0.002), 14 (0.01), 16 (0.4), 105 (0.0008), 27 (0.006), 43 (0.4), 1** (0.007), 28 (0.005), 120 (0.003),
# 20 (0.001), 4 (0.5), 52* (0.0005), 56 (0.001), 32 (0.003), 78 (0.006), 109 (0.54), 98* (0.0008), 65 (0.003),
# 22 (0.004), 57 (0.001), 107 (0.004), 87 (0.62), 122*** (0.0033), 12, 61, 115**, 41, 30, 62, 74, 38, 52, 26,
# 39, 10, 6, 123**, 111*, 101**, 58, 69, 81, 119, 46, 89, 25***, 40***, 60, 79***, 86, 13*, 82, 110***, 24, 66*,
# 23, 59, 118, 106, 37, 8, 63, 91, 45**, 17**, 47, 18**, 80***]
#Returned Set: [2, 5, 7, 9, 11, 19, 29, 31, 34, 35, 44, 48, 49, 54, 67, 70, 71, 72, 77, 85, 92, 93, 96, 99, 104, 114, 117, 125]
#Size: 28
#Returned Orderings:
orderings = [[36, 83, 108, 75, 76, 51, 90, 73, 88, 42, 113, 15, 97, 16, 64, 95, 94, 3, 68, 103, 33, 17, 116, 50, 12, 81, 100, 89, 55, 14, 63, 38, 105, 78, 21, 102, 112, 71, 93, 28, 56, 32, 61, 120, 87, 124, 122, 66, 23, 26, 53, 62, 84, 20, 27, 106, 37, 43, 107, 121, 79, 35, 117, 115, 31, 69, 13, 5, 118, 4, 1, 91, 57, 44, 109, 72, 58, 25, 2, 9, 96, 85, 48, 86, 119, 52, 30, 46, 74, 41, 6, 77, 82, 123, 22, 34, 92, 65, 10, 59, 70, 47, 24, 18, 39, 67, 125, 40, 29, 11, 49, 98, 80, 7, 110, 99, 101, 19, 8, 45, 111, 104, 54, 114, 60]
,[83, 108, 76, 75, 51, 90, 42, 113, 16, 15, 73, 64, 95, 94, 88, 3, 97, 68, 17, 116, 12, 89, 14, 55, 103, 63, 38, 33, 50, 102, 21, 81, 112, 100, 93, 28, 32, 105, 120, 78, 87, 124, 71, 66, 23, 56, 53, 62, 20, 84, 61, 26, 106, 27, 37, 43, 107, 121, 35, 117, 31, 115, 118, 69, 5, 13, 72, 4, 122, 57, 44, 1, 58, 25, 79, 9, 96, 2, 86, 48, 119, 30, 52, 46, 74, 91, 109, 41, 6, 77, 34, 82, 123, 92, 85, 22, 65, 10, 59, 70, 47, 18, 24, 39, 67, 125, 29, 11, 40, 98, 49, 80, 7, 110, 99, 101, 19, 8, 45, 111, 104, 54, 114, 60]
,[108, 75, 76, 51, 90, 16, 95, 15, 73, 64, 94, 88, 42, 113, 97, 68, 116, 3, 12, 89, 14, 63, 17, 33, 38, 50, 102, 21, 81, 112, 55, 28, 93, 103, 32, 120, 87, 105, 78, 124, 100, 71, 66, 23, 56, 53, 27, 20, 62, 84, 43, 121, 107, 37, 35, 117, 31, 115, 5, 122, 72, 13, 118, 44, 1, 57, 58, 106, 61, 26, 79, 25, 9, 96, 2, 48, 52, 69, 4, 74, 119, 30, 109, 41, 34, 77, 82, 92, 86, 85, 123, 22, 46, 65, 59, 91, 6, 70, 39, 18, 10, 67, 11, 29, 40, 47, 49, 98, 24, 80, 7, 110, 125, 101, 99, 8, 45, 104, 19, 111, 114, 54, 60]
,[76, 51, 90, 75, 16, 95, 64, 15, 88, 42, 113, 97, 73, 94, 68, 116, 12, 89, 17, 63, 50, 3, 102, 81, 21, 112, 55, 93, 33, 14, 103, 38, 87, 120, 105, 78, 100, 124, 71, 28, 56, 23, 53, 27, 43, 32, 62, 84, 121, 107, 37, 35, 117, 122, 66, 72, 31, 118, 44, 57, 20, 26, 106, 61, 25, 2, 96, 13, 5, 115, 48, 69, 119, 52, 74, 1, 4, 109, 58, 79, 77, 9, 34, 82, 123, 85, 92, 22, 86, 30, 41, 65, 91, 46, 59, 6, 70, 39, 18, 10, 11, 29, 67, 40, 47, 49, 24, 98, 80, 110, 125, 101, 99, 8, 45, 7, 19, 104, 111, 114, 54, 60]
,[51, 90, 15, 95, 64, 88, 42, 75, 97, 113, 73, 16, 94, 68, 116, 17, 63, 81, 102, 12, 112, 3, 21, 89, 93, 55, 33, 14, 87, 103, 50, 120, 105, 78, 124, 100, 71, 56, 43, 23, 32, 27, 107, 121, 62, 38, 84, 37, 66, 122, 44, 118, 53, 57, 28, 26, 20, 106, 61, 25, 2, 35, 115, 96, 48, 13, 5, 117, 69, 1, 31, 72, 74, 52, 109, 58, 34, 77, 79, 9, 85, 82, 22, 123, 86, 119, 92, 30, 91, 41, 46, 65, 59, 4, 6, 70, 18, 10, 11, 49, 47, 67, 98, 40, 24, 39, 125, 29, 101, 99, 8, 80, 110, 7, 19, 104, 111, 114, 45, 54, 60]
,[90, 64, 88, 75, 97, 15, 16, 95, 94, 68, 116, 42, 73, 113, 17, 112, 12, 21, 3, 93, 55, 14, 33, 63, 87, 50, 81, 105, 78, 102, 124, 100, 89, 71, 56, 23, 62, 103, 43, 107, 121, 120, 84, 27, 37, 122, 66, 44, 118, 32, 57, 53, 28, 26, 38, 20, 106, 61, 25, 2, 115, 35, 117, 5, 13, 1, 96, 31, 52, 72, 109, 58, 77, 79, 34, 9, 69, 82, 85, 123, 22, 48, 74, 86, 119, 91, 30, 92, 59, 46, 41, 65, 4, 6, 70, 10, 18, 67, 40, 49, 24, 98, 47, 39, 11, 29, 101, 99, 8, 80, 110, 125, 7, 19, 104, 111, 114, 45, 54, 60]
,[64, 88, 15, 16, 94, 95, 68, 75, 42, 97, 113, 116, 17, 21, 112, 12, 73, 3, 55, 14, 50, 87, 33, 102, 81, 124, 100, 89, 71, 93, 62, 23, 56, 103, 107, 63, 120, 43, 37, 121, 27, 78, 105, 32, 57, 118, 26, 28, 53, 84, 38, 106, 20, 61, 25, 1, 5, 115, 117, 13, 122, 96, 66, 44, 31, 52, 72, 109, 79, 2, 34, 9, 82, 69, 85, 35, 22, 48, 123, 74, 86, 46, 119, 59, 30, 92, 65, 41, 4, 58, 6, 77, 70, 10, 91, 18, 67, 40, 49, 47, 98, 24, 39, 11, 101, 29, 99, 8, 125, 80, 7, 19, 104, 111, 114, 110, 45, 54, 60]
,[15, 94, 95, 68, 88, 75, 42, 97, 16, 116, 112, 3, 113, 21, 73, 12, 55, 50, 87, 33, 17, 102, 81, 124, 89, 71, 103, 62, 23, 56, 63, 43, 107, 14, 78, 27, 120, 121, 37, 105, 100, 93, 57, 26, 32, 118, 38, 53, 106, 61, 20, 1, 117, 13, 5, 122, 66, 96, 44, 52, 31, 72, 84, 28, 109, 2, 25, 35, 79, 82, 69, 115, 22, 123, 48, 74, 119, 59, 92, 46, 30, 41, 65, 58, 4, 6, 77, 70, 34, 9, 85, 10, 91, 18, 86, 67, 40, 49, 47, 39, 98, 24, 11, 101, 29, 99, 8, 125, 7, 19, 111, 104, 80, 54, 45, 114, 110, 60]
,[95, 68, 88, 42, 97, 16, 94, 116, 75, 113, 112, 3, 73, 21, 55, 87, 17, 50, 33, 81, 102, 12, 89, 103, 62, 23, 14, 56, 43, 27, 107, 63, 121, 78, 120, 105, 100, 37, 124, 93, 71, 26, 106, 118, 53, 61, 20, 1, 66, 13, 117, 57, 5, 52, 31, 44, 122, 72, 32, 84, 38, 28, 35, 25, 69, 82, 22, 115, 96, 123, 30, 41, 48, 74, 92, 59, 65, 46, 58, 109, 4, 2, 70, 79, 9, 34, 85, 86, 91, 119, 18, 10, 6, 40, 77, 39, 49, 47, 98, 24, 67, 101, 29, 99, 8, 125, 11, 19, 7, 104, 111, 80, 45, 54, 110, 114, 60]
,[68, 88, 97, 42, 16, 94, 116, 75, 113, 3, 21, 112, 87, 50, 33, 17, 102, 81, 12, 73, 89, 103, 14, 55, 62, 43, 56, 27, 121, 107, 78, 105, 100, 120, 124, 71, 93, 23, 118, 106, 63, 53, 20, 37, 117, 13, 31, 44, 57, 84, 72, 52, 32, 38, 26, 28, 61, 25, 35, 1, 82, 122, 5, 115, 69, 30, 22, 74, 123, 66, 96, 65, 41, 92, 59, 46, 109, 4, 58, 2, 70, 34, 79, 9, 86, 18, 85, 48, 91, 6, 77, 47, 40, 49, 119, 39, 10, 24, 67, 101, 29, 8, 98, 11, 7, 19, 99, 104, 111, 45, 125, 80, 54, 110, 114, 60]
,[97, 42, 94, 116, 88, 75, 3, 21, 16, 112, 87, 102, 33, 50, 113, 17, 14, 103, 56, 27, 55, 81, 121, 43, 107, 12, 100, 73, 124, 89, 71, 93, 23, 118, 62, 105, 53, 63, 78, 37, 20, 120, 13, 31, 117, 57, 52, 72, 44, 84, 38, 106, 26, 28, 61, 25, 35, 5, 1, 122, 82, 92, 66, 74, 115, 22, 123, 69, 65, 96, 41, 32, 59, 46, 109, 58, 79, 2, 9, 70, 48, 86, 85, 18, 34, 91, 30, 6, 4, 47, 49, 77, 40, 39, 119, 24, 10, 67, 101, 29, 8, 98, 11, 7, 19, 99, 104, 111, 80, 45, 125, 54, 110, 114, 60]
,[42, 88, 3, 21, 16, 112, 94, 116, 75, 33, 102, 87, 50, 113, 103, 55, 14, 56, 27, 121, 107, 81, 43, 12, 73, 100, 124, 89, 71, 23, 17, 93, 53, 105, 63, 20, 37, 120, 78, 13, 57, 31, 118, 84, 72, 62, 28, 38, 106, 61, 35, 25, 122, 1, 117, 22, 69, 52, 65, 74, 123, 96, 44, 115, 41, 109, 46, 32, 26, 59, 58, 79, 70, 2, 5, 9, 34, 85, 66, 48, 18, 82, 86, 30, 91, 92, 4, 6, 49, 40, 77, 47, 39, 119, 10, 101, 67, 29, 24, 8, 98, 7, 19, 99, 104, 111, 80, 125, 45, 11, 54, 110, 114, 60]
,[88, 21, 16, 112, 94, 116, 75, 33, 87, 102, 50, 3, 103, 55, 56, 27, 121, 43, 113, 12, 73, 100, 124, 89, 71, 23, 93, 14, 107, 53, 20, 105, 81, 120, 37, 78, 13, 31, 17, 57, 28, 118, 84, 62, 72, 38, 106, 63, 35, 69, 22, 74, 117, 65, 52, 44, 96, 41, 32, 109, 26, 59, 61, 58, 70, 2, 25, 5, 79, 122, 1, 9, 85, 48, 115, 18, 123, 66, 86, 30, 92, 46, 91, 4, 6, 40, 49, 77, 34, 82, 47, 39, 119, 10, 98, 8, 29, 67, 101, 24, 7, 19, 99, 104, 111, 125, 80, 11, 45, 54, 110, 114, 60]
,[21, 16, 112, 94, 75, 33, 3, 102, 103, 55, 116, 56, 87, 50, 113, 27, 43, 73, 124, 100, 89, 23, 107, 93, 14, 53, 20, 105, 121, 78, 81, 12, 71, 31, 57, 28, 72, 118, 84, 38, 106, 120, 37, 35, 13, 22, 69, 44, 96, 65, 17, 74, 52, 117, 62, 63, 109, 41, 32, 26, 59, 61, 58, 70, 2, 25, 5, 122, 1, 79, 85, 115, 48, 123, 18, 66, 46, 91, 30, 4, 6, 40, 49, 77, 34, 9, 82, 39, 47, 86, 10, 119, 92, 67, 101, 29, 98, 24, 8, 7, 19, 104, 99, 111, 125, 54, 11, 45, 80, 110, 114, 60]
,[112, 94, 75, 33, 3, 16, 103, 55, 116, 87, 56, 50, 113, 43, 73, 124, 100, 102, 89, 93, 23, 107, 53, 14, 121, 81, 20, 27, 105, 12, 31, 72, 118, 84, 28, 106, 120, 78, 37, 22, 35, 13, 71, 96, 17, 69, 57, 44, 65, 52, 117, 41, 74, 26, 63, 38, 59, 32, 109, 58, 61, 70, 2, 1, 5, 122, 79, 123, 48, 115, 18, 62, 91, 46, 4, 6, 40, 77, 85, 25, 49, 34, 9, 82, 39, 66, 47, 119, 10, 92, 30, 67, 101, 29, 86, 98, 8, 19, 104, 99, 7, 111, 24, 45, 11, 125, 80, 54, 114, 60, 110]
,[94, 33, 3, 55, 103, 116, 87, 75, 56, 113, 50, 43, 73, 16, 102, 100, 124, 93, 107, 23, 53, 14, 27, 121, 20, 12, 89, 31, 118, 72, 106, 84, 81, 37, 105, 120, 35, 22, 71, 13, 69, 57, 17, 65, 96, 44, 52, 117, 74, 41, 26, 28, 59, 63, 109, 58, 32, 61, 78, 2, 1, 122, 5, 123, 79, 115, 48, 91, 18, 46, 4, 38, 6, 70, 77, 9, 49, 34, 25, 82, 39, 10, 66, 119, 92, 47, 62, 30, 67, 29, 40, 85, 86, 98, 8, 19, 101, 104, 99, 7, 111, 24, 125, 80, 54, 45, 11, 114, 60, 110]
,[55, 103, 116, 75, 56, 87, 50, 43, 33, 73, 113, 3, 102, 16, 100, 124, 93, 23, 53, 107, 14, 121, 27, 12, 89, 118, 84, 72, 37, 81, 20, 105, 120, 13, 71, 22, 57, 31, 44, 65, 52, 17, 74, 117, 41, 26, 106, 28, 59, 109, 58, 63, 32, 61, 78, 2, 5, 79, 122, 1, 69, 35, 48, 96, 18, 91, 46, 4, 38, 6, 77, 9, 49, 25, 34, 123, 39, 47, 92, 66, 10, 119, 62, 115, 30, 70, 29, 40, 85, 8, 82, 98, 86, 67, 19, 101, 7, 104, 99, 111, 24, 125, 80, 11, 114, 54, 60, 110, 45]
,[103, 75, 50, 33, 43, 73, 113, 102, 3, 16, 124, 93, 23, 116, 107, 14, 121, 56, 27, 87, 100, 12, 89, 118, 53, 84, 72, 37, 105, 20, 22, 71, 13, 44, 57, 31, 65, 52, 117, 17, 26, 106, 28, 59, 81, 58, 109, 120, 78, 32, 61, 5, 79, 122, 1, 69, 35, 74, 96, 18, 41, 46, 91, 63, 4, 38, 6, 2, 9, 49, 77, 48, 25, 34, 123, 39, 47, 62, 66, 92, 10, 115, 30, 70, 29, 40, 85, 8, 82, 98, 119, 86, 67, 19, 101, 7, 99, 104, 111, 24, 125, 80, 11, 114, 54, 60, 45, 110]
,[50, 33, 43, 73, 113, 102, 3, 124, 93, 107, 23, 116, 56, 14, 75, 27, 121, 16, 12, 100, 89, 53, 118, 87, 84, 20, 22, 13, 44, 52, 65, 31, 117, 72, 28, 26, 105, 32, 59, 17, 37, 58, 120, 81, 61, 78, 5, 79, 71, 1, 122, 35, 57, 74, 18, 106, 96, 46, 41, 63, 109, 4, 38, 91, 6, 25, 2, 9, 77, 49, 34, 123, 39, 69, 115, 66, 62, 92, 10, 30, 70, 48, 29, 40, 8, 85, 82, 47, 98, 119, 86, 67, 7, 19, 99, 111, 101, 104, 24, 125, 80, 114, 60, 11, 54, 45, 110]
,[33, 113, 43, 3, 73, 124, 116, 56, 14, 121, 75, 12, 102, 16, 100, 93, 107, 23, 87, 118, 53, 84, 27, 20, 89, 13, 22, 31, 65, 44, 117, 59, 52, 72, 26, 81, 105, 32, 28, 78, 120, 37, 61, 5, 71, 122, 1, 35, 57, 17, 18, 74, 91, 106, 96, 41, 63, 109, 38, 4, 58, 6, 2, 79, 77, 25, 9, 34, 49, 69, 39, 123, 62, 92, 10, 115, 66, 46, 70, 48, 29, 40, 85, 86, 8, 119, 47, 98, 30, 67, 19, 104, 7, 99, 82, 24, 111, 125, 80, 101, 114, 11, 60, 54, 45, 110]
,[113, 43, 3, 73, 56, 75, 14, 121, 102, 124, 100, 16, 93, 116, 87, 23, 118, 53, 84, 27, 12, 20, 13, 22, 65, 31, 117, 44, 107, 26, 52, 59, 72, 32, 81, 105, 28, 78, 120, 37, 61, 122, 89, 1, 35, 57, 18, 74, 106, 41, 96, 38, 109, 63, 4, 6, 58, 2, 79, 5, 71, 25, 34, 9, 49, 69, 91, 39, 17, 62, 123, 92, 66, 46, 70, 77, 29, 40, 48, 119, 47, 98, 8, 85, 10, 115, 30, 19, 67, 104, 86, 99, 7, 82, 24, 111, 80, 125, 101, 11, 114, 60, 54, 45, 110]
,[73, 3, 14, 121, 43, 100, 124, 102, 16, 87, 23, 116, 56, 75, 93, 118, 53, 84, 12, 27, 65, 13, 31, 22, 44, 52, 59, 107, 32, 28, 72, 105, 78, 120, 81, 61, 20, 37, 122, 89, 35, 1, 57, 117, 74, 26, 41, 106, 96, 109, 4, 63, 58, 6, 2, 5, 79, 71, 25, 34, 49, 69, 9, 17, 18, 62, 39, 66, 92, 46, 38, 70, 29, 77, 40, 48, 47, 85, 119, 91, 10, 123, 115, 98, 67, 104, 7, 99, 82, 86, 30, 24, 8, 111, 80, 125, 19, 101, 114, 11, 54, 60, 110, 45]
,[3, 121, 124, 100, 102, 16, 23, 116, 87, 56, 14, 53, 84, 75, 118, 12, 27, 43, 65, 13, 22, 52, 44, 107, 105, 78, 72, 32, 28, 93, 120, 20, 81, 37, 61, 31, 1, 57, 35, 74, 89, 59, 26, 41, 109, 106, 4, 58, 63, 6, 2, 5, 122, 25, 34, 69, 71, 9, 49, 18, 17, 62, 66, 117, 46, 38, 39, 92, 96, 70, 79, 77, 48, 85, 115, 10, 47, 119, 91, 98, 123, 67, 29, 40, 7, 104, 99, 24, 30, 8, 111, 125, 19, 80, 101, 82, 86, 114, 54, 11, 60, 45, 110]
,[121, 102, 100, 124, 116, 23, 87, 14, 84, 27, 53, 43, 118, 12, 75, 16, 93, 13, 52, 56, 107, 44, 72, 81, 78, 105, 28, 37, 32, 61, 120, 20, 1, 65, 22, 74, 59, 41, 106, 26, 109, 63, 4, 6, 58, 5, 122, 25, 9, 69, 71, 49, 57, 35, 31, 18, 89, 92, 17, 66, 46, 38, 96, 62, 39, 2, 77, 79, 48, 70, 85, 34, 47, 117, 98, 91, 119, 123, 10, 67, 29, 104, 40, 8, 7, 99, 115, 111, 24, 30, 125, 19, 101, 82, 86, 80, 114, 54, 11, 60, 110, 45]
,[102, 100, 124, 116, 23, 87, 84, 27, 75, 14, 118, 12, 16, 93, 107, 52, 56, 72, 44, 53, 43, 28, 81, 32, 120, 61, 105, 37, 20, 1, 13, 41, 74, 26, 59, 109, 63, 4, 78, 58, 6, 5, 122, 25, 57, 9, 35, 49, 22, 71, 31, 65, 92, 18, 62, 66, 17, 39, 96, 106, 38, 70, 79, 2, 77, 34, 69, 48, 89, 117, 47, 85, 98, 123, 46, 91, 119, 67, 40, 104, 7, 29, 99, 115, 10, 111, 24, 30, 125, 19, 101, 82, 8, 86, 80, 114, 11, 60, 54, 110, 45]
,[100, 124, 87, 84, 116, 75, 118, 27, 14, 16, 93, 44, 107, 23, 56, 53, 43, 72, 28, 81, 20, 32, 105, 12, 61, 37, 1, 52, 109, 74, 26, 120, 4, 59, 78, 58, 6, 5, 122, 9, 57, 13, 22, 35, 25, 49, 41, 71, 31, 62, 65, 66, 96, 39, 106, 38, 63, 92, 70, 79, 34, 77, 2, 48, 69, 117, 89, 85, 47, 98, 18, 46, 17, 119, 91, 67, 40, 7, 104, 29, 123, 24, 10, 115, 111, 30, 125, 19, 101, 82, 99, 86, 8, 80, 11, 114, 60, 54, 45, 110]
,[124, 87, 84, 116, 75, 14, 27, 16, 44, 93, 56, 53, 118, 72, 107, 28, 37, 32, 105, 43, 12, 81, 61, 1, 52, 23, 74, 109, 26, 120, 20, 78, 58, 4, 6, 122, 5, 57, 9, 25, 13, 22, 31, 35, 65, 62, 106, 38, 39, 41, 63, 59, 92, 70, 79, 34, 2, 48, 71, 117, 89, 85, 49, 66, 96, 18, 46, 17, 98, 119, 91, 67, 77, 40, 7, 69, 104, 29, 123, 47, 24, 115, 10, 111, 30, 19, 101, 82, 99, 8, 86, 80, 125, 114, 60, 11, 54, 45, 110]
,[84, 27, 14, 116, 75, 16, 93, 56, 87, 53, 118, 72, 43, 28, 32, 37, 105, 12, 61, 1, 52, 44, 26, 74, 23, 107, 109, 78, 120, 20, 81, 6, 4, 5, 122, 25, 57, 22, 31, 35, 65, 62, 39, 92, 38, 59, 106, 63, 58, 70, 79, 2, 34, 48, 9, 13, 71, 117, 49, 66, 89, 96, 17, 18, 41, 119, 98, 91, 46, 77, 29, 104, 69, 40, 7, 123, 47, 24, 85, 115, 10, 30, 111, 67, 101, 99, 82, 8, 86, 80, 125, 114, 54, 19, 60, 45, 11, 110]
,[116, 75, 27, 14, 16, 93, 118, 87, 72, 28, 43, 105, 37, 32, 61, 52, 1, 56, 74, 53, 26, 44, 23, 109, 120, 78, 6, 12, 4, 20, 25, 57, 22, 31, 35, 92, 65, 62, 106, 38, 107, 59, 63, 81, 58, 79, 5, 34, 9, 122, 2, 48, 49, 117, 71, 66, 89, 17, 119, 18, 96, 98, 41, 91, 39, 46, 70, 77, 13, 29, 40, 104, 69, 123, 85, 7, 24, 10, 115, 30, 111, 67, 101, 8, 47, 99, 82, 86, 125, 80, 114, 54, 19, 60, 45, 11, 110]
,[75, 14, 16, 27, 28, 105, 43, 72, 37, 32, 1, 56, 53, 44, 74, 118, 87, 93, 109, 78, 23, 6, 120, 12, 26, 20, 4, 61, 25, 57, 31, 35, 22, 65, 52, 62, 106, 92, 107, 38, 63, 58, 59, 81, 79, 5, 34, 2, 122, 48, 71, 117, 89, 119, 49, 66, 96, 18, 98, 91, 39, 46, 70, 77, 29, 40, 9, 104, 13, 7, 24, 17, 85, 41, 10, 115, 30, 111, 67, 101, 69, 99, 123, 47, 8, 82, 86, 125, 80, 114, 19, 54, 60, 45, 11, 110]
,[14, 16, 27, 28, 105, 43, 93, 1, 44, 56, 53, 78, 74, 26, 23, 87, 120, 109, 72, 4, 12, 6, 37, 20, 32, 61, 25, 31, 35, 22, 57, 65, 52, 62, 118, 63, 38, 106, 92, 107, 58, 5, 48, 122, 89, 49, 66, 18, 117, 119, 96, 91, 98, 39, 81, 59, 46, 79, 70, 34, 77, 29, 2, 9, 71, 104, 13, 7, 17, 24, 85, 41, 10, 115, 111, 30, 67, 101, 40, 69, 8, 99, 123, 47, 86, 82, 125, 80, 114, 19, 54, 60, 11, 45, 110]
,[16, 105, 27, 43, 1, 44, 26, 53, 56, 23, 74, 28, 72, 109, 120, 4, 78, 12, 32, 37, 20, 61, 25, 93, 57, 31, 22, 118, 62, 38, 107, 52, 65, 87, 92, 6, 58, 5, 122, 35, 18, 48, 66, 49, 96, 117, 119, 63, 46, 106, 91, 98, 59, 39, 81, 70, 34, 77, 79, 104, 9, 29, 2, 89, 85, 17, 24, 111, 41, 10, 115, 30, 67, 101, 69, 40, 71, 7, 13, 123, 47, 99, 8, 82, 86, 80, 125, 114, 19, 54, 60, 11, 45, 110]
,[105, 27, 43, 1, 56, 26, 109, 120, 28, 78, 32, 4, 12, 37, 20, 61, 93, 22, 57, 31, 44, 52, 87, 65, 118, 107, 62, 38, 53, 23, 92, 74, 72, 58, 6, 5, 25, 48, 122, 18, 117, 35, 49, 66, 98, 119, 46, 39, 91, 106, 59, 96, 63, 81, 70, 34, 79, 77, 2, 9, 104, 17, 24, 85, 115, 111, 41, 10, 30, 67, 29, 69, 7, 99, 47, 89, 123, 13, 71, 82, 8, 86, 125, 114, 101, 19, 40, 54, 60, 80, 11, 45, 110]
,[27, 43, 1, 56, 109, 120, 26, 28, 32, 37, 4, 12, 20, 61, 22, 31, 93, 44, 57, 52, 87, 65, 107, 53, 118, 23, 74, 62, 72, 92, 78, 48, 5, 18, 25, 35, 66, 91, 38, 119, 98, 96, 39, 106, 59, 63, 81, 6, 58, 70, 79, 34, 2, 9, 117, 122, 49, 85, 17, 24, 115, 46, 10, 41, 111, 30, 77, 67, 123, 29, 104, 89, 7, 47, 13, 99, 71, 69, 82, 8, 86, 114, 125, 101, 40, 54, 19, 60, 80, 11, 45, 110]
,[43, 1, 56, 120, 109, 37, 28, 12, 4, 32, 20, 61, 22, 52, 87, 65, 107, 92, 118, 23, 72, 53, 26, 78, 48, 25, 35, 93, 31, 44, 66, 91, 106, 57, 96, 98, 119, 39, 38, 74, 62, 59, 81, 63, 6, 58, 5, 70, 79, 2, 34, 122, 117, 9, 17, 49, 85, 24, 18, 115, 10, 46, 41, 111, 30, 77, 67, 123, 7, 104, 29, 89, 13, 71, 8, 47, 99, 69, 82, 86, 114, 19, 40, 101, 54, 60, 80, 125, 11, 45, 110]
,[1, 56, 28, 120, 109, 32, 4, 20, 61, 22, 52, 118, 87, 53, 107, 23, 72, 26, 37, 78, 12, 25, 48, 35, 31, 57, 44, 98, 66, 65, 91, 106, 74, 96, 39, 38, 63, 92, 62, 59, 81, 6, 58, 5, 79, 34, 122, 2, 117, 9, 24, 49, 93, 18, 85, 115, 119, 10, 46, 41, 30, 111, 77, 70, 67, 123, 29, 7, 69, 104, 17, 89, 13, 99, 47, 82, 8, 86, 114, 19, 101, 54, 40, 71, 60, 80, 45, 11, 125, 110]
,[28, 120, 32, 61, 4, 20, 22, 26, 52, 56, 109, 23, 107, 72, 78, 25, 35, 48, 31, 57, 118, 66, 74, 92, 53, 98, 44, 65, 59, 91, 87, 96, 38, 62, 63, 39, 81, 37, 58, 12, 6, 5, 79, 34, 2, 122, 93, 24, 117, 9, 18, 49, 115, 119, 106, 85, 111, 10, 46, 30, 41, 77, 70, 123, 69, 7, 13, 104, 89, 29, 17, 99, 47, 82, 8, 86, 67, 114, 54, 19, 101, 71, 40, 60, 80, 11, 45, 125, 110]
,[120, 32, 61, 20, 4, 22, 56, 52, 26, 23, 109, 107, 78, 35, 57, 44, 66, 65, 59, 118, 53, 91, 92, 62, 98, 74, 87, 39, 72, 58, 81, 63, 12, 37, 6, 34, 25, 2, 48, 122, 31, 93, 9, 117, 24, 18, 49, 106, 115, 119, 96, 111, 46, 10, 38, 41, 30, 70, 77, 5, 79, 69, 29, 7, 123, 47, 99, 17, 104, 13, 85, 82, 89, 86, 8, 67, 114, 54, 19, 71, 101, 40, 60, 80, 11, 45, 125, 110]
,[20, 4, 22, 26, 56, 52, 23, 109, 32, 107, 78, 61, 57, 118, 44, 65, 59, 66, 53, 74, 62, 98, 87, 37, 39, 72, 58, 81, 63, 6, 12, 34, 25, 122, 48, 35, 9, 31, 93, 18, 49, 117, 119, 106, 41, 46, 115, 38, 92, 96, 91, 111, 10, 30, 70, 5, 79, 29, 2, 69, 7, 17, 123, 24, 104, 47, 99, 89, 13, 8, 82, 85, 77, 67, 54, 114, 19, 71, 101, 40, 60, 86, 80, 45, 11, 125, 110]
,[4, 22, 52, 26, 109, 78, 32, 56, 23, 61, 44, 65, 57, 118, 98, 62, 59, 66, 72, 37, 39, 87, 53, 12, 58, 63, 81, 107, 6, 25, 34, 48, 31, 122, 9, 49, 18, 93, 117, 46, 106, 119, 96, 115, 92, 111, 38, 41, 74, 30, 79, 69, 35, 7, 29, 47, 99, 17, 82, 104, 123, 85, 89, 24, 91, 8, 13, 10, 77, 70, 5, 67, 2, 114, 101, 71, 40, 54, 60, 86, 80, 45, 11, 19, 125, 110]
,[52, 56, 32, 26, 78, 109, 23, 61, 44, 65, 98, 57, 118, 22, 66, 72, 53, 62, 59, 87, 12, 39, 37, 107, 58, 81, 6, 63, 122, 18, 117, 49, 9, 119, 46, 96, 115, 74, 106, 38, 41, 92, 30, 111, 79, 34, 48, 25, 31, 7, 47, 29, 35, 99, 17, 82, 104, 123, 24, 93, 91, 13, 89, 8, 10, 70, 67, 5, 2, 114, 101, 71, 54, 69, 40, 60, 85, 86, 77, 80, 45, 11, 19, 125, 110]
,[56, 32, 23, 78, 109, 44, 98, 65, 22, 118, 57, 66, 59, 53, 26, 39, 107, 87, 62, 12, 58, 81, 63, 37, 61, 6, 122, 117, 49, 119, 9, 96, 74, 115, 106, 72, 38, 111, 41, 30, 34, 79, 25, 7, 31, 18, 29, 93, 35, 17, 47, 24, 82, 104, 99, 123, 91, 46, 92, 89, 13, 8, 10, 70, 67, 5, 2, 48, 114, 101, 69, 54, 40, 85, 60, 86, 77, 80, 11, 45, 19, 71, 125, 110]
,[32, 78, 23, 109, 65, 98, 59, 118, 22, 57, 107, 53, 81, 58, 12, 62, 63, 87, 61, 37, 6, 44, 122, 49, 117, 96, 119, 9, 26, 115, 74, 39, 66, 72, 41, 38, 111, 30, 34, 25, 31, 79, 18, 7, 35, 47, 29, 99, 24, 104, 82, 91, 123, 92, 106, 46, 89, 13, 10, 8, 70, 67, 5, 48, 114, 93, 101, 69, 17, 40, 54, 85, 60, 86, 77, 80, 2, 45, 11, 19, 71, 125, 110]
,[78, 109, 65, 98, 59, 57, 118, 22, 107, 53, 81, 37, 23, 58, 87, 12, 61, 6, 44, 49, 122, 96, 119, 26, 41, 115, 66, 74, 39, 72, 38, 111, 63, 62, 30, 31, 7, 25, 79, 18, 35, 29, 117, 104, 99, 24, 92, 47, 123, 91, 9, 8, 106, 46, 13, 89, 10, 70, 5, 48, 114, 34, 93, 101, 17, 54, 40, 69, 82, 85, 60, 86, 67, 80, 77, 2, 71, 11, 45, 19, 125, 110]
,[109, 98, 59, 65, 57, 118, 22, 53, 37, 87, 107, 81, 58, 23, 61, 122, 44, 49, 96, 26, 66, 41, 74, 115, 72, 39, 12, 111, 38, 63, 6, 62, 30, 31, 18, 79, 35, 117, 123, 119, 104, 9, 106, 47, 91, 8, 92, 46, 89, 99, 10, 70, 5, 34, 25, 48, 7, 101, 93, 114, 17, 40, 69, 24, 82, 54, 29, 85, 60, 13, 86, 67, 80, 77, 11, 19, 2, 45, 71, 125, 110]
,[98, 22, 65, 59, 57, 53, 23, 81, 58, 107, 37, 61, 87, 122, 118, 74, 26, 66, 12, 72, 41, 115, 38, 39, 111, 63, 6, 62, 30, 31, 18, 79, 44, 49, 35, 123, 96, 117, 104, 47, 9, 119, 91, 46, 106, 92, 8, 89, 10, 70, 5, 34, 25, 29, 101, 54, 7, 114, 17, 24, 40, 82, 99, 69, 60, 86, 13, 67, 77, 80, 48, 2, 11, 19, 71, 93, 45, 85, 125, 110]
,[65, 22, 23, 57, 53, 81, 107, 61, 87, 122, 118, 59, 74, 12, 66, 72, 115, 39, 58, 111, 63, 62, 30, 41, 37, 6, 31, 44, 49, 18, 79, 35, 96, 117, 47, 104, 9, 91, 119, 106, 26, 46, 38, 92, 89, 10, 8, 70, 5, 34, 114, 7, 25, 101, 29, 54, 40, 17, 24, 123, 82, 99, 69, 13, 86, 67, 77, 80, 48, 2, 71, 11, 93, 45, 85, 19, 60, 110, 125]
,[22, 23, 53, 57, 61, 107, 87, 122, 118, 74, 66, 115, 81, 12, 41, 58, 39, 63, 37, 62, 30, 44, 79, 31, 49, 35, 96, 47, 117, 59, 91, 106, 9, 119, 92, 104, 46, 26, 72, 8, 89, 38, 111, 10, 6, 70, 5, 18, 34, 25, 7, 29, 114, 54, 101, 40, 82, 99, 24, 123, 69, 17, 86, 67, 77, 80, 48, 93, 2, 19, 11, 71, 45, 85, 60, 13, 125, 110]
,[57, 53, 107, 87, 122, 118, 74, 66, 115, 12, 81, 58, 41, 63, 23, 39, 61, 62, 30, 44, 79, 49, 35, 117, 96, 59, 9, 47, 119, 92, 104, 46, 26, 8, 72, 89, 38, 10, 111, 37, 6, 70, 18, 34, 7, 25, 31, 114, 101, 29, 82, 99, 54, 106, 17, 24, 40, 123, 69, 91, 86, 67, 77, 5, 80, 93, 2, 48, 71, 11, 45, 85, 19, 60, 13, 125, 110]
,[107, 87, 122, 12, 115, 66, 81, 58, 23, 39, 53, 61, 63, 41, 62, 30, 79, 35, 96, 117, 118, 47, 59, 9, 119, 46, 92, 74, 26, 72, 104, 89, 8, 38, 111, 10, 37, 6, 70, 34, 7, 44, 31, 25, 49, 114, 101, 82, 99, 54, 29, 24, 123, 17, 106, 40, 91, 69, 86, 67, 77, 18, 80, 5, 93, 2, 71, 11, 45, 85, 19, 60, 13, 125, 110, 48]
,[87, 122, 12, 66, 81, 61, 115, 53, 63, 62, 41, 39, 30, 35, 96, 47, 79, 117, 9, 119, 46, 92, 74, 26, 104, 72, 89, 58, 38, 111, 8, 10, 23, 37, 6, 44, 31, 25, 101, 99, 34, 7, 82, 114, 29, 54, 118, 17, 40, 49, 24, 106, 59, 123, 69, 91, 86, 18, 70, 80, 5, 11, 2, 85, 71, 93, 45, 19, 60, 13, 110, 125, 77, 67, 48]
,[122, 12, 66, 115, 61, 63, 53, 39, 41, 62, 30, 79, 35, 47, 9, 117, 46, 74, 26, 119, 72, 104, 81, 58, 38, 8, 23, 111, 10, 89, 37, 6, 44, 25, 34, 99, 96, 82, 7, 54, 114, 29, 101, 118, 17, 106, 24, 123, 40, 59, 92, 91, 69, 86, 18, 70, 31, 5, 80, 49, 2, 71, 85, 11, 45, 19, 60, 13, 77, 125, 110, 93, 48, 67]
,[12, 66, 61, 115, 63, 41, 62, 30, 79, 35, 47, 9, 117, 46, 74, 119, 104, 26, 38, 81, 53, 23, 111, 8, 89, 10, 37, 39, 6, 44, 25, 96, 99, 54, 114, 34, 82, 118, 7, 24, 101, 17, 40, 29, 123, 92, 72, 91, 69, 86, 58, 18, 70, 31, 5, 71, 2, 80, 85, 49, 45, 106, 11, 19, 59, 60, 13, 125, 77, 110, 93, 48, 67]
,[61, 66, 63, 115, 41, 30, 62, 35, 79, 47, 117, 119, 46, 74, 26, 53, 38, 111, 81, 23, 10, 37, 39, 6, 25, 99, 44, 54, 34, 96, 118, 7, 9, 82, 123, 101, 17, 29, 24, 40, 72, 91, 104, 86, 58, 69, 89, 8, 70, 18, 5, 31, 114, 71, 2, 49, 80, 106, 11, 85, 19, 92, 45, 59, 60, 13, 125, 77, 110, 93, 48, 67]
,[115, 63, 41, 30, 62, 117, 119, 74, 46, 26, 53, 38, 23, 111, 66, 81, 10, 37, 39, 6, 44, 54, 34, 25, 99, 47, 7, 9, 96, 79, 35, 118, 29, 101, 123, 17, 24, 72, 82, 40, 91, 104, 86, 69, 8, 89, 58, 70, 18, 5, 31, 114, 71, 85, 2, 49, 45, 11, 106, 59, 92, 60, 13, 125, 77, 110, 48, 93, 80, 19, 67]
,[41, 62, 30, 117, 46, 53, 26, 74, 38, 63, 23, 10, 111, 37, 81, 39, 6, 47, 99, 34, 9, 7, 44, 54, 118, 25, 29, 17, 24, 82, 104, 40, 79, 72, 91, 101, 86, 119, 123, 66, 69, 58, 8, 89, 70, 18, 5, 31, 114, 71, 35, 96, 85, 49, 45, 2, 11, 106, 59, 92, 60, 13, 125, 77, 93, 110, 48, 80, 19, 67]
,[30, 62, 117, 46, 53, 74, 38, 26, 10, 63, 81, 39, 6, 47, 99, 34, 9, 7, 44, 54, 118, 29, 82, 104, 72, 25, 91, 17, 79, 24, 40, 123, 101, 86, 119, 66, 111, 8, 58, 69, 37, 23, 89, 18, 114, 5, 31, 71, 35, 85, 96, 2, 11, 106, 45, 59, 92, 60, 13, 77, 70, 93, 110, 48, 80, 49, 19, 125, 67]
,[62, 117, 46, 74, 38, 26, 53, 63, 81, 10, 39, 6, 34, 47, 99, 9, 118, 82, 29, 25, 24, 123, 79, 40, 101, 72, 91, 66, 86, 104, 119, 111, 69, 89, 58, 8, 23, 37, 114, 5, 31, 7, 44, 54, 35, 85, 96, 2, 11, 17, 106, 45, 59, 92, 60, 13, 77, 18, 70, 93, 110, 71, 48, 80, 49, 19, 125, 67]
,[74, 46, 38, 26, 53, 63, 81, 10, 39, 6, 9, 99, 29, 117, 25, 79, 123, 118, 82, 40, 101, 72, 104, 91, 66, 86, 8, 23, 69, 119, 37, 89, 58, 111, 47, 34, 5, 31, 7, 54, 44, 35, 96, 85, 114, 106, 11, 45, 24, 2, 17, 59, 92, 13, 60, 77, 71, 70, 48, 110, 80, 49, 19, 125, 18, 93, 67]
,[38, 46, 53, 26, 81, 10, 39, 6, 99, 29, 117, 82, 118, 25, 72, 79, 101, 123, 91, 86, 63, 104, 89, 119, 111, 69, 8, 23, 58, 37, 47, 9, 34, 31, 7, 54, 44, 35, 114, 96, 11, 40, 17, 85, 24, 106, 2, 66, 59, 45, 92, 60, 13, 70, 77, 5, 110, 71, 48, 80, 49, 19, 125, 18, 93, 67]
,[53, 26, 81, 39, 10, 6, 117, 29, 118, 79, 72, 123, 82, 91, 101, 86, 46, 89, 119, 111, 63, 69, 58, 8, 37, 23, 34, 31, 7, 54, 44, 9, 114, 96, 47, 99, 11, 35, 25, 40, 17, 85, 24, 2, 66, 106, 104, 45, 59, 60, 92, 13, 70, 77, 110, 71, 48, 80, 49, 19, 125, 5, 93, 18, 67]
,[26, 39, 10, 6, 117, 79, 72, 118, 123, 101, 86, 89, 63, 82, 111, 81, 69, 119, 37, 58, 8, 23, 46, 34, 9, 31, 29, 7, 96, 114, 54, 11, 99, 47, 40, 17, 25, 85, 35, 104, 24, 91, 106, 59, 45, 66, 92, 60, 13, 70, 77, 71, 44, 110, 48, 80, 49, 2, 19, 125, 5, 93, 18, 67]
,[39, 10, 6, 117, 118, 82, 123, 101, 89, 111, 81, 86, 58, 63, 119, 46, 69, 8, 23, 34, 31, 7, 96, 47, 99, 114, 29, 54, 25, 85, 79, 72, 40, 17, 24, 91, 35, 106, 66, 104, 59, 45, 92, 60, 37, 13, 70, 77, 71, 44, 9, 110, 80, 49, 11, 48, 2, 19, 125, 5, 93, 18, 67]
,[10, 6, 118, 123, 101, 111, 81, 89, 58, 63, 86, 46, 119, 8, 69, 23, 34, 31, 117, 7, 96, 114, 54, 25, 85, 79, 72, 47, 99, 82, 40, 104, 17, 29, 24, 91, 35, 45, 66, 92, 60, 37, 13, 70, 9, 44, 71, 110, 80, 48, 2, 49, 11, 19, 106, 59, 125, 5, 77, 93, 18, 67]
,[6, 123, 101, 111, 81, 86, 89, 69, 8, 63, 58, 23, 119, 46, 31, 96, 7, 114, 117, 25, 85, 47, 99, 72, 82, 79, 40, 17, 24, 35, 104, 45, 66, 91, 60, 92, 118, 37, 13, 70, 9, 44, 110, 54, 34, 80, 48, 2, 29, 49, 11, 19, 106, 59, 125, 5, 77, 71, 93, 18, 67]
,[123, 101, 86, 111, 81, 89, 69, 63, 8, 58, 46, 119, 23, 96, 7, 25, 47, 99, 117, 85, 72, 82, 79, 40, 17, 35, 24, 66, 45, 91, 60, 92, 118, 37, 13, 44, 9, 31, 80, 34, 110, 54, 114, 48, 2, 29, 49, 11, 19, 104, 106, 59, 5, 70, 77, 71, 93, 18, 125, 67]
,[111, 81, 89, 69, 101, 63, 8, 58, 46, 119, 23, 96, 25, 7, 85, 99, 47, 82, 117, 79, 40, 35, 17, 45, 60, 118, 86, 24, 37, 92, 13, 9, 44, 31, 80, 114, 110, 34, 72, 48, 54, 104, 29, 49, 2, 91, 66, 11, 19, 59, 106, 5, 70, 77, 71, 93, 18, 125, 67]
,[101, 69, 8, 58, 63, 81, 119, 46, 89, 23, 96, 25, 85, 7, 47, 99, 82, 117, 79, 40, 35, 86, 118, 60, 92, 37, 13, 9, 44, 80, 110, 34, 48, 29, 54, 114, 49, 72, 2, 19, 11, 66, 17, 45, 104, 91, 24, 59, 106, 5, 70, 31, 77, 71, 18, 93, 125, 67]
,[58, 69, 8, 81, 46, 23, 89, 119, 7, 85, 99, 47, 82, 117, 25, 40, 35, 79, 86, 118, 60, 63, 92, 37, 13, 96, 44, 9, 80, 34, 110, 48, 54, 29, 114, 49, 19, 2, 66, 11, 45, 17, 91, 24, 59, 106, 31, 5, 70, 71, 77, 72, 93, 18, 104, 125, 67]
,[69, 46, 81, 119, 89, 23, 85, 47, 99, 82, 25, 117, 35, 79, 40, 60, 86, 37, 8, 118, 63, 92, 13, 96, 9, 44, 7, 48, 110, 54, 114, 29, 49, 2, 66, 11, 19, 45, 91, 24, 59, 106, 17, 5, 70, 31, 71, 80, 77, 34, 72, 93, 18, 104, 67, 125]
,[81, 119, 46, 89, 117, 35, 82, 25, 79, 40, 99, 47, 60, 63, 118, 37, 86, 8, 92, 23, 13, 96, 85, 44, 7, 48, 110, 29, 54, 114, 11, 19, 2, 66, 45, 17, 91, 24, 106, 59, 9, 31, 71, 70, 5, 80, 34, 77, 49, 72, 93, 104, 18, 125, 67]
,[119, 46, 89, 47, 99, 82, 117, 79, 25, 40, 118, 63, 60, 37, 8, 92, 86, 23, 13, 96, 44, 85, 48, 110, 35, 54, 29, 19, 2, 66, 11, 17, 106, 91, 59, 24, 31, 9, 71, 7, 80, 34, 77, 5, 70, 114, 49, 72, 45, 18, 93, 104, 125, 67]
,[46, 89, 47, 99, 82, 25, 79, 40, 60, 37, 63, 92, 118, 8, 86, 13, 23, 85, 117, 48, 110, 35, 29, 11, 2, 19, 66, 17, 106, 91, 24, 59, 31, 96, 9, 71, 7, 5, 70, 44, 34, 80, 77, 114, 54, 49, 72, 104, 45, 93, 18, 67, 125]
,[89, 82, 63, 40, 23, 79, 37, 8, 118, 92, 25, 13, 86, 60, 85, 47, 99, 35, 48, 110, 117, 17, 66, 2, 19, 11, 91, 24, 59, 106, 31, 96, 80, 7, 34, 71, 77, 44, 70, 5, 54, 114, 72, 49, 29, 104, 18, 45, 93, 125, 67, 9]
,[25, 79, 60, 37, 40, 63, 92, 8, 118, 13, 86, 23, 117, 48, 110, 35, 11, 19, 2, 66, 47, 82, 99, 17, 24, 91, 59, 106, 5, 70, 71, 7, 44, 34, 80, 85, 77, 114, 54, 29, 49, 72, 45, 104, 93, 18, 31, 9, 67, 125, 96]
,[40, 60, 37, 79, 92, 118, 8, 13, 86, 117, 48, 110, 11, 19, 2, 66, 17, 63, 91, 24, 59, 106, 47, 82, 99, 23, 7, 71, 44, 34, 80, 35, 85, 5, 70, 29, 49, 114, 54, 77, 72, 18, 104, 45, 93, 31, 67, 125, 9, 96]
,[60, 79, 118, 92, 13, 86, 117, 11, 48, 19, 2, 66, 47, 99, 82, 110, 37, 63, 17, 24, 91, 8, 59, 106, 23, 7, 71, 35, 34, 80, 70, 5, 114, 54, 29, 44, 49, 77, 72, 18, 93, 104, 45, 67, 9, 96, 125, 85, 31]
,[79, 118, 13, 86, 117, 47, 82, 99, 11, 48, 2, 63, 66, 37, 110, 59, 91, 24, 8, 92, 23, 106, 71, 7, 35, 34, 77, 80, 19, 5, 29, 70, 114, 54, 44, 49, 18, 45, 72, 17, 104, 93, 125, 31, 96, 85, 9, 67]
,[86, 13, 117, 11, 48, 2, 99, 82, 47, 66, 110, 37, 24, 91, 8, 59, 118, 92, 23, 106, 71, 7, 54, 114, 80, 44, 34, 49, 5, 29, 19, 70, 104, 93, 72, 63, 17, 77, 18, 45, 125, 35, 9, 85, 31, 67, 96]
,[13, 48, 2, 99, 47, 82, 66, 37, 110, 24, 91, 8, 92, 23, 106, 118, 59, 71, 11, 49, 34, 70, 5, 19, 29, 117, 114, 54, 80, 44, 45, 18, 93, 104, 17, 77, 63, 72, 85, 125, 7, 9, 67, 31, 35, 96]
,[82, 99, 47, 110, 24, 91, 92, 66, 8, 37, 23, 118, 106, 59, 34, 19, 117, 29, 49, 70, 5, 11, 114, 80, 54, 2, 44, 48, 18, 72, 45, 93, 63, 77, 104, 17, 35, 85, 125, 71, 31, 7, 96, 67, 9]
,[110, 37, 8, 24, 66, 91, 92, 118, 59, 23, 106, 19, 70, 5, 11, 117, 49, 29, 34, 48, 44, 2, 54, 80, 114, 18, 93, 77, 17, 63, 45, 104, 72, 99, 47, 85, 31, 35, 71, 7, 67, 125, 9, 96]
,[24, 91, 92, 66, 118, 23, 59, 106, 5, 117, 11, 19, 70, 49, 34, 29, 80, 114, 2, 54, 8, 45, 37, 44, 18, 63, 72, 77, 93, 99, 17, 104, 48, 47, 7, 67, 9, 31, 35, 96, 71, 125, 85]
,[66, 92, 118, 23, 59, 106, 5, 34, 29, 49, 117, 11, 19, 70, 80, 2, 44, 18, 45, 17, 37, 63, 77, 54, 93, 47, 72, 91, 104, 8, 48, 99, 96, 71, 9, 125, 114, 35, 31, 7, 85, 67]
,[23, 118, 59, 106, 34, 49, 117, 5, 29, 19, 70, 11, 72, 18, 37, 44, 48, 80, 92, 93, 104, 8, 63, 77, 17, 47, 54, 91, 99, 45, 2, 31, 85, 125, 96, 7, 71, 9, 114, 35, 67]
,[59, 118, 106, 117, 29, 19, 34, 49, 11, 18, 99, 44, 77, 91, 8, 37, 45, 54, 92, 17, 48, 47, 63, 80, 72, 93, 104, 9, 31, 2, 70, 125, 5, 35, 96, 67, 71, 85, 114, 7]
,[118, 106, 117, 19, 34, 29, 8, 54, 91, 92, 93, 37, 45, 48, 99, 104, 17, 18, 44, 72, 77, 80, 47, 63, 2, 5, 35, 114, 125, 11, 67, 85, 96, 31, 9, 49, 71, 7, 70]
,[106, 19, 29, 45, 91, 93, 80, 18, 92, 37, 63, 77, 104, 47, 54, 72, 17, 48, 99, 44, 8, 7, 34, 70, 35, 11, 31, 71, 117, 67, 114, 125, 85, 5, 2, 9, 96, 49]
,[37, 45, 77, 80, 93, 104, 18, 17, 48, 54, 8, 47, 72, 91, 92, 99, 44, 63, 7, 70, 5, 35, 96, 9, 29, 49, 67, 117, 34, 85, 125, 31, 71, 19, 11, 114, 2]
,[8, 77, 44, 72, 91, 80, 92, 93, 45, 47, 99, 17, 63, 18, 104, 54, 5, 35, 9, 48, 29, 31, 34, 125, 7, 71, 19, 67, 70, 85, 96, 11, 114, 117, 49, 2]
,[63, 17, 45, 47, 77, 92, 18, 72, 93, 54, 80, 91, 99, 104, 31, 117, 2, 7, 9, 11, 85, 125, 19, 34, 48, 67, 70, 35, 96, 114, 5, 44, 71, 29, 49]
,[91, 54, 72, 99, 45, 47, 80, 18, 92, 93, 17, 104, 117, 7, 11, 29, 35, 67, 85, 5, 34, 125, 31, 96, 44, 9, 70, 19, 48, 49, 77, 2, 114, 71]
,[45, 93, 17, 47, 80, 92, 104, 18, 99, 72, 117, 35, 125, 11, 71, 114, 48, 31, 54, 77, 2, 5, 44, 49, 85, 7, 29, 34, 96, 9, 67, 70, 19]
,[17, 92, 99, 47, 72, 80, 104, 18, 67, 96, 114, 35, 93, 7, 44, 31, 48, 19, 11, 2, 125, 70, 49, 5, 77, 117, 9, 34, 71, 85, 29, 54]
,[47, 104, 80, 99, 18, 92, 31, 11, 29, 5, 9, 48, 7, 77, 93, 19, 44, 70, 96, 117, 34, 71, 35, 49, 72, 85, 114, 67, 125, 54, 2]
,[18, 80, 104, 92, 29, 49, 48, 117, 35, 5, 11, 72, 125, 77, 93, 7, 67, 9, 44, 54, 96, 19, 31, 114, 85, 70, 71, 2, 34, 99]
,[80, 92, 49, 2, 9, 31, 93, 5, 48, 99, 117, 77, 85, 104, 54, 67, 70, 72, 114, 34, 7, 71, 35, 44, 125, 19, 29, 96, 11]
,[2, 11, 67, 29, 19, 31, 104, 49, 70, 54, 9, 93, 71, 35, 34, 48, 125, 77, 117, 96, 99, 114, 44, 85, 92, 7, 72, 5]]
'''
graph = graphConv(filename)
nodes = {}
for i in range(1, 126):
nodes[i] = [0, 0]
for order in orderings:
size = len(order)
for i in range(len(order)):
nodes[order[i]][1] += 1
nodes[order[i]][0] += (size - i)
frequency = []
for node in nodes.keys():
frequency.append((node, float(nodes[node][0] / float(nodes[node][1]))))
frequency = sorted(frequency, key=itemgetter(1))
#print(frequency)
graph = graphConv(filename)
print(graph[60])
'''
'''
clique = [2, 5, 7, 9, 11, 19, 29, 31, 34, 35, 44, 48, 49, 54, 67, 70, 71, 72, 77, 85, 92, 93, 96, 99, 104, 114, 117, 125]
graph = graphConv(filename)
additional = []
for key in graph.keys():
if key not in clique:
neighbors = graph[key]
flag = True
for member in clique:
if member not in neighbors:
flag = False
break
if flag:
additional.append(key)
checkClique(additional, graph)
'''
#space5000 = [36, 83, 108, 75, 76, 51, 90, 73, 88, 42, 113, 15, 97, 16, 64, 95, 94, 3, 68, 103, 33, 17, 116, 50, 12, 81, 100, 89, 55, 14, 63, 38, 105, 78, 21, 102, 112, 71, 93, 28, 56, 32, 61, 120, 87, 124, 122, 66, 23, 26, 53, 62, 84, 20, 27, 106, 37, 43, 107, 121, 79, 35, 117, 115, 31, 69, 13, 5, 118, 4, 1, 91, 57, 44, 109, 72, 58, 25, 2, 9, 96, 85, 48, 86, 119, 52, 30, 46, 74, 41, 6, 77, 82, 123, 22, 34, 92, 65, 10, 59, 70, 47, 24, 18, 39, 67, 125, 40, 29, 11, 49, 98, 80, 7, 110, 99, 101, 19, 8, 45, 111, 104, 54, 114, 60]
#space15000 = [36, 83, 108, 75, 76, 51, 90, 73, 88, 97, 42, 113, 15, 64, 16, 95, 94, 3, 103, 68, 17, 33, 116, 50, 12, 81, 100, 89, 55, 63, 14, 102, 38, 21, 105, 78, 112, 71, 32, 56, 87, 93, 120, 28, 61, 124, 122, 66, 53, 62, 26, 43, 27, 23, 84, 107, 20, 106, 37, 121, 79, 35, 1, 5, 117, 69, 13, 31, 115, 72, 91, 118, 44, 58, 4, 57, 109, 25, 85, 2, 96, 9, 86, 30, 119, 74, 48, 46, 52, 6, 41, 34, 77, 92, 82, 123, 10, 22, 65, 59, 70, 24, 47, 39, 18, 125, 29, 11, 40, 67, 49, 98, 80, 19, 7, 99, 110, 101, 8, 45, 104, 111, 114, 60, 54]
def worstGraph(n, k):
size = (k*(n-1)) + n
retGraph = {}
for i in range(1, (size - n + 1)):
neighbors = []
unMod = i%(n-1)
for j in range(1, (size-n+1)):
if (j%(n-1)) != unMod:
neighbors.append(j)
if i == 1:
neighbors.append(size)
retGraph[i] = neighbors
for x in range((size-n+1), (size+1)):
neighbors = []
for y in range((size-n+1), (size+1)):
if y != x:
neighbors.append(y)
if x == size:
neighbors.append(1)
retGraph[x] = neighbors
return retGraph
'''
#newGraph = worstGraph(6, 5)
#main(filename, 31, True, newGraph)
For worstGraph(6, 5), the "final convergent point":
(I put "" around that, because all those of the 6-clique (beside that
one connected to one of the 5 5-cliques) were still like 1500 units of
distance away from all those of the 5 5-cliques, and it didn't look like
it was going to converge any time soon (or rather, it was... but like at
decimal pace every 100 rounds))
cPoint = np.asarray([2447.77430702,1413.22315507,999.29967628,774.05420082,629.99564124,
534.48907473,462.88111676,408.22277385,365.12554891,328.16183206,
301.68480958,277.50966271,256.92402362,239.18324925,221.59612608,
210.29682284,198.26974599,187.54440414,177.92024385,167.0796803,
161.46290208,154.28314509,147.71486538,141.68312157,678.88482027,
653.25722289,629.49441109,607.39996387,586.80411413,574.28835721])
-- which, by the way, was the convergent coordinate of node 31 after approx. 5700 rounds...
Returned ordered distance from this convergent point:
[(21, 3790.2893136411608), (11, 3790.2893136361836), (16, 3790.2893136360913), (6, 3790.2893136344651), (10, 3788.2277809625589), (15, 3788.2277809625289), (12, 3788.2277809615584), (22, 3788.2277809615334), (8, 3788.2277809608322), (5, 3788.2277809601205), (3, 3788.2277809596826), (4, 3788.2277809595148), (7, 3788.2277809594166), (13, 3788.2277809586099), (20, 3788.2277809585817), (19, 3788.2277809581474), (17, 3788.2277809567599), (14, 3788.2277809566917), (18, 3788.227780956312), (9, 3788.2277809558213), (2, 3788.2277809557427), (23, 3788.2277809556413), (25, 3788.2277809550019), (24, 3788.227780954755), (1, 3718.6573908609635), (30, 3230.5991892704192), (26, 3230.5991892682646), (28, 3230.5991892666366), (27, 3230.5991892638694), (29, 3230.5991892621059), (31, 3223.1046395430294)]
[[21, 11, 16, 6, 10, 15, 12, 22, 8, 5, 3, 4, 7, 13, 20, 19, 17, 14, 18, 9, 2, 23, 25, 24, 1, 30, 26, 28, 27, 29, 31]]
-- ...And also, the convergent coordinate of node 1 after approx. 5700 rounds... --
cPoint = np.asarray([ 2.49909152e+03, 1.44285116e+03, 1.02024984e+03, 7.90282129e+02,
6.44991458e+02, 5.45392320e+02, 4.72323604e+02, 4.16550265e+02,
3.72573884e+02, 3.36722501e+02, 3.07668617e+02, 2.83013965e+02,
2.62020017e+02, 2.43927361e+02, 2.27885504e+02, 2.14349370e+02,
2.02090524e+02, 1.91158498e+02, 1.81348875e+02, 1.72207264e+02,
1.64483436e+02, 1.57169366e+02, 1.50478211e+02, 1.44333630e+02,
2.58063098e+00, 2.48321332e+00, 2.39288423e+00, 2.30889706e+00,
2.23060647e+00, 6.99362104e+00])
Returned ordered distance from this convergent point:
[(30, 3602.9807906750025), (26, 3602.9807906698661), (27, 3602.9807906681704), (28, 3602.9807906677161), (29, 3602.9807906673755), (31, 3598.1534738824198), (21, 3464.4202613508569), (6, 3464.4202611179608), (16, 3464.4202611137816), (11, 3464.4202605544215), (3, 3464.1170687424428), (4, 3464.1170681282956), (22, 3464.1170673360666), (8, 3464.1170672805733), (19, 3464.1170672418098), (14, 3464.1170671279974), (7, 3464.1170671180766), (9, 3464.1170671108885), (15, 3464.1170670336514), (24, 3464.1170670212005), (18, 3464.1170669032431), (12, 3464.1170668324703), (5, 3464.1170668253558), (17, 3464.1170668051341), (13, 3464.117066796141), (25, 3464.1170665806817), (20, 3464.117066543397), (10, 3464.1170665022091), (2, 3464.1170664905644), (23, 3464.1170664819037), (1, 3462.8055461361373)]
[[30, 26, 27, 28, 29, 31, 21, 6, 16, 11, 3, 4, 22, 8, 19, 14, 7, 9, 15, 24, 18, 12, 5, 17, 13, 25, 20, 10, 2, 23, 1]]
-- AND, the average of both node 1 and 31's coordinates after 5700 rounds... --
cPoint = np.asarray([ 2473.43291351 1428.03715754 1009.77475814 782.16816491 637.49354962
539.94069737 467.60236038 412.38651943 368.84971646 332.44216653
304.67671329 280.26181386 259.47202031 241.55530512 224.74081504
212.32309642 200.180135 189.35145107 179.63455942 169.64347215
162.97316904 155.72625555 149.09653819 143.00837578 340.73272563
327.8702181 315.94364766 304.85443047 294.5173603 290.64098912])
Returned ordered distance from this convergent point:
[(21, 3550.6356305619893), (6, 3550.635630444795), (16, 3550.6356304436244), (11, 3550.6356301707842), (3, 3549.3874626517886), (4, 3549.3874623520028), (22, 3549.3874619664816), (8, 3549.3874619390281), (19, 3549.3874619186781), (14, 3549.3874618623627), (7, 3549.3874618589757), (9, 3549.3874618535488), (15, 3549.3874618194382), (24, 3549.3874618092132), (18, 3549.387461752483), (12, 3549.3874617207466), (5, 3549.3874617165075), (17, 3549.3874617048459), (13, 3549.387461701444), (25, 3549.3874615943773), (20, 3549.3874615780933), (10, 3549.3874615601167), (2, 3549.3874615507966), (23, 3549.3874615465161), (1, 3511.7631593423275), (30, 3336.447784198017), (26, 3336.4477841942007), (28, 3336.4477841922517), (27, 3336.4477841911566), (29, 3336.4477841898743), (31, 3330.2130466929502)]
[[21, 6, 16, 11, 3, 4, 22, 8, 19, 14, 7, 9, 15, 24, 18, 12, 5, 17, 13, 25, 20, 10, 2, 23, 1, 30, 26, 28, 27, 29, 31]]
'''