From 6a3eafe4ed6faf9e8defc786afa15b8d777ad855 Mon Sep 17 00:00:00 2001 From: kjahan Date: Wed, 22 Aug 2012 13:43:00 -0700 Subject: [PATCH] first commit for community detection --- README | 10 + cmty.py | 184 ++++++ graph.txt | 1682 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1876 insertions(+) create mode 100644 README create mode 100644 cmty.py create mode 100644 graph.txt diff --git a/README b/README new file mode 100644 index 0000000..06ddca3 --- /dev/null +++ b/README @@ -0,0 +1,10 @@ +Community detection for weighted graphs +======================================= +Input: +Graph G that we want to identify its communities. See graph.txt as a sample of the input graph style. It's basicall a csv file where each line is represented by a triple such as: + +u,v,w + +The above line basically means that there is an edge between nodes u and v whose weight is w. The lowest id should be zero and the nodes ids increase. + +For any question: contact me at k.jahanbakhsh@gmail.com diff --git a/cmty.py b/cmty.py new file mode 100644 index 0000000..2a1f24f --- /dev/null +++ b/cmty.py @@ -0,0 +1,184 @@ +#!/usr/bin/env python +import networkx as nx +import pkg_resources +pkg_resources.require("matplotlib") +import matplotlib.pylab as plt +import math +import csv +import random as rand + +def buildG( G, file_, delimiter_ ): + #construct the weighted version of the contact graph from cgraph.dat file + #reader = csv.reader(open("/home/kazem/Data/UCI/karate.txt"), delimiter=" ") + reader = csv.reader(open(file_), delimiter=delimiter_) + for line in reader: + if float(line[2]) != 0.0: + G.add_edge(int(line[0])-1,int(line[1])-1,weight=float(line[2])) + +#Keep removing edges from Graph until one of the connected components of Graph splits into two. +#compute the edge betweenness +def CmtyGirvanNewmanStep( G ): + #print "call CmtyGirvanNewmanStep" + init_ncomp = nx.number_connected_components(G) #no of components + ncomp = init_ncomp + while ncomp <= init_ncomp: + bw = nx.edge_betweenness_centrality(G) #edge betweenness for G + #find the edge with max centrality + max_ = 0.0 + #find the edge with the highest centrality and remove all of them if there is more than one! + for k, v in bw.iteritems(): + #print v + _BW = float(v)/float(G[k[0]][k[1]]['weight']) #weighted version of betweenness + if _BW >= max_: + max_ = _BW + for k, v in bw.iteritems(): + if float(v)/float(G[k[0]][k[1]]['weight']) == max_: + #print "remove an edge!" + #print k + G.remove_edge(k[0],k[1]) #remove the central edge + ncomp = nx.number_connected_components(G) #recalculate the no of components + +#bw = nx.edge_betweenness_centrality(G) #edge betweenness for G +#for k, v in bw.iteritems(): + #print v + +def _GirvanNewmanGetModularity( G, deg_): + New_A = nx.adj_matrix(G) + New_deg = {} + #print 'inside _GirvanNewmanGetModularity' + #print deg_ + UpdateDeg(New_deg, New_A) + #print 'inside _GirvanNewmanGetModularity' + #print deg_ + #Let's compute the Q + comps = nx.connected_components(G) #list of components + + print 'no of comp: %d' % len(comps) + Mod = 0 #Modularity of a given partitionning + for c in comps: + EWC = 0 #no of edges within a community + RE = 0 #no of random edges + #print "debug: New deg -->" + print New_deg + for u in c: + print "debug: u" + print u + EWC += New_deg[u] + #EWC += G.degree( u ) #let's count the total edges which fall within a community + RE += deg_[u] #count the probability of a random edge + Mod += ( float(EWC) - float(RE*RE)/float(2*m_) ) + Mod = Mod/float(2*m_) + #print "Modularity: %f" % Mod + #return Mod + +def UpdateDeg(deg_, A_): + #print 'before, inside UpdateDeg' + #print deg_ + for i in range(0,n): + deg = 0.0 + for j in range(0,n): + #if i == 0: + #print '%d %d %d' % (i,j,A[i,j]) + deg += A_[i,j] + deg_[i] = deg + #print 'after, inside UpdateDeg' + #print deg_ + #print deg_ + +#Q = 0.0 +#for u in G.nodes(): + #for v in G.nodes(): + #if u in nx.node_connected_component(G, v): + ##print '%d and %d have the same component --> %d, %d, %d, %d' % (u,v, A[u,v], deg_[u], deg_[v], m_) + #Q += float(A[u,v])/float(2*m_) - float(deg_[u]*deg_[v])/float(math.pow(2*m_,2)) + ##print Q + +#print "Q: %f" % Q +#print nx.laplacian_spectrum(G) +G = nx.Graph() +buildG(G, '/Users/kazemjahanbakhsh/Downloads/graph.txt', ',') + +n = G.number_of_nodes() #|V| +print G.nodes() +#m_ = G.number_of_edges() #|E| +print 'no of nodes: %d' % n + +f_gl = open('/Users/kazemjahanbakhsh/Downloads/community/Glap.dat', 'w') +Glap = nx.normalized_laplacian(G) +for i in range(0,n): + val = '' + for j in range(0,n): + val += str(Glap[i,j]) + if j < n-1: + val += ',' + val += '\n' + f_gl.write(val) +f_gl.close() + +A = nx.adj_matrix(G) +#for i in range(0,10): + #print A[0,i] + +m_ = 0.0 #the weighted version for number of edges +for i in range(0,n): + for j in range(0,n): + m_ += A[i,j] +m_ = m_/2.0 +print "m: %f" % m_ + +#deg_ = G.degree() +#calculate the weighted degree for each node +Orig_deg = {} +UpdateDeg(Orig_deg, A) + +nx.draw_spring(G, + node_color=[float(G.degree(v)) for v in G], + node_size=40, + with_labels=False, + cmap=plt.cm.Reds, + ) +#plt.show() + +BestQ = 0.0 +Q = 0.0 +while True: + CmtyGirvanNewmanStep(G) + Q = _GirvanNewmanGetModularity(G, Orig_deg); + print "current modularity: %f" % Q + if Q > BestQ: + BestQ = Q + Bestcomps = nx.connected_components(G) #Best Split + print "comps:" + print Bestcomps + H = nx.connected_component_subgraphs(G)[1] + Hlap = nx.normalized_laplacian(H) + #CmtyV.Swap(CurCmtyV); + #if (Cmty1.Len()==0 || Cmty2.Len() == 0) { break; } + #when should we stop splitting the graph? + if G.number_of_edges() == 0: + break +if BestQ > 0.0: + size = Hlap.shape + + f_hl = open('/home/kazem/Hlap.dat', 'w') + for i in range(0,size[0]): + val = '' + for j in range(0,size[1]): + val += str(Hlap[i,j]) + if j < size[1] - 1: + val += ',' + val += '\n' + f_hl.write(val) + f_hl.close() + + print "Best Q: %f" % BestQ + print Bestcomps +else: + print "Best Q: %f" % BestQ +#nx.draw_spring(G, + #node_color=[float(G.degree(v)) for v in G], + #node_size=40, + #with_labels=False, + #cmap=plt.cm.Reds, + #) +#plt.show() \ No newline at end of file diff --git a/graph.txt b/graph.txt new file mode 100644 index 0000000..759cb24 --- /dev/null +++ b/graph.txt @@ -0,0 +1,1682 @@ +0,1,9 +0,14,384 +0,26,142 +0,37,231 +0,48,5 +0,52,115 +0,55,378 +0,56,133 +1,2,1188 +1,3,5 +1,4,17824 +1,5,1318 +1,7,484 +1,9,241 +1,16,354 +1,17,1441 +1,18,482 +1,19,719 +1,20,234 +1,21,2595 +1,22,723 +1,24,1330 +1,25,1229 +1,26,2366 +1,27,471 +1,28,129 +1,29,355 +1,30,115 +1,31,859 +1,34,364 +1,35,1208 +1,37,2504 +1,39,355 +1,41,1938 +1,42,1643 +1,43,641 +1,44,9518 +1,47,2182 +1,49,252 +1,50,489 +1,51,372 +1,52,6432 +1,53,234 +1,54,1452 +1,55,3474 +1,56,468 +1,57,1468 +1,58,121 +1,61,234 +1,62,4323 +1,63,810 +1,65,237 +1,66,869 +1,67,377 +1,68,1054 +1,69,117 +1,70,3605 +1,71,115 +1,72,7 +1,73,4 +2,4,119 +2,6,729 +2,12,468 +2,13,1240 +2,15,468 +2,16,1018 +2,18,628 +2,20,493 +2,21,1003 +2,25,1086 +2,26,1910 +2,27,485 +2,32,240 +2,33,124 +2,34,231 +2,35,3 +2,37,239 +2,38,579 +2,39,592 +2,40,28 +2,41,1096 +2,42,230 +2,43,742 +2,44,13 +2,45,707 +2,52,5 +2,53,119 +2,55,1224 +2,56,4 +2,57,383 +2,58,252 +2,60,580 +2,61,227 +2,63,1050 +2,65,232 +2,66,4 +2,67,232 +2,68,123 +2,69,620 +2,70,976 +2,72,711 +3,5,350 +3,14,4 +3,18,7 +3,26,122 +3,28,144 +3,29,121 +3,30,1805 +3,31,1804 +3,32,127 +3,34,1934 +3,39,7 +3,42,1243 +3,43,127 +3,47,486 +3,48,824 +3,49,242 +3,50,356 +3,51,111 +3,52,857 +3,53,352 +3,55,458 +3,57,2435 +3,59,120 +3,64,7 +3,65,1345 +3,66,4692 +3,67,475 +3,68,1192 +3,71,117 +3,72,4 +4,5,1792 +4,14,231 +4,15,123 +4,17,1053 +4,18,1071 +4,19,121 +4,21,825 +4,22,228 +4,24,1270 +4,25,470 +4,26,941 +4,27,1046 +4,29,109 +4,31,758 +4,32,1401 +4,34,712 +4,35,1082 +4,37,233 +4,39,248 +4,41,392 +4,42,351 +4,44,7560 +4,48,3 +4,49,5 +4,50,1073 +4,51,119 +4,52,481 +4,53,122 +4,54,1549 +4,55,933 +4,57,225 +4,59,1905 +4,61,835 +4,63,2 +4,64,111 +4,65,586 +4,66,599 +4,67,5 +4,69,249 +4,70,484 +4,71,114 +4,72,989 +5,7,619 +5,8,241 +5,10,227 +5,12,223 +5,15,474 +5,17,835 +5,18,842 +5,20,123 +5,21,4364 +5,22,231 +5,23,715 +5,24,2030 +5,25,735 +5,26,124 +5,27,1174 +5,29,1225 +5,30,245 +5,31,5772 +5,32,604 +5,34,1305 +5,35,485 +5,36,843 +5,37,242 +5,38,946 +5,39,609 +5,42,3 +5,44,2 +5,45,1691 +5,47,469 +5,48,593 +5,49,1071 +5,50,825 +5,52,468 +5,53,1279 +5,54,14 +5,55,830 +5,56,11 +5,57,3479 +5,58,967 +5,61,826 +5,62,239 +5,63,362 +5,64,948 +5,65,2288 +5,66,967 +5,67,363 +5,68,690 +5,69,1329 +5,70,599 +5,71,1165 +5,72,7 +5,73,231 +6,13,11030 +6,16,8275 +6,18,724 +6,19,118 +6,22,6 +6,26,137 +6,27,1215 +6,33,3987 +6,34,120 +6,38,139 +6,40,3954 +6,42,374 +6,45,130 +6,56,349 +6,66,245 +7,8,4 +7,11,237 +7,15,111 +7,17,115 +7,19,590 +7,20,233 +7,21,4345 +7,22,115 +7,23,359 +7,24,118 +7,25,1332 +7,27,128 +7,29,1923 +7,30,1316 +7,34,375 +7,37,3465 +7,41,369 +7,43,961 +7,45,1727 +7,47,353 +7,50,119 +7,51,723 +7,52,715 +7,53,1071 +7,55,953 +7,56,3 +7,57,12 +7,58,3332 +7,59,123 +7,61,7 +7,62,473 +7,63,7 +7,65,355 +7,67,120 +7,69,2068 +7,70,9400 +8,11,12 +8,12,128 +8,14,398 +8,15,127 +8,16,111 +8,17,1073 +8,18,118 +8,20,474 +8,21,2320 +8,22,494 +8,23,112 +8,24,116 +8,25,807 +8,26,1429 +8,27,131 +8,29,960 +8,31,10 +8,32,3027 +8,34,742 +8,38,703 +8,41,2041 +8,44,965 +8,45,229 +8,47,717 +8,49,143 +8,51,854 +8,52,239 +8,53,369 +8,54,1474 +8,55,726 +8,56,14 +8,58,1346 +8,59,1326 +8,61,983 +8,62,231 +8,63,1309 +8,64,357 +8,66,1609 +8,67,504 +8,68,239 +8,69,933 +8,71,7 +8,72,368 +9,12,5627 +9,13,1432 +9,15,2308 +9,16,1091 +9,17,127 +9,19,353 +9,20,371 +9,21,840 +9,22,1555 +9,26,866 +9,27,1771 +9,28,355 +9,31,730 +9,32,3229 +9,33,1337 +9,34,860 +9,36,234 +9,37,1904 +9,38,611 +9,40,1085 +9,41,1678 +9,42,1704 +9,43,953 +9,44,363 +9,47,1417 +9,48,1207 +9,50,1211 +9,51,3317 +9,52,2497 +9,53,6621 +9,54,594 +9,55,3999 +9,57,2875 +9,59,3574 +9,61,4845 +9,62,1086 +9,63,1695 +9,64,113 +9,66,233 +9,67,989 +9,70,585 +9,71,730 +9,72,241 +10,11,1283 +10,14,732 +10,17,6 +10,18,5 +10,19,7 +10,21,257 +10,23,5 +10,24,3 +10,25,123 +10,26,251 +10,27,252 +10,28,597 +10,29,346 +10,32,3108 +10,34,238 +10,35,3510 +10,39,719 +10,41,1887 +10,43,387 +10,49,7 +10,50,259 +10,51,2273 +10,52,1435 +10,55,998 +10,56,1099 +10,57,3037 +10,58,2880 +10,59,7 +10,61,119 +10,63,579 +10,65,121 +10,66,481 +10,67,384 +10,68,123 +10,69,483 +10,70,245 +10,71,729 +10,72,2578 +11,12,112 +11,14,27 +11,17,3356 +11,18,257 +11,19,120 +11,21,2741 +11,22,1065 +11,23,1565 +11,24,370 +11,26,3901 +11,28,1474 +11,29,11818 +11,30,1071 +11,31,258 +11,32,852 +11,34,3 +11,35,2173 +11,37,124 +11,38,6 +11,39,1106 +11,41,1407 +11,43,718 +11,47,1556 +11,48,472 +11,50,223 +11,51,2002 +11,52,461 +11,53,2763 +11,54,1932 +11,55,2290 +11,56,355 +11,57,1182 +11,58,254 +11,59,866 +11,61,227 +11,62,221 +11,63,2404 +11,64,469 +11,66,501 +11,67,465 +11,68,246 +11,69,712 +11,70,1114 +11,71,222 +11,72,1317 +12,13,6 +12,15,17949 +12,17,1164 +12,18,240 +12,20,233 +12,21,486 +12,22,4247 +12,24,119 +12,26,373 +12,27,121 +12,28,347 +12,29,574 +12,31,2502 +12,32,358 +12,34,237 +12,35,841 +12,39,16 +12,41,350 +12,42,1188 +12,43,5078 +12,48,3 +12,50,4755 +12,51,9 +12,52,16 +12,53,8054 +12,54,573 +12,55,7824 +12,56,1636 +12,57,942 +12,59,2619 +12,61,3531 +12,63,734 +12,65,110 +12,66,345 +12,67,2345 +12,68,593 +12,72,590 +13,14,238 +13,16,27289 +13,18,7464 +13,19,830 +13,23,113 +13,25,14 +13,26,243 +13,27,1769 +13,31,380 +13,32,7 +13,33,9364 +13,35,586 +13,38,1561 +13,40,17836 +13,41,261 +13,42,258 +13,51,249 +13,55,7 +13,56,230 +13,57,128 +13,58,116 +13,61,502 +13,63,228 +13,66,135 +14,16,528 +14,18,368 +14,19,112 +14,21,613 +14,22,245 +14,25,357 +14,26,1679 +14,27,129 +14,28,1062 +14,32,1402 +14,33,261 +14,34,3188 +14,35,480 +14,39,2 +14,40,267 +14,41,469 +14,51,359 +14,52,1443 +14,54,1435 +14,55,123 +14,56,247 +14,57,606 +14,59,1054 +14,61,3082 +14,64,113 +14,65,476 +14,66,2114 +14,71,598 +14,72,1085 +14,73,352 +15,16,6 +15,17,496 +15,18,262 +15,22,4309 +15,24,364 +15,25,252 +15,26,2 +15,27,237 +15,28,7 +15,29,707 +15,31,3071 +15,32,626 +15,34,233 +15,35,1562 +15,39,467 +15,41,116 +15,42,850 +15,43,5244 +15,48,246 +15,50,2252 +15,53,9540 +15,54,608 +15,55,7542 +15,56,603 +15,57,1298 +15,59,3538 +15,61,2782 +15,63,1084 +15,65,246 +15,66,721 +15,67,3009 +15,68,1326 +15,69,128 +15,71,218 +15,72,131 +16,18,7172 +16,21,459 +16,23,113 +16,25,7 +16,26,118 +16,27,1843 +16,31,970 +16,33,14405 +16,34,339 +16,35,14 +16,36,691 +16,38,1227 +16,39,3 +16,40,19035 +16,41,7 +16,42,511 +16,51,7 +16,52,367 +16,54,239 +16,55,123 +16,56,126 +16,57,585 +16,58,14 +16,60,125 +16,61,722 +16,62,948 +16,63,493 +16,66,1309 +16,68,111 +16,72,364 +17,18,123 +17,20,975 +17,21,500 +17,22,1106 +17,24,20923 +17,26,1551 +17,27,485 +17,29,1178 +17,30,4676 +17,31,119 +17,32,5069 +17,34,229 +17,35,494 +17,36,1336 +17,37,486 +17,42,810 +17,43,120 +17,47,1188 +17,49,1176 +17,51,3135 +17,52,363 +17,54,1776 +17,55,250 +17,56,1918 +17,57,1448 +17,58,640 +17,59,130 +17,61,1685 +17,63,2059 +17,64,233 +17,65,2861 +17,66,132 +17,67,1099 +17,68,1328 +17,70,238 +17,72,503 +17,73,243 +18,19,118 +18,20,7 +18,21,491 +18,23,122 +18,24,731 +18,25,1515 +18,26,4053 +18,27,1262 +18,29,118 +18,30,27 +18,31,1331 +18,32,1026 +18,33,1363 +18,34,1786 +18,35,258 +18,36,7 +18,37,962 +18,38,374 +18,39,143 +18,40,5770 +18,41,126 +18,42,272 +18,44,126 +18,45,7 +18,47,130 +18,49,488 +18,50,379 +18,51,235 +18,53,129 +18,54,244 +18,55,1554 +18,56,1062 +18,57,1859 +18,58,5 +18,59,352 +18,60,3463 +18,61,353 +18,63,234 +18,65,634 +18,66,1775 +18,70,1173 +18,71,3220 +18,72,597 +18,73,11 +19,20,2666 +19,21,5754 +19,22,862 +19,24,4 +19,25,123 +19,26,264 +19,27,495 +19,29,143 +19,30,3583 +19,31,4 +19,34,2177 +19,35,1672 +19,36,2609 +19,37,953 +19,39,253 +19,41,13 +19,43,114 +19,44,4 +19,47,3495 +19,48,626 +19,49,123 +19,50,3144 +19,52,4543 +19,53,241 +19,54,461 +19,55,1636 +19,57,597 +19,58,499 +19,61,360 +19,62,1676 +19,63,378 +19,65,381 +19,66,1695 +19,69,730 +19,70,1196 +19,71,360 +19,73,346 +20,21,3886 +20,22,848 +20,23,1697 +20,24,601 +20,25,110 +20,27,472 +20,28,358 +20,30,610 +20,31,4 +20,32,4202 +20,35,589 +20,36,1312 +20,37,1809 +20,41,5710 +20,42,129 +20,47,3568 +20,48,243 +20,49,366 +20,50,2303 +20,51,606 +20,52,3338 +20,53,460 +20,54,933 +20,55,2009 +20,57,253 +20,58,14 +20,61,462 +20,62,1801 +20,63,4517 +20,65,6928 +20,67,232 +20,68,245 +20,69,1439 +20,70,364 +20,71,235 +20,72,458 +21,22,914 +21,23,3639 +21,24,231 +21,25,1086 +21,26,492 +21,27,748 +21,29,3438 +21,30,2961 +21,31,833 +21,32,2663 +21,34,963 +21,35,476 +21,36,4295 +21,37,3193 +21,38,823 +21,39,138 +21,41,5821 +21,42,344 +21,43,1823 +21,44,948 +21,45,934 +21,47,124 +21,48,3246 +21,49,373 +21,50,614 +21,51,4491 +21,52,699 +21,53,2730 +21,54,233 +21,55,3221 +21,56,691 +21,57,942 +21,58,3653 +21,59,957 +21,61,2433 +21,62,3 +21,63,579 +21,64,124 +21,65,848 +21,66,1638 +21,67,228 +21,69,6540 +21,70,3456 +21,72,3182 +22,23,122 +22,24,1333 +22,26,855 +22,27,244 +22,28,346 +22,29,242 +22,30,943 +22,31,962 +22,32,2257 +22,34,1087 +22,35,820 +22,41,722 +22,43,1750 +22,44,368 +22,45,1774 +22,47,2642 +22,48,243 +22,49,228 +22,50,1306 +22,51,729 +22,52,941 +22,53,4354 +22,54,5225 +22,55,2698 +22,56,1997 +22,57,1444 +22,58,588 +22,59,2347 +22,61,5277 +22,62,847 +22,63,595 +22,64,613 +22,65,372 +22,66,2819 +22,67,2350 +22,68,2019 +22,69,478 +22,70,1597 +22,71,1424 +22,72,350 +23,25,508 +23,26,363 +23,27,474 +23,29,4923 +23,30,4047 +23,32,4172 +23,34,1690 +23,37,976 +23,38,358 +23,39,361 +23,41,4641 +23,43,1683 +23,45,3488 +23,47,978 +23,48,7 +23,49,5 +23,50,121 +23,51,3108 +23,53,3801 +23,55,2844 +23,57,960 +23,58,606 +23,59,500 +23,61,356 +23,62,595 +23,63,5255 +23,65,2962 +23,66,490 +23,67,9 +23,68,834 +23,69,3560 +23,70,1645 +23,71,111 +23,72,5 +24,26,1687 +24,27,376 +24,29,458 +24,30,4536 +24,31,478 +24,32,5657 +24,34,458 +24,35,247 +24,36,602 +24,37,489 +24,38,112 +24,39,242 +24,41,7 +24,44,258 +24,47,712 +24,49,492 +24,50,1098 +24,51,501 +24,52,592 +24,54,2143 +24,55,1301 +24,56,713 +24,57,1677 +24,58,113 +24,59,700 +24,61,477 +24,64,478 +24,65,2413 +24,66,1096 +24,67,1078 +24,68,603 +24,70,113 +24,71,246 +24,72,580 +24,73,359 +25,26,864 +25,27,384 +25,28,469 +25,29,1601 +25,31,268 +25,32,1010 +25,34,236 +25,35,489 +25,37,2430 +25,38,955 +25,39,1672 +25,41,4310 +25,42,7 +25,43,1300 +25,44,1798 +25,45,3724 +25,49,363 +25,50,7 +25,52,7 +25,53,121 +25,54,870 +25,55,3996 +25,57,1031 +25,58,4575 +25,59,257 +25,61,365 +25,62,493 +25,63,2381 +25,65,723 +25,66,2059 +25,67,497 +25,68,1103 +25,69,4085 +25,70,4474 +25,71,126 +25,72,1462 +25,73,124 +26,27,710 +26,28,723 +26,29,2346 +26,30,1669 +26,32,3080 +26,34,948 +26,35,365 +26,37,1678 +26,38,7 +26,39,3979 +26,41,3428 +26,42,1193 +26,43,814 +26,44,4 +26,45,4306 +26,47,1309 +26,49,724 +26,50,3238 +26,51,232 +26,52,2510 +26,53,468 +26,54,455 +26,55,1223 +26,56,3208 +26,57,5360 +26,59,1093 +26,60,7046 +26,61,3331 +26,63,1431 +26,65,1898 +26,66,1081 +26,67,1185 +26,68,1568 +26,69,1167 +26,70,1477 +26,72,1825 +27,29,591 +27,31,618 +27,32,1684 +27,33,968 +27,34,1365 +27,35,137 +27,36,5 +27,37,605 +27,38,731 +27,39,371 +27,40,833 +27,41,2124 +27,42,582 +27,48,2028 +27,49,13 +27,50,696 +27,51,493 +27,52,728 +27,53,475 +27,55,609 +27,56,359 +27,57,1462 +27,59,836 +27,60,131 +27,61,12 +27,62,5 +27,63,2 +27,64,5 +27,65,960 +27,66,1665 +27,67,1 +27,68,113 +27,69,137 +27,71,148 +27,72,947 +27,73,355 +28,29,2284 +28,30,815 +28,31,1375 +28,32,1555 +28,34,3125 +28,35,5810 +28,37,1320 +28,39,605 +28,42,130 +28,43,608 +28,47,734 +28,48,135 +28,49,129 +28,50,741 +28,51,258 +28,52,737 +28,53,1712 +28,54,4073 +28,55,3370 +28,56,474 +28,57,716 +28,59,2040 +28,61,2135 +28,63,361 +28,65,3 +28,66,4061 +28,67,1081 +28,70,3481 +28,71,735 +28,72,2453 +28,73,491 +29,30,1992 +29,31,498 +29,32,227 +29,34,706 +29,35,1671 +29,37,118 +29,38,243 +29,39,584 +29,41,3161 +29,42,359 +29,43,1681 +29,45,363 +29,47,984 +29,48,362 +29,49,1064 +29,50,491 +29,51,2388 +29,52,855 +29,53,4467 +29,54,2622 +29,55,2135 +29,56,353 +29,57,4194 +29,58,341 +29,59,3288 +29,61,3 +29,62,1183 +29,63,2279 +29,64,1449 +29,65,476 +29,66,1298 +29,69,3434 +29,70,3581 +29,72,2496 +30,31,117 +30,32,2821 +30,34,2634 +30,35,601 +30,36,1398 +30,37,1721 +30,41,1766 +30,43,3159 +30,45,4070 +30,47,751 +30,49,475 +30,50,341 +30,51,6798 +30,52,2730 +30,53,4566 +30,54,2613 +30,55,4552 +30,56,352 +30,57,3964 +30,58,721 +30,61,1579 +30,63,486 +30,64,126 +30,65,3202 +30,66,3362 +30,68,2598 +30,69,3944 +30,70,6453 +30,71,133 +30,73,1078 +31,32,494 +31,33,124 +31,34,1318 +31,35,251 +31,37,116 +31,38,581 +31,39,465 +31,42,266 +31,43,723 +31,44,350 +31,45,123 +31,47,1659 +31,48,597 +31,49,1090 +31,50,2596 +31,51,1216 +31,52,691 +31,53,3062 +31,54,121 +31,55,2822 +31,56,3727 +31,57,2711 +31,59,703 +31,61,124 +31,62,348 +31,63,478 +31,64,613 +31,65,1655 +31,66,3631 +31,67,924 +31,68,124 +31,69,453 +31,72,371 +31,73,1279 +32,35,596 +32,36,1185 +32,37,1324 +32,38,3 +32,39,459 +32,41,8168 +32,42,600 +32,43,244 +32,44,225 +32,45,347 +32,47,1189 +32,48,709 +32,49,848 +32,50,240 +32,51,4022 +32,52,619 +32,54,1300 +32,55,254 +32,56,579 +32,57,3280 +32,58,1761 +32,59,2725 +32,61,3054 +32,63,3538 +32,64,1075 +32,65,6112 +32,66,818 +32,67,350 +32,68,2215 +32,69,129 +32,70,351 +32,71,496 +32,72,1692 +33,38,857 +33,40,15435 +33,42,482 +33,47,7 +33,61,246 +33,66,232 +33,73,7 +34,35,859 +34,36,120 +34,38,1828 +34,39,715 +34,41,120 +34,42,10 +34,43,118 +34,44,232 +34,45,1681 +34,49,131 +34,50,850 +34,51,854 +34,52,715 +34,53,4 +34,54,1092 +34,55,1321 +34,56,1187 +34,57,583 +34,59,2033 +34,61,600 +34,62,264 +34,63,1935 +34,64,250 +34,65,1559 +34,66,3066 +34,67,722 +34,68,364 +34,69,836 +34,70,576 +34,71,356 +34,72,1330 +34,73,467 +35,37,977 +35,38,240 +35,39,721 +35,41,119 +35,43,460 +35,44,122 +35,48,248 +35,49,115 +35,50,132 +35,52,243 +35,53,1043 +35,54,7055 +35,55,1534 +35,56,707 +35,57,2838 +35,59,2647 +35,61,1658 +35,63,246 +35,64,124 +35,65,585 +35,66,1438 +35,67,2477 +35,68,3031 +35,69,374 +35,71,1309 +35,72,1740 +36,37,716 +36,42,121 +36,44,354 +36,45,7 +36,47,683 +36,48,1885 +36,51,384 +36,52,254 +36,54,741 +36,55,240 +36,57,494 +36,60,109 +36,63,604 +36,64,237 +36,65,2903 +36,68,476 +37,39,365 +37,41,4418 +37,43,2231 +37,44,363 +37,45,242 +37,47,1283 +37,48,1932 +37,51,1077 +37,52,1117 +37,53,2109 +37,54,590 +37,55,6159 +37,56,138 +37,57,3486 +37,58,3148 +37,59,3714 +37,60,754 +37,61,501 +37,62,593 +37,63,1875 +37,65,3333 +37,66,378 +37,67,1562 +37,68,1455 +37,69,1500 +37,70,10712 +37,72,724 +38,39,737 +38,44,926 +38,51,124 +38,54,3 +38,55,121 +38,63,948 +38,66,483 +38,67,351 +39,41,472 +39,42,111 +39,44,363 +39,49,463 +39,50,1822 +39,51,11 +39,52,231 +39,54,229 +39,55,242 +39,56,604 +39,57,2301 +39,58,582 +39,60,2811 +39,61,1514 +39,63,335 +39,64,109 +39,65,1195 +39,66,1096 +39,67,4 +39,69,110 +39,70,350 +39,71,246 +39,72,473 +40,42,367 +41,43,2987 +41,44,1664 +41,45,234 +41,48,703 +41,49,476 +41,50,933 +41,51,8363 +41,52,811 +41,53,4443 +41,54,233 +41,55,3190 +41,57,971 +41,58,1663 +41,59,1370 +41,61,2971 +41,62,356 +41,63,4297 +41,64,485 +41,65,3626 +41,66,1312 +41,67,473 +41,68,713 +41,69,2842 +41,70,1985 +41,72,480 +42,43,1417 +42,48,353 +42,49,6373 +42,50,589 +42,52,498 +42,53,1285 +42,54,247 +42,55,465 +42,56,1712 +42,57,4088 +42,58,6 +42,61,748 +42,63,514 +42,64,3272 +42,65,1188 +42,66,851 +42,67,125 +42,68,235 +42,69,240 +42,70,4 +42,72,9 +42,73,720 +43,44,1452 +43,45,1306 +43,47,723 +43,48,247 +43,50,5534 +43,51,2033 +43,52,359 +43,53,12886 +43,54,362 +43,55,11882 +43,57,1821 +43,58,1810 +43,59,1281 +43,61,1553 +43,62,121 +43,63,3914 +43,65,3218 +43,66,1066 +43,67,2412 +43,68,1287 +43,69,1908 +43,70,4886 +43,71,115 +43,73,130 +44,45,991 +44,47,595 +44,48,489 +44,49,116 +44,50,124 +44,51,2659 +44,52,1804 +44,53,114 +44,54,113 +44,55,262 +44,57,850 +44,58,7013 +44,59,487 +44,61,1849 +44,62,1957 +44,63,459 +44,64,241 +44,65,245 +44,66,701 +44,67,503 +44,69,592 +44,71,5 +44,72,2391 +45,46,1079 +45,49,374 +45,51,4332 +45,52,112 +45,54,1623 +45,55,113 +45,56,1752 +45,57,1417 +45,58,1535 +45,60,585 +45,61,2226 +45,62,3 +45,63,604 +45,64,6 +45,65,110 +45,67,348 +45,68,1334 +45,69,1778 +45,72,603 +47,48,3 +47,50,3193 +47,51,1041 +47,52,4367 +47,53,454 +47,56,3092 +47,57,352 +47,58,360 +47,59,2466 +47,61,232 +47,62,2469 +47,63,715 +47,65,249 +47,66,3410 +47,70,704 +47,71,494 +47,72,218 +48,49,248 +48,50,1576 +48,51,3153 +48,52,2946 +48,53,501 +48,54,130 +48,55,838 +48,56,23 +48,57,4463 +48,59,837 +48,61,822 +48,63,250 +48,64,4 +48,65,1314 +48,66,1054 +48,67,1071 +48,68,113 +48,70,838 +48,71,111 +48,72,1117 +48,73,5 +49,50,248 +49,51,730 +49,52,849 +49,53,126 +49,54,729 +49,55,9 +49,56,12 +49,57,4907 +49,58,111 +49,59,1308 +49,61,1393 +49,63,472 +49,64,14351 +49,65,983 +49,66,2653 +49,68,473 +49,70,1201 +49,71,856 +49,72,5 +50,51,944 +50,52,3075 +50,53,1917 +50,55,3841 +50,57,936 +50,58,241 +50,59,967 +50,60,3643 +50,62,1793 +50,63,489 +50,64,475 +50,65,1301 +50,66,1424 +50,67,479 +50,68,473 +50,69,703 +50,70,4 +50,72,928 +50,73,249 +51,52,1319 +51,53,2247 +51,54,1824 +51,55,1651 +51,57,4816 +51,58,4631 +51,59,599 +51,61,4360 +51,62,122 +51,63,725 +51,64,459 +51,65,701 +51,66,126 +51,68,840 +51,69,1910 +51,70,1896 +51,72,600 +52,53,721 +52,54,1811 +52,55,124 +52,56,1084 +52,57,689 +52,58,122 +52,59,242 +52,61,586 +52,62,4258 +52,66,861 +52,67,240 +52,68,834 +52,69,819 +52,70,348 +52,72,464 +52,73,351 +53,54,2110 +53,55,15180 +53,56,372 +53,57,1192 +53,58,1415 +53,59,964 +53,61,1738 +53,62,6 +53,63,1180 +53,64,2 +53,65,2095 +53,66,1070 +53,67,1978 +53,68,939 +53,69,1454 +53,70,3125 +53,71,3 +53,73,930 +54,55,852 +54,56,2112 +54,57,2245 +54,58,616 +54,59,1303 +54,61,3817 +54,63,1037 +54,64,710 +54,65,1763 +54,66,2264 +54,67,349 +54,68,1883 +54,70,1927 +54,71,126 +54,72,1301 +55,56,340 +55,57,1040 +55,58,1064 +55,59,841 +55,61,2343 +55,62,480 +55,63,1883 +55,65,929 +55,66,352 +55,67,1203 +55,68,1556 +55,69,965 +55,70,5218 +55,71,488 +55,72,1201 +55,73,2607 +56,57,1647 +56,58,238 +56,59,2138 +56,60,233 +56,61,1080 +56,62,343 +56,64,356 +56,65,737 +56,66,3887 +56,67,3322 +56,68,3080 +56,71,5 +56,72,227 +56,73,137 +57,58,111 +57,59,703 +57,61,2006 +57,62,111 +57,64,2481 +57,65,2151 +57,66,1513 +57,67,590 +57,68,569 +57,69,454 +57,70,595 +57,71,601 +57,72,125 +57,73,121 +58,59,6 +58,61,845 +58,62,1905 +58,64,375 +58,65,1188 +58,66,592 +58,67,357 +58,68,1185 +58,69,2040 +58,70,3765 +58,71,242 +58,72,585 +59,61,3774 +59,63,1185 +59,64,121 +59,65,251 +59,66,4168 +59,67,580 +59,68,343 +59,70,225 +59,71,351 +59,72,2480 +61,63,1212 +61,65,240 +62,63,941 +62,74,5856 +63,65,1171 +63,66,472 +63,67,715 +63,68,1521 +63,69,488 +63,70,122 +63,71,236 +63,72,233 +63,73,226 +64,65,233 +64,66,2036 +64,67,114 +64,69,472 +64,71,1192 +64,72,123 +65,66,347 +65,67,2 +65,68,3045 +65,69,838 +65,70,238 +65,73,478 +66,67,123 +66,68,4 +66,70,824 +66,71,577 +66,72,465 +66,73,230 +67,68,3061 +67,70,231 +67,72,126 +67,73,123 +68,70,226 +68,71,116 +68,72,118 +68,73,5 +69,70,1219 +69,72,354 +71,73,482