Redundant Connection

Medium

A tree is an undirected graph that is connected and has no cycles.

You start with a tree of n nodes, labeled from 1 to n, and one extra edge is added between two different nodes. That extra edge wasn't already in the tree.

You are given the resulting graph as an array edges, where edges[i] = [a_i, b_i] means there is an edge between nodes a_i and b_i.

Return an edge that can be removed so the graph is a tree of n nodes again. If there are multiple answers, return the one that appears last in edges.

Examples

Example 1

Input:  edges = [[1,2],[1,3],[2,3]]
Output: [2,3]

The three edges form a triangle. Removing any of them leaves a tree, so return the last one in the list.

Example 2

Input:  edges = [[1,2],[2,3],[3,4],[1,4],[1,5]]
Output: [1,4]

The cycle is 1-2-3-4-1. [1,5] comes later in the list, but it's not on the cycle. Removing it would cut node 5 off from the rest of the graph.

123451st2nd3rd4th5thThe cycle is 1-2-3-4. Its last edge in the list is the answer.[1,5] comes later, but it isn't on the cycle:removing it would strand node 5.

Example 3

Input:  edges = [[1,2],[2,3],[1,3],[3,4]]
Output: [1,3]

The cycle is the triangle 1-2-3, and [1,3] is its last edge in the list. [3,4] is the very last edge, but node 4 would be stranded without it.

Example 4

Input:  edges = [[4,5],[1,2],[2,3],[1,3],[3,4]]
Output: [1,3]

Both ends of [3,4] have other edges too, so it can look removable. But it's the only link between nodes 4 and 5 and the triangle, so removing it splits the graph in two.

Example 5

Input:  edges = [[1,3],[3,4],[2,4],[1,2]]
Output: [1,2]

The whole graph is one cycle, so removing any edge leaves a tree. [1,2] is the last one.

Constraints

  • n == edges.length
  • 3 <= n <= 1000
  • edges[i].length == 2
  • 1 <= a_i < b_i <= n
  • There are no repeated edges.
  • The graph is connected.
TypeScript
Loading editor…
Test cases31
Case 1
edges = [[1,2],[1,3],[2,3]]
Case 2
edges = [[1,2],[2,3],[3,4],[1,4],[1,5]]
Case 3
edges = [[1,2],[2,3],[1,3],[3,4]]
Case 4
edges = [[4,5],[1,2],[2,3],[1,3],[3,4]]
Case 5
edges = [[1,3],[3,4],[2,4],[1,2]]
Case 6
edges = [[2,3],[1,2],[1,3]]
Case 7
edges = [[1,3],[2,3],[1,2]]
Case 8
edges = [[1,4],[3,4],[1,3],[1,2],[4,5]]
Case 9
edges = [[1,2],[3,4],[2,3],[1,4]]
Case 10
edges = [[3,4],[1,2],[1,4],[2,3]]
Case 11
edges = [[1,2],[2,3],[1,3],[3,4],[4,5],[4,6]]
Case 12
edges = [[4,5],[4,6],[1,2],[2,3],[1,3],[3,4]]
Case 13
edges = [[5,6],[4,5],[3,4],[2,3],[1,2],[1,3]]
Case 14
edges = [[1,5],[2,6],[5,6],[3,7],[1,2],[2,3],[4,8],[3,4]]
Case 15
edges = [[1,2],[2,3],[3,4],[4,5],[5,6],[1,6]]
Case 16
edges = [[5,6],[4,5],[3,4],[2,3],[1,2],[1,6]]
Case 17
edges = [[3,4],[1,3],[2,3],[1,4]]
Case 18
edges = [[4,5],[1,2],[2,5],[2,3],[2,4]]
Case 19
edges = [[1,2],[3,6],[4,5],[1,4],[1,5],[5,6]]
Case 20
edges = [[3,7],[1,2],[4,5],[4,6],[2,4],[3,5],[6,7]]
Case 21
edges = [[2,6],[6,7],[2,3],[3,4],[7,8],[5,7],[1,4],[2,7]]
Case 22
edges = [[2,10],[3,7],[2,7],[2,3],[3,6],[3,8],[4,9],[1,9],[3,5],[4,10]]
Case 23
edges = [[1,2],[3,8],[5,6],[1,11],[9,11],[10,11],[2,10],[1,12],[4,10],[7,8],[8,10],[2,6]]
Case 24
edges = [[5,6],[8,14],[8,13],[3,8],[12,15],[6,12],[10,14],[1,8],[11,14],[4,10],[12,14],[1,9],[8,15],[7,12],[1,2]]
Case 25
edges = [[11,15],[1,8],[1,12],[5,10],[3,18],[1,15],[9,16],[18,19],[6,10],[9,18],[14,20],[4,14],[9,13],[2,5],[1,5],[3,13],[10,17],[1,20],[2,7],[1,18]]
Case 26
edges = [[2,26],[3,28],[1,21],[12,19],[1,5],[9,28],[15,28],[10,27],[12,30],[14,22],[17,18],[2,23],[2,7],[19,28],[2,16],[15,24],[10,30],[2,17],[6,22],[1,13],[5,25],[11,13],[15,20],[1,8],[2,28],[19,27],[4,12],[13,29],[3,22],[1,28]]
Case 27
edges = [[12,25],[23,26],[21,33],[11,30],[8,32],[9,12],[39,40],[1,17],[7,41],[30,34],[23,41],[6,43],[19,33],[29,39],[10,39],[4,34],[8,36],[14,39],[22,39],[16,29],[6,8],[12,17],[17,31],[28,36],[18,34],[17,39],[34,39],[41,44],[2,31],[8,19],[33,37],[12,24],[30,41],[3,5],[8,39],[38,39],[24,42],[10,35],[1,15],[27,32],[20,36],[24,45],[6,9],[13,24],[4,5]]
Case 28
edges = [[7,70],[6,12],[16,41],[32,68],[17,29],[23,70],[24,35],[39,59],[15,61],[37,68],[9,63],[10,53],[4,36],[47,62],[47,61],[13,14],[46,54],[41,57],[34,62],[10,26],[19,37],[38,70],[58,65],[14,62],[48,55],[28,48],[11,29],[20,66],[14,51],[6,64],[34,54],[21,25],[29,38],[27,62],[8,34],[18,46],[21,44],[21,39],[22,47],[5,29],[6,9],[10,34],[28,36],[29,62],[14,31],[2,57],[39,52],[45,60],[58,68],[22,36],[38,56],[54,58],[46,52],[3,36],[22,57],[21,67],[9,47],[40,68],[42,61],[21,35],[20,47],[33,40],[3,50],[49,58],[38,45],[1,67],[30,40],[26,69],[43,57],[11,21]]
Case 29
edges = [[33,73],[87,96],[5,80],[47,76],[79,88],[56,95],[15,22],[46,59],[9,73],[85,98],[71,90],[43,66],[50,61],[65,70],[7,17],[53,99],[62,92],[48,75],[30,88],[6,36],[13,88],[7,90],[9,29],[81,93],[19,95],[22,64],[72,97],[39,42],[25,86],[18,69],[44,60],[5,89],[4,35],[34,39],[67,80],[31,73],[18,40],[35,75],[18,72],[23,51],[6,94],[9,38],[80,83],[55,89],[27,48],[71,97],[72,96],[43,72],[43,82],[21,47],[5,47],[91,97],[51,58],[28,45],[40,58],[12,61],[18,62],[70,71],[50,73],[68,71],[63,73],[41,71],[32,40],[37,81],[43,73],[19,73],[31,100],[6,53],[3,50],[1,89],[69,86],[59,88],[46,77],[5,27],[9,85],[8,79],[28,78],[39,57],[74,88],[26,60],[11,100],[18,60],[47,84],[82,88],[19,52],[16,52],[47,72],[14,85],[20,53],[5,32],[10,54],[28,85],[49,67],[2,90],[21,39],[24,59],[54,83],[53,72],[43,64],[31,81]]
Case 30
edges = [[89,330],[382,547],[266,437],[145,523],[14,69],[411,477],[322,544],[49,339],[44,598],[119,443],[116,297],[373,601],[299,524],[158,265],[51,299],[340,528],[384,450],[92,412],[462,476],[569,631],[284,377],[454,509],[474,594],[169,428],[61,428],[28,264],[13,313],[341,653],[179,499],[423,495],[421,642],[44,64],[196,699],[286,366],[347,511],[482,674],[127,551],[32,683],[455,555],[208,598],[189,606],[464,574],[344,412],[513,563],[29,544],[325,592],[512,597],[277,674],[125,291],[320,700],[93,465],[416,473],[283,330],[317,547],[103,162],[168,654],[509,518],[513,598],[71,150],[54,463],[25,33],[412,689],[216,452],[193,338],[278,323],[100,434],[161,397],[30,112],[146,411],[393,656],[83,322],[193,282],[382,544],[184,235],[302,518],[322,340],[441,695],[566,683],[110,441],[233,420],[34,334],[84,651],[374,573],[13,337],[74,438],[429,572],[45,221],[98,210],[222,291],[102,364],[186,684],[204,596],[400,500],[41,565],[151,203],[187,370],[331,660],[278,298],[303,518],[403,635],[188,606],[424,469],[289,488],[331,526],[71,379],[222,490],[316,326],[68,216],[76,399],[193,603],[195,422],[211,679],[152,310],[107,525],[353,558],[14,410],[384,427],[448,670],[139,559],[287,361],[428,531],[149,465],[489,633],[66,451],[444,592],[435,541],[386,588],[152,154],[83,437],[570,677],[404,599],[236,242],[375,504],[355,426],[140,147],[175,203],[423,432],[64,187],[190,199],[678,698],[407,471],[324,545],[236,241],[332,544],[220,552],[6,293],[79,153],[532,617],[530,615],[281,648],[125,482],[46,668],[286,658],[36,391],[87,552],[346,533],[269,590],[407,574],[138,688],[159,231],[426,690],[184,682],[225,350],[311,664],[104,235],[221,351],[9,663],[459,611],[212,416],[210,400],[151,465],[25,632],[3,631],[195,517],[115,699],[510,569],[312,401],[44,340],[41,192],[197,697],[583,690],[440,593],[54,315],[218,697],[139,198],[83,411],[324,367],[426,661],[11,498],[190,604],[2,668],[342,659],[113,620],[129,668],[135,137],[346,622],[279,700],[387,501],[213,242],[269,460],[160,291],[99,268],[26,132],[199,634],[65,213],[111,394],[515,578],[43,441],[72,161],[257,506],[292,610],[120,530],[138,250],[596,647],[248,486],[450,612],[140,392],[372,628],[39,170],[1,356],[449,564],[368,473],[542,658],[15,197],[590,658],[224,636],[55,190],[133,631],[468,563],[403,610],[58,412],[71,234],[60,126],[245,407],[319,371],[4,57],[446,570],[22,164],[16,135],[41,224],[335,436],[184,343],[493,557],[141,599],[426,651],[587,699],[345,388],[55,102],[260,340],[392,535],[210,227],[21,453],[74,514],[290,326],[193,540],[248,513],[90,607],[1,322],[412,576],[250,350],[1,644],[421,472],[185,347],[374,552],[206,521],[171,348],[86,201],[92,282],[13,671],[497,629],[180,534],[282,609],[72,360],[503,545],[96,631],[124,154],[439,584],[183,624],[342,391],[198,627],[23,345],[137,421],[515,618],[244,305],[467,548],[474,563],[215,298],[288,470],[536,650],[168,191],[100,476],[9,637],[296,456],[24,567],[179,471],[293,445],[118,611],[229,416],[212,678],[347,363],[99,392],[250,353],[485,600],[131,450],[181,670],[105,427],[117,389],[431,693],[53,617],[278,358],[286,416],[3,551],[274,331],[65,418],[515,612],[140,481],[53,73],[259,292],[25,508],[146,479],[62,154],[94,98],[164,518],[142,204],[228,539],[276,611],[593,630],[251,397],[31,437],[110,605],[48,194],[178,392],[425,513],[442,475],[65,186],[431,560],[66,545],[180,182],[406,585],[173,340],[100,266],[46,328],[262,380],[246,625],[140,407],[276,623],[76,645],[46,491],[331,697],[44,279],[209,545],[37,437],[226,357],[71,177],[93,572],[166,555],[367,415],[478,484],[564,629],[85,385],[285,337],[61,669],[286,693],[102,548],[165,237],[7,553],[349,673],[144,234],[292,520],[154,588],[232,269],[239,523],[270,571],[238,441],[110,389],[157,466],[109,206],[235,406],[277,301],[21,295],[1,591],[264,663],[393,581],[14,130],[13,185],[248,348],[267,693],[206,247],[384,646],[81,413],[256,672],[155,457],[33,616],[12,325],[407,592],[385,528],[390,543],[80,423],[11,372],[72,264],[97,681],[333,567],[91,495],[422,453],[60,505],[13,53],[308,656],[343,376],[63,684],[102,655],[32,77],[154,366],[371,650],[180,341],[20,556],[59,152],[193,601],[101,592],[281,578],[91,582],[198,677],[107,612],[81,426],[25,212],[55,201],[242,329],[221,458],[364,624],[481,482],[351,602],[90,590],[98,388],[233,465],[32,678],[108,235],[116,312],[440,676],[128,310],[542,595],[37,456],[287,528],[176,286],[15,638],[7,419],[184,430],[450,668],[8,265],[19,281],[3,246],[649,663],[25,387],[339,681],[253,492],[516,544],[201,579],[15,543],[391,682],[114,527],[597,614],[197,450],[261,584],[304,546],[588,606],[314,681],[17,273],[444,605],[123,322],[562,600],[61,536],[167,246],[461,658],[383,443],[51,518],[148,624],[11,87],[182,346],[62,519],[465,666],[409,590],[15,663],[621,685],[593,659],[1,234],[371,589],[126,675],[395,631],[3,426],[260,336],[280,320],[165,599],[414,545],[81,217],[554,655],[179,586],[290,597],[304,615],[278,668],[236,538],[210,431],[378,575],[172,500],[14,182],[282,483],[321,353],[353,472],[6,266],[243,562],[200,522],[240,326],[294,652],[15,575],[509,668],[407,465],[72,121],[95,394],[13,213],[10,539],[212,213],[204,640],[28,47],[230,414],[205,516],[151,620],[282,663],[7,542],[141,270],[414,457],[68,175],[5,595],[42,412],[150,537],[164,557],[340,392],[302,686],[681,694],[513,584],[255,429],[80,141],[340,697],[619,647],[425,521],[322,639],[54,631],[349,565],[249,318],[478,681],[41,286],[182,552],[119,599],[134,256],[96,288],[356,520],[274,380],[31,568],[1,641],[488,681],[386,398],[416,580],[75,530],[313,480],[89,287],[219,431],[177,275],[500,626],[359,376],[82,135],[150,252],[98,369],[141,401],[173,656],[562,658],[136,595],[226,265],[362,651],[228,450],[200,294],[250,381],[678,691],[402,679],[122,599],[374,527],[271,307],[242,254],[552,655],[74,412],[243,469],[334,354],[423,682],[159,482],[433,478],[423,685],[56,180],[163,545],[50,240],[438,561],[1,472],[174,194],[306,575],[489,693],[45,132],[535,650],[286,677],[53,507],[202,659],[398,687],[300,565],[214,276],[112,340],[45,423],[25,435],[523,655],[442,503],[293,375],[38,340],[339,513],[98,577],[287,318],[185,502],[69,258],[288,696],[61,417],[352,700],[442,529],[34,55],[257,580],[39,198],[327,694],[88,437],[76,384],[240,472],[448,679],[309,496],[198,294],[134,394],[405,597],[57,234],[20,213],[51,143],[70,520],[103,508],[310,365],[207,398],[40,236],[492,521],[18,466],[414,471],[83,494],[102,193],[74,335],[20,408],[272,412],[256,516],[339,596],[174,552],[140,305],[148,447],[271,379],[35,334],[665,684],[487,539],[78,266],[18,34],[67,613],[27,446],[156,346],[49,496],[68,587],[263,651],[198,692],[80,550],[80,679],[141,564],[19,431],[388,549],[80,322],[1,276],[569,643],[572,667],[79,384],[192,662],[368,396],[184,657],[7,567],[13,322],[150,311],[302,377],[52,139],[405,608],[265,593],[168,651],[520,680],[426,668],[60,596],[539,555],[423,615],[453,601],[67,87],[106,356],[223,451],[17,519]]
Case 31
edges = [[518,944],[596,630],[416,536],[381,916],[737,959],[797,945],[417,697],[688,710],[84,778],[169,341],[97,713],[290,802],[279,784],[488,529],[336,361],[447,556],[186,326],[218,225],[762,959],[282,436],[583,742],[334,347],[373,716],[659,793],[70,520],[618,686],[24,184],[492,976],[675,737],[405,854],[230,683],[409,642],[577,597],[480,665],[197,680],[386,650],[68,938],[500,865],[79,585],[431,800],[648,952],[225,920],[167,182],[261,730],[19,658],[266,696],[521,956],[82,181],[114,770],[673,694],[390,573],[414,947],[85,888],[508,701],[56,738],[215,988],[396,463],[773,945],[516,690],[51,267],[10,394],[709,848],[83,935],[193,309],[627,906],[44,995],[220,319],[408,663],[435,682],[194,973],[146,483],[277,749],[750,790],[221,943],[8,555],[186,557],[551,834],[835,839],[218,333],[345,728],[198,556],[60,538],[69,677],[223,276],[238,497],[455,573],[740,850],[159,437],[344,641],[224,581],[850,993],[329,378],[366,578],[478,538],[433,723],[776,898],[210,423],[283,562],[234,779],[533,967],[215,605],[318,856],[96,421],[704,811],[201,259],[258,690],[190,442],[7,324],[367,574],[208,430],[697,986],[604,710],[156,260],[837,960],[229,415],[202,803],[250,355],[429,822],[343,900],[438,816],[243,780],[102,571],[445,880],[359,512],[98,346],[325,998],[51,868],[72,591],[420,563],[137,714],[134,350],[94,948],[633,801],[99,123],[299,881],[49,205],[511,541],[763,845],[504,922],[537,833],[25,207],[27,413],[484,637],[524,588],[717,870],[489,792],[505,734],[1,579],[253,688],[757,948],[436,537],[254,407],[391,471],[246,912],[162,913],[330,439],[543,632],[2,554],[460,928],[58,209],[689,783],[164,195],[284,775],[265,597],[222,443],[615,919],[599,617],[302,844],[435,569],[13,754],[136,364],[379,827],[71,819],[520,902],[357,645],[166,383],[574,749],[65,727],[320,328],[102,286],[373,412],[630,755],[379,813],[227,748],[765,846],[37,462],[386,614],[203,732],[211,334],[163,914],[803,942],[428,904],[70,335],[129,592],[183,760],[157,365],[62,974],[927,966],[300,335],[159,947],[47,359],[406,782],[356,907],[799,966],[494,644],[53,485],[372,626],[212,486],[173,898],[19,845],[80,780],[762,773],[142,798],[74,787],[341,954],[310,500],[113,811],[425,980],[110,171],[124,960],[132,725],[128,228],[53,940],[355,978],[292,522],[61,502],[239,403],[130,800],[602,683],[526,994],[5,913],[33,870],[715,741],[643,687],[474,964],[78,542],[481,711],[911,918],[160,516],[450,635],[726,801],[72,368],[231,425],[114,443],[853,908],[428,486],[247,692],[640,969],[284,539],[164,285],[262,589],[741,781],[506,1000],[873,901],[248,685],[274,455],[544,715],[468,754],[405,653],[9,481],[83,909],[92,720],[324,393],[48,116],[346,895],[401,658],[323,471],[271,907],[86,915],[491,875],[953,996],[219,786],[671,774],[596,670],[221,843],[283,357],[299,637],[312,404],[523,951],[141,989],[105,821],[281,349],[600,897],[422,746],[81,564],[315,988],[336,550],[143,855],[468,977],[657,667],[198,434],[769,871],[154,793],[85,892],[34,777],[237,612],[364,887],[459,648],[794,820],[153,931],[632,745],[249,292],[233,469],[881,951],[5,862],[157,771],[235,781],[178,723],[112,197],[21,30],[67,530],[204,321],[534,725],[111,758],[287,418],[209,956],[20,117],[501,832],[609,726],[595,877],[188,796],[206,540],[251,638],[294,533],[470,664],[220,685],[149,668],[46,128],[243,682],[660,760],[557,972],[343,368],[805,939],[883,889],[10,751],[314,594],[43,66],[111,716],[619,955],[199,809],[270,696],[94,902],[663,729],[452,842],[17,997],[12,380],[56,906],[127,818],[496,899],[205,465],[679,753],[254,832],[52,631],[58,958],[280,591],[387,458],[271,645],[86,179],[245,511],[185,684],[23,382],[590,836],[721,738],[408,512],[104,165],[293,876],[389,414],[2,168],[49,252],[73,434],[202,601],[158,466],[123,528],[223,636],[266,719],[298,326],[382,559],[255,802],[565,640],[264,707],[201,308],[298,756],[440,785],[32,510],[107,228],[332,874],[12,724],[505,810],[133,783],[446,815],[508,628],[330,841],[305,991],[105,779],[267,739],[196,813],[411,611],[607,746],[39,671],[293,823],[383,932],[426,580],[852,888],[479,949],[485,717],[28,445],[138,187],[327,676],[528,921],[172,784],[753,954],[20,401],[457,545],[115,982],[43,73],[101,122],[325,600],[404,992],[33,369],[677,886],[448,854],[384,427],[693,724],[241,301],[213,981],[567,799],[570,601],[886,963],[681,918],[156,903],[728,971],[491,792],[30,120],[22,611],[400,519],[767,995],[125,399],[422,552],[15,666],[77,358],[303,964],[177,629],[703,764],[571,623],[852,937],[376,575],[168,702],[474,774],[47,566],[473,554],[29,851],[353,955],[261,825],[733,734],[262,673],[536,704],[95,672],[40,515],[244,407],[695,861],[333,727],[174,482],[365,602],[415,461],[457,904],[698,990],[59,529],[282,791],[698,840],[633,953],[7,55],[348,625],[605,623],[729,939],[344,806],[57,584],[354,942],[615,740],[250,323],[75,88],[31,446],[587,857],[354,472],[97,207],[340,887],[248,776],[310,562],[588,655],[581,915],[9,540],[80,662],[236,322],[139,736],[296,353],[370,433],[518,583],[631,667],[555,851],[25,568],[249,450],[576,993],[458,653],[16,366],[17,412],[124,661],[313,371],[303,639],[388,869],[78,190],[362,973],[498,812],[121,603],[695,842],[91,302],[140,176],[87,765],[329,550],[598,950],[27,321],[273,534],[59,535],[612,900],[456,656],[233,795],[229,713],[517,882],[139,549],[172,244],[861,863],[864,928],[26,620],[211,991],[417,566],[184,519],[385,475],[16,674],[320,745],[137,189],[402,735],[112,311],[268,820],[183,999],[297,894],[100,744],[22,771],[736,858],[483,567],[369,985],[166,957],[360,905],[313,547],[691,860],[867,962],[240,943],[126,837],[307,865],[295,527],[460,986],[255,351],[649,761],[308,996],[84,768],[281,587],[82,621],[125,693],[32,453],[38,119],[706,989],[424,843],[208,212],[206,356],[247,625],[322,699],[35,509],[93,278],[200,650],[374,818],[121,578],[392,789],[304,763],[421,892],[352,975],[490,547],[294,360],[340,980],[257,589],[339,586],[103,694],[432,463],[285,480],[752,946],[380,419],[495,616],[331,398],[660,702],[620,759],[440,507],[40,767],[535,551],[273,772],[217,363],[544,840],[251,897],[100,705],[495,912],[92,138],[552,983],[193,911],[312,389],[316,822],[896,979],[147,941],[182,477],[610,619],[165,204],[61,657],[410,527],[171,882],[372,712],[113,572],[546,582],[93,957],[487,899],[149,328],[31,144],[592,917],[297,829],[790,925],[23,52],[858,891],[88,936],[260,1000],[103,314],[29,274],[118,478],[652,838],[510,703],[494,984],[127,606],[395,398],[506,885],[50,469],[317,462],[580,701],[532,593],[122,191],[358,475],[477,699],[76,108],[217,739],[747,808],[192,276],[459,821],[576,751],[147,836],[287,490],[347,923],[104,722],[11,561],[259,891],[352,429],[634,720],[747,849],[590,924],[757,761],[311,342],[237,950],[158,766],[735,990],[4,423],[90,288],[136,968],[42,878],[919,934],[38,99],[432,523],[41,598],[553,613],[908,982],[181,503],[278,385],[530,659],[64,794],[36,742],[413,970],[98,894],[213,467],[361,970],[155,514],[160,679],[143,883],[877,938],[224,489],[89,722],[232,691],[154,388],[116,603],[289,345],[342,548],[558,814],[62,831],[482,711],[402,464],[670,706],[185,307],[18,700],[126,295],[525,560],[130,789],[46,917],[175,910],[331,642],[131,499],[75,448],[77,634],[199,300],[37,439],[610,961],[456,824],[371,525],[13,146],[6,135],[222,807],[377,705],[608,889],[595,628],[135,810],[15,465],[180,844],[718,866],[150,622],[101,817],[376,963],[187,410],[759,895],[301,549],[107,636],[743,867],[178,656],[564,868],[473,864],[542,958],[418,420],[681,921],[309,613],[87,857],[526,933],[426,582],[8,496],[669,923],[68,997],[161,488],[91,903],[71,256],[561,849],[240,289],[351,686],[275,786],[28,437],[363,934],[1,257],[26,879],[714,732],[238,795],[339,707],[241,974],[227,638],[195,502],[145,890],[319,649],[191,841],[173,643],[60,63],[743,905],[493,830],[81,406],[235,618],[45,210],[627,644],[476,621],[501,607],[306,617],[106,577],[586,972],[317,639],[270,893],[493,531],[117,236],[563,775],[167,174],[179,978],[626,929],[115,338],[161,400],[230,866],[543,940],[665,808],[34,914],[788,798],[296,890],[635,756],[332,834],[14,169],[67,96],[200,316],[782,949],[541,624],[24,148],[403,826],[256,860],[54,378],[90,327],[647,872],[499,531],[674,872],[492,984],[616,874],[935,979],[855,871],[467,869],[676,826],[264,479],[641,814],[269,806],[265,559],[584,839],[175,395],[464,731],[131,983],[454,812],[162,977],[387,952],[151,926],[189,304],[838,975],[140,180],[232,830],[880,901],[155,513],[441,815],[909,976],[152,348],[76,509],[234,280],[646,730],[396,721],[424,896],[106,930],[141,929],[381,524],[675,927],[392,926],[272,712],[362,804],[678,719],[291,981],[3,878],[21,768],[286,517],[370,470],[318,419],[384,654],[731,807],[176,253],[453,744],[817,824],[188,305],[48,593],[134,847],[279,546],[11,797],[66,391],[163,787],[54,118],[599,609],[709,804],[654,862],[45,884],[196,664],[451,930],[377,570],[390,859],[50,967],[35,687],[6,569],[733,998],[708,932],[119,427],[785,848],[472,931],[290,875],[553,933],[258,484],[245,971],[349,514],[769,828],[708,985],[594,662],[315,941],[451,646],[409,668],[216,452],[268,920],[109,944],[170,879],[498,847],[700,770],[521,987],[441,444],[214,337],[214,827],[42,108],[133,560],[513,608],[144,216],[152,661],[150,579],[438,684],[788,853],[57,192],[655,833],[18,924],[430,936],[393,750],[4,809],[39,466],[219,263],[449,828],[442,965],[764,885],[242,916],[449,548],[252,431],[65,999],[55,651],[411,965],[151,375],[532,819],[74,873],[269,823],[263,922],[987,994],[226,825],[399,454],[177,669],[397,718],[231,461],[275,829],[545,755],[129,614],[41,893],[194,203],[539,831],[622,758],[64,79],[476,689],[69,132],[350,647],[89,272],[444,791],[604,652],[44,497],[3,575],[63,337],[374,856],[375,748],[606,937],[148,629],[153,306],[246,876],[109,678],[226,651],[558,859],[36,680],[624,778],[291,397],[796,992],[14,805],[170,239],[145,846],[515,863],[416,672],[367,969],[522,835],[110,961],[394,487],[242,752],[766,946],[338,568],[447,504],[816,884],[277,507],[95,565],[585,692],[120,666],[572,777],[288,925],[142,962],[503,910],[772,968]]