Re: Pattern Matching

[*([[[*(ab),*(cd)],e],[fg,*(hi)]]),x]

(0, (0, 0))
(1, (2, 15))
(2, (3, 13))
(3, (4, 8))
(4, (a, 5, 5))
(5, (b, 6, 6))
(6, (4, 7))
(7, (12, 12))
(8, (c, 9, 9))
(9, (d, 10, 10))
(10, (8, 11))
(11, (12, 12))
(12, (14, 14))
(13, (e, 14, 14))
(14, (23, 23))
(15, (16, 18))
(16, (f, 17, 17))
(17, (g, 22, 22))
(18, (h, 19, 19))
(19, (i, 20, 20))
(20, (18, 21))
(21, (22, 22))
(22, (23, 23))
(23, (24, 24))
(24, (1, 25))
(25, (26, 26))
(26, (x, 27, 27))
(27, (0, 0))