<gh_stars>0
# Perfect maze (tree) in a 50x50 grid 
# Nodes: 424
# Edges: 423

adjList=[
    [37, 1],
    [13, 2, 0],
    [1],
    [32, 4],
    [16, 5, 3],
    [18, 4],
    [19, 7],
    [21, 6],
    [22, 9],
    [24, 10, 8],
    [26, 9],
    [29, 12],
    [31, 11],
    [1, 14],
    [27, 13],
    [34, 16],
    [4, 15],
    [43, 18],
    [5, 17],
    [6, 20],
    [54, 19],
    [7, 22],
    [8, 21],
    [63, 24],
    [9, 23],
    [26],
    [91, 10, 25],
    [40, 14, 28],
    [41, 27],
    [11, 30],
    [49, 29],
    [12, 32],
    [3, 31],
    [38],
    [15, 35],
    [60, 34],
    [56],
    [48, 0, 38],
    [33, 37],
    [59, 40],
    [27, 39],
    [28, 42],
    [41],
    [17, 44],
    [43],
    [55],
    [64, 47],
    [78, 46],
    [37],
    [30, 50],
    [67, 49],
    [52],
    [85, 51],
    [69, 54],
    [20, 53],
    [88, 45, 56],
    [62, 36, 55],
    [72, 58],
    [73, 59, 57],
    [39, 58],
    [35, 61],
    [75, 60],
    [56],
    [23, 64],
    [46, 63],
    [79, 66],
    [82, 65],
    [50, 68],
    [84, 67],
    [53, 70],
    [87, 69],
    [123, 72],
    [57, 71],
    [58],
    [94, 75],
    [120, 61, 76, 74],
    [75],
    [97, 78],
    [47, 77],
    [65, 80],
    [101, 79],
    [117, 82],
    [66, 81],
    [104, 84],
    [68, 85, 83],
    [52, 86, 84],
    [85],
    [96, 70, 88],
    [55, 87],
    [106, 90],
    [111, 89],
    [26],
    [102],
    [130, 94],
    [74, 93],
    [131, 96],
    [87, 95],
    [77, 98],
    [113, 97],
    [124, 100],
    [107, 99],
    [80, 102],
    [116, 92, 101],
    [118, 104],
    [83, 103],
    [121, 106],
    [89, 105],
    [125, 100, 108],
    [107],
    [128, 110],
    [129, 109],
    [90, 112],
    [133, 111],
    [98, 114],
    [153, 113],
    [135, 116],
    [102, 115],
    [81, 118],
    [103, 117],
    [120],
    [75, 119],
    [105, 122],
    [140, 121],
    [71, 124],
    [99, 123],
    [107, 126],
    [142, 125],
    [143, 128],
    [109, 127],
    [110, 130],
    [93, 129],
    [95, 132],
    [150, 131],
    [112, 134],
    [151, 133],
    [115, 136],
    [158, 135],
    [190, 138],
    [173, 137],
    [166, 140],
    [122, 139],
    [170, 142],
    [156, 126, 141],
    [127, 144],
    [161, 143],
    [162, 146],
    [175, 145],
    [176, 148],
    [163, 147],
    [164, 150],
    [132, 149],
    [134, 152],
    [178, 153, 151],
    [114, 152],
    [187, 155],
    [169, 154],
    [142],
    [180, 158],
    [136, 157],
    [168, 160],
    [159],
    [144, 162],
    [145, 161],
    [148, 164],
    [149, 163],
    [186, 166],
    [139, 165],
    [168],
    [194, 159, 167],
    [155, 170],
    [141, 169],
    [172],
    [189, 171],
    [138, 174],
    [181, 173],
    [146, 176],
    [147, 175],
    [195, 178],
    [152, 177],
    [200, 180],
    [157, 179],
    [209, 174, 182],
    [232, 181],
    [214, 184],
    [191, 183],
    [203, 186],
    [165, 185],
    [154, 188],
    [198, 187],
    [172, 190],
    [137, 189],
    [184],
    [219, 193],
    [210, 192],
    [168, 195],
    [220, 177, 194],
    [221, 197],
    [245, 196],
    [213, 188, 199],
    [229, 198],
    [179, 201],
    [223, 200],
    [216, 203],
    [185, 202],
    [217, 205],
    [218, 204],
    [224, 207],
    [225, 206],
    [226, 209],
    [181, 208],
    [193, 211],
    [262, 210],
    [227, 213],
    [198, 212],
    [183, 215],
    [233, 214],
    [202, 217],
    [204, 216],
    [205, 219],
    [192, 218],
    [195, 221],
    [196, 220],
    [230],
    [201, 224],
    [206, 223],
    [207, 226],
    [208, 225],
    [212, 228],
    [247, 227],
    [199, 230],
    [222, 231, 229],
    [249, 230],
    [182, 233],
    [256, 215, 232],
    [257, 235],
    [238, 234],
    [242],
    [253],
    [281, 235, 239],
    [258, 238],
    [260, 241],
    [273, 242, 240],
    [236, 241],
    [244],
    [263, 245, 243],
    [197, 244],
    [265, 247],
    [228, 246],
    [267],
    [231, 250],
    [269, 249],
    [270, 252],
    [271, 251],
    [272, 237, 254],
    [253],
    [278, 256],
    [233, 255],
    [234],
    [239, 259],
    [282, 260, 258],
    [240, 259],
    [284, 262],
    [211, 261],
    [244, 264],
    [299, 263],
    [293, 246, 266],
    [287, 265],
    [248, 268],
    [274, 269, 267],
    [250, 270, 268],
    [251, 269],
    [275, 252, 272],
    [253, 271],
    [241],
    [268],
    [271],
    [303, 277],
    [311, 276],
    [255, 279],
    [295, 280, 278],
    [291, 281, 279],
    [238, 280],
    [259],
    [305, 284],
    [261, 283],
    [307, 286],
    [298, 285],
    [266, 288],
    [309, 287],
    [301, 290],
    [302, 289],
    [280],
    [317],
    [265],
    [312, 295],
    [279, 294],
    [315, 297],
    [316, 296],
    [286, 299],
    [264, 298],
    [324, 301],
    [289, 300],
    [290, 303],
    [276, 302],
    [331, 305],
    [283, 304],
    [348, 307],
    [285, 306],
    [323, 309],
    [288, 310, 308],
    [336, 309],
    [277, 312],
    [294, 313, 311],
    [312],
    [328, 315],
    [296, 314],
    [297, 317],
    [292, 316],
    [334, 319],
    [363, 318],
    [326, 321],
    [337, 320],
    [350, 323],
    [308, 322],
    [300, 325],
    [341, 324],
    [320],
    [342, 328],
    [314, 327],
    [355, 330],
    [344, 331, 329],
    [304, 330],
    [347],
    [334],
    [318, 333],
    [336],
    [339, 310, 335],
    [354, 321, 338],
    [337],
    [336],
    [357, 341],
    [325, 340],
    [327, 343],
    [359, 342],
    [330, 345],
    [361, 344],
    [377, 347],
    [367, 332, 346],
    [306, 349],
    [362, 348],
    [386, 322, 351],
    [370, 350],
    [364, 353],
    [365, 354, 352],
    [337, 353],
    [329],
    [371, 357],
    [340, 356],
    [372, 359],
    [343, 358],
    [419, 361],
    [345, 360],
    [349, 363],
    [379, 319, 362],
    [352],
    [353, 366],
    [382, 365],
    [347, 368],
    [384, 369, 367],
    [385, 368],
    [351, 371],
    [356, 370],
    [358, 373],
    [390, 372],
    [391, 375],
    [393, 374],
    [377],
    [395, 346, 376],
    [402, 379],
    [363, 378],
    [407, 381],
    [411, 380],
    [366, 383],
    [399, 382],
    [368],
    [369],
    [350, 387],
    [404, 386],
    [405, 389],
    [406, 388],
    [373, 391],
    [374, 390],
    [418, 393],
    [375, 392],
    [420, 395],
    [377, 394],
    [412, 397],
    [413, 396],
    [414, 399],
    [415, 383, 398],
    [421, 401],
    [422, 400],
    [378, 403],
    [423, 402],
    [410, 387, 405],
    [388, 404],
    [389, 407],
    [380, 406],
    [416],
    [410],
    [404, 409],
    [381, 412],
    [396, 411],
    [397, 414],
    [398, 413],
    [399, 416],
    [408, 417, 415],
    [416],
    [392, 419],
    [360, 418],
    [394, 421],
    [400, 420],
    [401, 423],
    [403, 422]]

# x coord, y coord
nodeData = [   
    (2, 1),
    (7, 1),
    (10, 1),
    (20, 1),
    (26, 1),
    (31, 1),
    (33, 1),
    (37, 1),
    (39, 1),
    (45, 1),
    (49, 1),
    (13, 2),
    (18, 2),
    (7, 3),
    (9, 3),
    (23, 3),
    (26, 3),
    (28, 3),
    (31, 3),
    (33, 3),
    (35, 3),
    (37, 3),
    (39, 3),
    (43, 3),
    (45, 3),
    (48, 3),
    (49, 3),
    (9, 4),
    (11, 4),
    (13, 4),
    (15, 4),
    (18, 4),
    (20, 4),
    (4, 5),
    (23, 5),
    (25, 5),
    (41, 5),
    (2, 6),
    (4, 6),
    (7, 6),
    (9, 6),
    (11, 6),
    (12, 6),
    (28, 6),
    (32, 6),
    (38, 6),
    (45, 6),
    (47, 6),
    (2, 7),
    (15, 7),
    (19, 7),
    (21, 7),
    (23, 7),
    (33, 7),
    (35, 7),
    (38, 7),
    (41, 7),
    (4, 8),
    (6, 8),
    (7, 8),
    (25, 8),
    (30, 8),
    (41, 8),
    (43, 8),
    (45, 8),
    (8, 9),
    (17, 9),
    (19, 9),
    (21, 9),
    (33, 9),
    (36, 9),
    (2, 10),
    (4, 10),
    (6, 10),
    (28, 10),
    (30, 10),
    (31, 10),
    (45, 10),
    (47, 10),
    (8, 11),
    (10, 11),
    (15, 11),
    (17, 11),
    (19, 11),
    (21, 11),
    (23, 11),
    (24, 11),
    (36, 11),
    (38, 11),
    (40, 11),
    (42, 11),
    (49, 11),
    (13, 12),
    (26, 12),
    (28, 12),
    (33, 12),
    (36, 12),
    (45, 12),
    (47, 12),
    (4, 13),
    (6, 13),
    (10, 13),
    (13, 13),
    (17, 13),
    (19, 13),
    (37, 13),
    (40, 13),
    (6, 14),
    (8, 14),
    (22, 14),
    (24, 14),
    (42, 14),
    (44, 14),
    (47, 14),
    (50, 14),
    (11, 15),
    (13, 15),
    (15, 15),
    (17, 15),
    (28, 15),
    (30, 15),
    (37, 15),
    (41, 15),
    (2, 16),
    (4, 16),
    (6, 16),
    (8, 16),
    (20, 16),
    (22, 16),
    (24, 16),
    (26, 16),
    (33, 16),
    (36, 16),
    (44, 16),
    (46, 16),
    (11, 17),
    (13, 17),
    (16, 17),
    (18, 17),
    (39, 17),
    (41, 17),
    (5, 18),
    (8, 18),
    (20, 18),
    (23, 18),
    (25, 18),
    (27, 18),
    (29, 18),
    (31, 18),
    (34, 18),
    (36, 18),
    (46, 18),
    (49, 18),
    (50, 18),
    (1, 19),
    (3, 19),
    (8, 19),
    (10, 19),
    (13, 19),
    (43, 19),
    (44, 19),
    (23, 20),
    (25, 20),
    (31, 20),
    (34, 20),
    (37, 20),
    (39, 20),
    (42, 20),
    (43, 20),
    (3, 21),
    (5, 21),
    (13, 21),
    (14, 21),
    (18, 21),
    (20, 21),
    (27, 21),
    (29, 21),
    (46, 21),
    (49, 21),
    (8, 22),
    (10, 22),
    (20, 22),
    (22, 22),
    (24, 22),
    (26, 22),
    (31, 22),
    (37, 22),
    (1, 23),
    (4, 23),
    (14, 23),
    (16, 23),
    (26, 23),
    (39, 23),
    (41, 23),
    (43, 23),
    (46, 23),
    (48, 23),
    (50, 23),
    (4, 24),
    (6, 24),
    (8, 24),
    (11, 24),
    (29, 24),
    (31, 24),
    (33, 24),
    (35, 24),
    (14, 25),
    (16, 25),
    (18, 25),
    (20, 25),
    (41, 25),
    (43, 25),
    (1, 26),
    (4, 26),
    (24, 26),
    (26, 26),
    (29, 26),
    (33, 26),
    (35, 26),
    (39, 26),
    (46, 26),
    (48, 26),
    (8, 27),
    (11, 27),
    (14, 27),
    (16, 27),
    (18, 27),
    (1, 28),
    (4, 28),
    (6, 28),
    (8, 28),
    (10, 28),
    (22, 28),
    (26, 28),
    (28, 28),
    (30, 28),
    (41, 28),
    (19, 29),
    (30, 29),
    (32, 29),
    (35, 29),
    (38, 29),
    (41, 29),
    (45, 29),
    (47, 29),
    (50, 29),
    (2, 30),
    (4, 30),
    (6, 30),
    (10, 30),
    (12, 30),
    (15, 30),
    (17, 30),
    (19, 30),
    (20, 30),
    (24, 30),
    (26, 30),
    (28, 30),
    (32, 31),
    (34, 31),
    (35, 31),
    (41, 31),
    (43, 31),
    (47, 31),
    (49, 31),
    (2, 32),
    (4, 32),
    (6, 32),
    (10, 32),
    (12, 32),
    (15, 32),
    (17, 32),
    (19, 32),
    (38, 32),
    (10, 33),
    (17, 33),
    (20, 33),
    (22, 33),
    (24, 33),
    (26, 33),
    (28, 33),
    (30, 33),
    (34, 33),
    (39, 33),
    (41, 33),
    (44, 33),
    (46, 33),
    (4, 34),
    (7, 34),
    (13, 34),
    (15, 34),
    (28, 34),
    (35, 34),
    (2, 35),
    (24, 35),
    (26, 35),
    (31, 35),
    (33, 35),
    (46, 35),
    (49, 35),
    (10, 36),
    (13, 36),
    (15, 36),
    (20, 36),
    (37, 36),
    (39, 36),
    (42, 36),
    (44, 36),
    (4, 37),
    (7, 37),
    (8, 37),
    (22, 37),
    (24, 37),
    (26, 37),
    (29, 37),
    (31, 37),
    (33, 37),
    (35, 37),
    (46, 37),
    (49, 37),
    (17, 38),
    (20, 38),
    (2, 39),
    (4, 39),
    (10, 39),
    (14, 39),
    (17, 39),
    (26, 39),
    (29, 39),
    (31, 39),
    (33, 39),
    (37, 39),
    (40, 39),
    (45, 39),
    (46, 39),
    (7, 40),
    (8, 40),
    (20, 40),
    (23, 40),
    (8, 41),
    (12, 41),
    (14, 41),
    (26, 41),
    (28, 41),
    (33, 41),
    (35, 41),
    (38, 41),
    (40, 41),
    (42, 41),
    (47, 41),
    (2, 42),
    (4, 42),
    (15, 42),
    (17, 42),
    (20, 42),
    (31, 42),
    (6, 43),
    (12, 43),
    (23, 43),
    (28, 43),
    (33, 43),
    (35, 43),
    (47, 43),
    (49, 43),
    (15, 44),
    (17, 44),
    (19, 44),
    (40, 44),
    (42, 44),
    (44, 44),
    (4, 45),
    (6, 45),
    (23, 45),
    (25, 45),
    (27, 45),
    (31, 45),
    (36, 45),
    (38, 45),
    (47, 45),
    (49, 45),
    (10, 46),
    (13, 46),
    (19, 46),
    (21, 46),
    (42, 46),
    (44, 46),
    (2, 47),
    (4, 47),
    (6, 47),
    (8, 47),
    (25, 47),
    (27, 47),
    (29, 47),
    (31, 47),
    (36, 47),
    (38, 47),
    (15, 48),
    (17, 48),
    (19, 48),
    (21, 48),
    (39, 48),
    (42, 48),
    (47, 48),
    (49, 48),
    (4, 49),
    (6, 49),
    (8, 49),
    (10, 49),
    (23, 49),
    (3, 50),
    (4, 50),
    (13, 50),
    (15, 50),
    (17, 50),
    (19, 50),
    (21, 50),
    (23, 50),
    (26, 50),
    (29, 50),
    (33, 50),
    (36, 50),
    (39, 50),
    (42, 50),
    (49, 50)]
