const edge_table = (0x0109, 0x0203, 0x030a, 0x0406, 0x050f,
                    0x0605, 0x070c, 0x080c, 0x0905, 0x0a0f, 0x0b06,
                    0x0c0a, 0x0d03, 0x0e09, 0x0f00, 0x0190, 0x0099,
                    0x0393, 0x029a, 0x0596, 0x049f, 0x0795, 0x069c,
                    0x099c, 0x0895, 0x0b9f, 0x0a96, 0x0d9a, 0x0c93,
                    0x0f99, 0x0e90, 0x0230, 0x0339, 0x0033, 0x013a,
                    0x0636, 0x073f, 0x0435, 0x053c, 0x0a3c, 0x0b35,
                    0x083f, 0x0936, 0x0e3a, 0x0f33, 0x0c39, 0x0d30,
                    0x03a0, 0x02a9, 0x01a3, 0x00aa, 0x07a6, 0x06af,
                    0x05a5, 0x04ac, 0x0bac, 0x0aa5, 0x09af, 0x08a6,
                    0x0faa, 0x0ea3, 0x0da9, 0x0ca0, 0x0460, 0x0569,
                    0x0663, 0x076a, 0x0066, 0x016f, 0x0265, 0x036c,
                    0x0c6c, 0x0d65, 0x0e6f, 0x0f66, 0x086a, 0x0963,
                    0x0a69, 0x0b60, 0x05f0, 0x04f9, 0x07f3, 0x06fa,
                    0x01f6, 0x00ff, 0x03f5, 0x02fc, 0x0dfc, 0x0cf5,
                    0x0fff, 0x0ef6, 0x09fa, 0x08f3, 0x0bf9, 0x0af0,
                    0x0650, 0x0759, 0x0453, 0x055a, 0x0256, 0x035f,
                    0x0055, 0x015c, 0x0e5c, 0x0f55, 0x0c5f, 0x0d56,
                    0x0a5a, 0x0b53, 0x0859, 0x0950, 0x07c0, 0x06c9,
                    0x05c3, 0x04ca, 0x03c6, 0x02cf, 0x01c5, 0x00cc,
                    0x0fcc, 0x0ec5, 0x0dcf, 0x0cc6, 0x0bca, 0x0ac3,
                    0x09c9, 0x08c0, 0x08c0, 0x09c9, 0x0ac3, 0x0bca,
                    0x0cc6, 0x0dcf, 0x0ec5, 0x0fcc, 0x00cc, 0x01c5,
                    0x02cf, 0x03c6, 0x04ca, 0x05c3, 0x06c9, 0x07c0,
                    0x0950, 0x0859, 0x0b53, 0x0a5a, 0x0d56, 0x0c5f,
                    0x0f55, 0x0e5c, 0x015c, 0x0055, 0x035f, 0x0256,
                    0x055a, 0x0453, 0x0759, 0x0650, 0x0af0, 0x0bf9,
                    0x08f3, 0x09fa, 0x0ef6, 0x0fff, 0x0cf5, 0x0dfc,
                    0x02fc, 0x03f5, 0x00ff, 0x01f6, 0x06fa, 0x07f3,
                    0x04f9, 0x05f0, 0x0b60, 0x0a69, 0x0963, 0x086a,
                    0x0f66, 0x0e6f, 0x0d65, 0x0c6c, 0x036c, 0x0265,
                    0x016f, 0x0066, 0x076a, 0x0663, 0x0569, 0x0460,
                    0x0ca0, 0x0da9, 0x0ea3, 0x0faa, 0x08a6, 0x09af,
                    0x0aa5, 0x0bac, 0x04ac, 0x05a5, 0x06af, 0x07a6,
                    0x00aa, 0x01a3, 0x02a9, 0x03a0, 0x0d30, 0x0c39,
                    0x0f33, 0x0e3a, 0x0936, 0x083f, 0x0b35, 0x0a3c,
                    0x053c, 0x0435, 0x073f, 0x0636, 0x013a, 0x0033,
                    0x0339, 0x0230, 0x0e90, 0x0f99, 0x0c93, 0x0d9a,
                    0x0a96, 0x0b9f, 0x0895, 0x099c, 0x069c, 0x0795,
                    0x049f, 0x0596, 0x029a, 0x0393, 0x0099, 0x0190,
                    0x0f00, 0x0e09, 0x0d03, 0x0c0a, 0x0b06, 0x0a0f,
                    0x0905, 0x080c, 0x070c, 0x0605, 0x050f, 0x0406,
                    0x030a, 0x0203, 0x0109)

const tri_table = ( (0x01, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x09, 0x04, 0x0a, 0x09, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x04, 0x02, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x03, 0x0b, 0x01, 0x03, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x09, 0x04, 0x03, 0x0b, 0x09, 0x0b, 0x0a, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0c, 0x03, 0x09, 0x0c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0a, 0x01, 0x03, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0c, 0x03, 0x02, 0x0a, 0x0c, 0x0a, 0x09, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0b, 0x02, 0x0c, 0x0b, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0b, 0x02, 0x01, 0x09, 0x0b, 0x09, 0x0c, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0a, 0x01, 0x04, 0x0c, 0x0a, 0x0c, 0x0b, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x09, 0x0b, 0x0b, 0x09, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x04, 0x01, 0x08, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x09, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x02, 0x0a, 0x05, 0x08, 0x02, 0x08, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x09, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x05, 0x08, 0x04, 0x01, 0x05, 0x02, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x03, 0x0b, 0x0a, 0x01, 0x03, 0x09, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x0b, 0x0a, 0x03, 0x0a, 0x08, 0x03, 0x08, 0x04, 0x08, 0x0a, 0x05, 0x00, 0x00, 0x00),
                    (0x09, 0x05, 0x08, 0x04, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x05, 0x08, 0x0c, 0x03, 0x05, 0x03, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x01, 0x02, 0x09, 0x05, 0x08, 0x03, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x08, 0x0c, 0x0a, 0x05, 0x0c, 0x0a, 0x0c, 0x03, 0x0a, 0x03, 0x02, 0x00, 0x00, 0x00),
                    (0x04, 0x0b, 0x02, 0x04, 0x0c, 0x0b, 0x08, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0c, 0x0b, 0x02, 0x05, 0x0c, 0x02, 0x01, 0x05, 0x08, 0x0c, 0x05, 0x00, 0x00, 0x00),
                    (0x05, 0x08, 0x09, 0x0a, 0x01, 0x0c, 0x0a, 0x0c, 0x0b, 0x0c, 0x01, 0x04, 0x00, 0x00, 0x00),
                    (0x05, 0x08, 0x0c, 0x05, 0x0c, 0x0a, 0x0a, 0x0c, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x01, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x06, 0x05, 0x02, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x06, 0x05, 0x09, 0x04, 0x06, 0x04, 0x02, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x0a, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x01, 0x09, 0x02, 0x03, 0x0b, 0x05, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x03, 0x0b, 0x06, 0x05, 0x03, 0x05, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x0b, 0x06, 0x04, 0x03, 0x06, 0x04, 0x06, 0x05, 0x04, 0x05, 0x09, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x03, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0c, 0x03, 0x01, 0x09, 0x0c, 0x05, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x06, 0x05, 0x01, 0x02, 0x06, 0x03, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x02, 0x06, 0x03, 0x06, 0x09, 0x03, 0x09, 0x0c, 0x05, 0x09, 0x06, 0x00, 0x00, 0x00),
                    (0x0b, 0x04, 0x0c, 0x0b, 0x02, 0x04, 0x0a, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0a, 0x06, 0x01, 0x09, 0x02, 0x09, 0x0b, 0x02, 0x09, 0x0c, 0x0b, 0x00, 0x00, 0x00),
                    (0x06, 0x05, 0x01, 0x06, 0x01, 0x0c, 0x06, 0x0c, 0x0b, 0x0c, 0x01, 0x04, 0x00, 0x00, 0x00),
                    (0x06, 0x05, 0x09, 0x06, 0x09, 0x0b, 0x0b, 0x09, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x08, 0x09, 0x06, 0x08, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x04, 0x01, 0x0a, 0x06, 0x04, 0x06, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x08, 0x09, 0x01, 0x02, 0x08, 0x02, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x06, 0x04, 0x04, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x08, 0x09, 0x0a, 0x06, 0x08, 0x0b, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x02, 0x03, 0x0a, 0x06, 0x01, 0x06, 0x04, 0x01, 0x06, 0x08, 0x04, 0x00, 0x00, 0x00),
                    (0x09, 0x01, 0x03, 0x09, 0x03, 0x06, 0x09, 0x06, 0x08, 0x0b, 0x06, 0x03, 0x00, 0x00, 0x00),
                    (0x03, 0x0b, 0x06, 0x03, 0x06, 0x04, 0x04, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x0a, 0x06, 0x08, 0x09, 0x0a, 0x04, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x08, 0x0a, 0x08, 0x03, 0x0a, 0x03, 0x01, 0x03, 0x08, 0x0c, 0x00, 0x00, 0x00),
                    (0x03, 0x04, 0x0c, 0x01, 0x02, 0x09, 0x02, 0x08, 0x09, 0x02, 0x06, 0x08, 0x00, 0x00, 0x00),
                    (0x0c, 0x03, 0x02, 0x0c, 0x02, 0x08, 0x08, 0x02, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x09, 0x09, 0x06, 0x08, 0x0b, 0x02, 0x04, 0x0b, 0x04, 0x0c, 0x00, 0x00, 0x00),
                    (0x06, 0x08, 0x01, 0x06, 0x01, 0x0a, 0x08, 0x0c, 0x01, 0x02, 0x01, 0x0b, 0x0c, 0x0b, 0x01),
                    (0x0c, 0x0b, 0x01, 0x0c, 0x01, 0x04, 0x0b, 0x06, 0x01, 0x09, 0x01, 0x08, 0x06, 0x08, 0x01),
                    (0x0c, 0x0b, 0x06, 0x08, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x04, 0x06, 0x0b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x01, 0x02, 0x06, 0x0b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x09, 0x04, 0x02, 0x0a, 0x09, 0x06, 0x0b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x07, 0x06, 0x03, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x07, 0x06, 0x02, 0x03, 0x07, 0x04, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x07, 0x06, 0x0a, 0x01, 0x07, 0x01, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x0a, 0x09, 0x06, 0x09, 0x03, 0x06, 0x03, 0x07, 0x04, 0x03, 0x09, 0x00, 0x00, 0x00),
                    (0x03, 0x04, 0x0c, 0x0b, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x01, 0x09, 0x0c, 0x03, 0x01, 0x0b, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x03, 0x04, 0x0c, 0x06, 0x0b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x0b, 0x07, 0x02, 0x0a, 0x03, 0x0a, 0x0c, 0x03, 0x0a, 0x09, 0x0c, 0x00, 0x00, 0x00),
                    (0x07, 0x04, 0x0c, 0x07, 0x06, 0x04, 0x06, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x0c, 0x01, 0x0c, 0x06, 0x01, 0x06, 0x02, 0x06, 0x0c, 0x07, 0x00, 0x00, 0x00),
                    (0x04, 0x0c, 0x07, 0x01, 0x04, 0x07, 0x01, 0x07, 0x06, 0x01, 0x06, 0x0a, 0x00, 0x00, 0x00),
                    (0x07, 0x06, 0x0a, 0x07, 0x0a, 0x0c, 0x0c, 0x0a, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x0b, 0x07, 0x05, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x04, 0x01, 0x05, 0x08, 0x04, 0x07, 0x06, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0a, 0x01, 0x06, 0x0b, 0x07, 0x09, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x07, 0x06, 0x02, 0x0a, 0x08, 0x02, 0x08, 0x04, 0x08, 0x0a, 0x05, 0x00, 0x00, 0x00),
                    (0x07, 0x02, 0x03, 0x07, 0x06, 0x02, 0x05, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x06, 0x06, 0x03, 0x07, 0x04, 0x01, 0x05, 0x04, 0x05, 0x08, 0x00, 0x00, 0x00),
                    (0x09, 0x05, 0x08, 0x0a, 0x01, 0x06, 0x01, 0x07, 0x06, 0x01, 0x03, 0x07, 0x00, 0x00, 0x00),
                    (0x08, 0x04, 0x0a, 0x08, 0x0a, 0x05, 0x04, 0x03, 0x0a, 0x06, 0x0a, 0x07, 0x03, 0x07, 0x0a),
                    (0x04, 0x0c, 0x03, 0x08, 0x09, 0x05, 0x0b, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x0b, 0x07, 0x05, 0x08, 0x03, 0x05, 0x03, 0x01, 0x03, 0x08, 0x0c, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x05, 0x08, 0x09, 0x03, 0x04, 0x0c, 0x06, 0x0b, 0x07, 0x00, 0x00, 0x00),
                    (0x0a, 0x03, 0x02, 0x0a, 0x0c, 0x03, 0x0a, 0x05, 0x0c, 0x08, 0x0c, 0x05, 0x06, 0x0b, 0x07),
                    (0x09, 0x05, 0x08, 0x04, 0x0c, 0x06, 0x04, 0x06, 0x02, 0x06, 0x0c, 0x07, 0x00, 0x00, 0x00),
                    (0x06, 0x02, 0x0c, 0x06, 0x0c, 0x07, 0x02, 0x01, 0x0c, 0x08, 0x0c, 0x05, 0x01, 0x05, 0x0c),
                    (0x01, 0x06, 0x0a, 0x01, 0x07, 0x06, 0x01, 0x04, 0x07, 0x0c, 0x07, 0x04, 0x09, 0x05, 0x08),
                    (0x07, 0x06, 0x0a, 0x07, 0x0a, 0x0c, 0x05, 0x08, 0x0a, 0x08, 0x0c, 0x0a, 0x00, 0x00, 0x00),
                    (0x0b, 0x05, 0x0a, 0x07, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0b, 0x07, 0x05, 0x0a, 0x0b, 0x01, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x01, 0x02, 0x0b, 0x07, 0x01, 0x07, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x04, 0x02, 0x09, 0x02, 0x07, 0x09, 0x07, 0x05, 0x07, 0x02, 0x0b, 0x00, 0x00, 0x00),
                    (0x02, 0x05, 0x0a, 0x02, 0x03, 0x05, 0x03, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x01, 0x09, 0x02, 0x03, 0x0a, 0x03, 0x05, 0x0a, 0x03, 0x07, 0x05, 0x00, 0x00, 0x00),
                    (0x01, 0x03, 0x05, 0x05, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x04, 0x03, 0x09, 0x03, 0x05, 0x05, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x05, 0x0a, 0x0b, 0x07, 0x05, 0x0c, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x03, 0x03, 0x09, 0x0c, 0x05, 0x0a, 0x0b, 0x05, 0x0b, 0x07, 0x00, 0x00, 0x00),
                    (0x04, 0x0c, 0x03, 0x01, 0x02, 0x07, 0x01, 0x07, 0x05, 0x07, 0x02, 0x0b, 0x00, 0x00, 0x00),
                    (0x07, 0x05, 0x02, 0x07, 0x02, 0x0b, 0x05, 0x09, 0x02, 0x03, 0x02, 0x0c, 0x09, 0x0c, 0x02),
                    (0x0a, 0x07, 0x05, 0x0a, 0x04, 0x07, 0x0a, 0x02, 0x04, 0x0c, 0x07, 0x04, 0x00, 0x00, 0x00),
                    (0x09, 0x0c, 0x02, 0x09, 0x02, 0x01, 0x0c, 0x07, 0x02, 0x0a, 0x02, 0x05, 0x07, 0x05, 0x02),
                    (0x04, 0x0c, 0x07, 0x04, 0x07, 0x01, 0x01, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x05, 0x09, 0x0c, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x0b, 0x07, 0x08, 0x09, 0x0b, 0x09, 0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x08, 0x04, 0x01, 0x0b, 0x08, 0x01, 0x0a, 0x0b, 0x07, 0x08, 0x0b, 0x00, 0x00, 0x00),
                    (0x0b, 0x07, 0x08, 0x02, 0x0b, 0x08, 0x02, 0x08, 0x09, 0x02, 0x09, 0x01, 0x00, 0x00, 0x00),
                    (0x0b, 0x07, 0x08, 0x0b, 0x08, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x07, 0x02, 0x07, 0x09, 0x02, 0x09, 0x0a, 0x09, 0x07, 0x08, 0x00, 0x00, 0x00),
                    (0x03, 0x07, 0x0a, 0x03, 0x0a, 0x02, 0x07, 0x08, 0x0a, 0x01, 0x0a, 0x04, 0x08, 0x04, 0x0a),
                    (0x08, 0x09, 0x01, 0x08, 0x01, 0x07, 0x07, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x04, 0x03, 0x07, 0x08, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x04, 0x0c, 0x0b, 0x07, 0x09, 0x0b, 0x09, 0x0a, 0x09, 0x07, 0x08, 0x00, 0x00, 0x00),
                    (0x03, 0x01, 0x08, 0x03, 0x08, 0x0c, 0x01, 0x0a, 0x08, 0x07, 0x08, 0x0b, 0x0a, 0x0b, 0x08),
                    (0x02, 0x09, 0x01, 0x02, 0x08, 0x09, 0x02, 0x0b, 0x08, 0x07, 0x08, 0x0b, 0x03, 0x04, 0x0c),
                    (0x0c, 0x03, 0x02, 0x0c, 0x02, 0x08, 0x0b, 0x07, 0x02, 0x07, 0x08, 0x02, 0x00, 0x00, 0x00),
                    (0x09, 0x0a, 0x07, 0x09, 0x07, 0x08, 0x0a, 0x02, 0x07, 0x0c, 0x07, 0x04, 0x02, 0x04, 0x07),
                    (0x01, 0x0a, 0x02, 0x0c, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x09, 0x01, 0x08, 0x01, 0x07, 0x04, 0x0c, 0x01, 0x0c, 0x07, 0x01, 0x00, 0x00, 0x00),
                    (0x08, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x07, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x01, 0x09, 0x0c, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x0c, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x02, 0x0a, 0x09, 0x04, 0x02, 0x0c, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x02, 0x03, 0x07, 0x0c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x04, 0x01, 0x09, 0x07, 0x0c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x0a, 0x01, 0x03, 0x0b, 0x0a, 0x07, 0x0c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x0c, 0x08, 0x03, 0x0b, 0x04, 0x0b, 0x09, 0x04, 0x0b, 0x0a, 0x09, 0x00, 0x00, 0x00),
                    (0x08, 0x03, 0x04, 0x07, 0x03, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x01, 0x09, 0x08, 0x07, 0x01, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x08, 0x07, 0x03, 0x04, 0x08, 0x01, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x07, 0x03, 0x02, 0x09, 0x07, 0x02, 0x0a, 0x09, 0x09, 0x08, 0x07, 0x00, 0x00, 0x00),
                    (0x0b, 0x08, 0x07, 0x0b, 0x02, 0x08, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x08, 0x07, 0x02, 0x08, 0x0b, 0x02, 0x09, 0x08, 0x02, 0x01, 0x09, 0x00, 0x00, 0x00),
                    (0x01, 0x04, 0x08, 0x01, 0x08, 0x0b, 0x01, 0x0b, 0x0a, 0x07, 0x0b, 0x08, 0x00, 0x00, 0x00),
                    (0x08, 0x07, 0x0b, 0x08, 0x0b, 0x09, 0x09, 0x0b, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x09, 0x05, 0x0c, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x07, 0x0c, 0x04, 0x01, 0x07, 0x01, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x07, 0x0c, 0x09, 0x05, 0x07, 0x0a, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x05, 0x07, 0x0a, 0x07, 0x04, 0x0a, 0x04, 0x02, 0x0c, 0x04, 0x07, 0x00, 0x00, 0x00),
                    (0x07, 0x09, 0x05, 0x07, 0x0c, 0x09, 0x03, 0x0b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x04, 0x01, 0x0c, 0x01, 0x07, 0x0c, 0x01, 0x05, 0x07, 0x00, 0x00, 0x00),
                    (0x05, 0x0c, 0x09, 0x05, 0x07, 0x0c, 0x01, 0x03, 0x0a, 0x03, 0x0b, 0x0a, 0x00, 0x00, 0x00),
                    (0x0b, 0x0a, 0x04, 0x0b, 0x04, 0x03, 0x0a, 0x05, 0x04, 0x0c, 0x04, 0x07, 0x05, 0x07, 0x04),
                    (0x09, 0x03, 0x04, 0x09, 0x05, 0x03, 0x05, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x05, 0x03, 0x05, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0a, 0x01, 0x03, 0x04, 0x05, 0x03, 0x05, 0x07, 0x05, 0x04, 0x09, 0x00, 0x00, 0x00),
                    (0x02, 0x0a, 0x05, 0x02, 0x05, 0x03, 0x03, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x02, 0x04, 0x09, 0x07, 0x02, 0x09, 0x05, 0x07, 0x07, 0x0b, 0x02, 0x00, 0x00, 0x00),
                    (0x0b, 0x02, 0x01, 0x0b, 0x01, 0x07, 0x07, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x07, 0x04, 0x05, 0x04, 0x09, 0x07, 0x0b, 0x04, 0x01, 0x04, 0x0a, 0x0b, 0x0a, 0x04),
                    (0x0b, 0x0a, 0x05, 0x07, 0x0b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0a, 0x06, 0x08, 0x07, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x04, 0x05, 0x0a, 0x06, 0x0c, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x01, 0x02, 0x06, 0x05, 0x01, 0x08, 0x07, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x08, 0x07, 0x09, 0x04, 0x05, 0x04, 0x06, 0x05, 0x04, 0x02, 0x06, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x0b, 0x02, 0x03, 0x08, 0x07, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x0c, 0x08, 0x02, 0x03, 0x0b, 0x01, 0x09, 0x04, 0x05, 0x0a, 0x06, 0x00, 0x00, 0x00),
                    (0x08, 0x07, 0x0c, 0x06, 0x05, 0x0b, 0x05, 0x03, 0x0b, 0x05, 0x01, 0x03, 0x00, 0x00, 0x00),
                    (0x04, 0x05, 0x09, 0x04, 0x06, 0x05, 0x04, 0x03, 0x06, 0x0b, 0x06, 0x03, 0x0c, 0x08, 0x07),
                    (0x08, 0x03, 0x04, 0x08, 0x07, 0x03, 0x06, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x01, 0x09, 0x07, 0x01, 0x07, 0x03, 0x07, 0x09, 0x08, 0x00, 0x00, 0x00),
                    (0x04, 0x07, 0x03, 0x04, 0x08, 0x07, 0x02, 0x06, 0x01, 0x06, 0x05, 0x01, 0x00, 0x00, 0x00),
                    (0x07, 0x03, 0x09, 0x07, 0x09, 0x08, 0x03, 0x02, 0x09, 0x05, 0x09, 0x06, 0x02, 0x06, 0x09),
                    (0x0a, 0x06, 0x05, 0x0b, 0x02, 0x07, 0x02, 0x08, 0x07, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00),
                    (0x02, 0x07, 0x0b, 0x02, 0x08, 0x07, 0x02, 0x01, 0x08, 0x09, 0x08, 0x01, 0x0a, 0x06, 0x05),
                    (0x05, 0x01, 0x0b, 0x05, 0x0b, 0x06, 0x01, 0x04, 0x0b, 0x07, 0x0b, 0x08, 0x04, 0x08, 0x0b),
                    (0x08, 0x07, 0x0b, 0x08, 0x0b, 0x09, 0x06, 0x05, 0x0b, 0x05, 0x09, 0x0b, 0x00, 0x00, 0x00),
                    (0x07, 0x0a, 0x06, 0x07, 0x0c, 0x0a, 0x0c, 0x09, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x07, 0x0c, 0x01, 0x07, 0x04, 0x01, 0x06, 0x07, 0x01, 0x0a, 0x06, 0x00, 0x00, 0x00),
                    (0x01, 0x0c, 0x09, 0x01, 0x06, 0x0c, 0x01, 0x02, 0x06, 0x06, 0x07, 0x0c, 0x00, 0x00, 0x00),
                    (0x07, 0x0c, 0x04, 0x07, 0x04, 0x06, 0x06, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x0a, 0x06, 0x0c, 0x0a, 0x0c, 0x09, 0x0c, 0x06, 0x07, 0x00, 0x00, 0x00),
                    (0x01, 0x0c, 0x04, 0x01, 0x07, 0x0c, 0x01, 0x0a, 0x07, 0x06, 0x07, 0x0a, 0x02, 0x03, 0x0b),
                    (0x0c, 0x09, 0x06, 0x0c, 0x06, 0x07, 0x09, 0x01, 0x06, 0x0b, 0x06, 0x03, 0x01, 0x03, 0x06),
                    (0x07, 0x0c, 0x04, 0x07, 0x04, 0x06, 0x03, 0x0b, 0x04, 0x0b, 0x06, 0x04, 0x00, 0x00, 0x00),
                    (0x06, 0x09, 0x0a, 0x06, 0x03, 0x09, 0x06, 0x07, 0x03, 0x04, 0x09, 0x03, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x07, 0x0a, 0x07, 0x01, 0x01, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x06, 0x09, 0x02, 0x09, 0x01, 0x06, 0x07, 0x09, 0x04, 0x09, 0x03, 0x07, 0x03, 0x09),
                    (0x02, 0x06, 0x07, 0x03, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x04, 0x07, 0x02, 0x07, 0x0b, 0x04, 0x09, 0x07, 0x06, 0x07, 0x0a, 0x09, 0x0a, 0x07),
                    (0x0b, 0x02, 0x01, 0x0b, 0x01, 0x07, 0x0a, 0x06, 0x01, 0x06, 0x07, 0x01, 0x00, 0x00, 0x00),
                    (0x01, 0x04, 0x09, 0x06, 0x07, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x06, 0x0b, 0x08, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x06, 0x0b, 0x0c, 0x08, 0x06, 0x09, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x0c, 0x08, 0x06, 0x0b, 0x0c, 0x02, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x08, 0x06, 0x0b, 0x0c, 0x08, 0x0a, 0x09, 0x02, 0x09, 0x04, 0x02, 0x00, 0x00, 0x00),
                    (0x0c, 0x02, 0x03, 0x0c, 0x08, 0x02, 0x08, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x04, 0x02, 0x03, 0x08, 0x02, 0x08, 0x06, 0x08, 0x03, 0x0c, 0x00, 0x00, 0x00),
                    (0x0a, 0x08, 0x06, 0x0a, 0x03, 0x08, 0x0a, 0x01, 0x03, 0x03, 0x0c, 0x08, 0x00, 0x00, 0x00),
                    (0x08, 0x06, 0x03, 0x08, 0x03, 0x0c, 0x06, 0x0a, 0x03, 0x04, 0x03, 0x09, 0x0a, 0x09, 0x03),
                    (0x03, 0x06, 0x0b, 0x03, 0x04, 0x06, 0x04, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x03, 0x01, 0x09, 0x06, 0x03, 0x09, 0x08, 0x06, 0x0b, 0x03, 0x06, 0x00, 0x00, 0x00),
                    (0x0a, 0x01, 0x02, 0x06, 0x0b, 0x04, 0x06, 0x04, 0x08, 0x04, 0x0b, 0x03, 0x00, 0x00, 0x00),
                    (0x0a, 0x09, 0x03, 0x0a, 0x03, 0x02, 0x09, 0x08, 0x03, 0x0b, 0x03, 0x06, 0x08, 0x06, 0x03),
                    (0x02, 0x04, 0x06, 0x04, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x08, 0x01, 0x08, 0x02, 0x02, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x01, 0x04, 0x0a, 0x04, 0x06, 0x06, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x09, 0x08, 0x06, 0x0a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x09, 0x05, 0x06, 0x0b, 0x09, 0x0b, 0x0c, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x01, 0x05, 0x06, 0x0c, 0x01, 0x06, 0x0b, 0x0c, 0x0c, 0x04, 0x01, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x09, 0x05, 0x0b, 0x09, 0x0b, 0x0c, 0x0b, 0x05, 0x06, 0x00, 0x00, 0x00),
                    (0x0b, 0x0c, 0x05, 0x0b, 0x05, 0x06, 0x0c, 0x04, 0x05, 0x0a, 0x05, 0x02, 0x04, 0x02, 0x05),
                    (0x03, 0x06, 0x02, 0x03, 0x09, 0x06, 0x03, 0x0c, 0x09, 0x05, 0x06, 0x09, 0x00, 0x00, 0x00),
                    (0x01, 0x05, 0x0c, 0x01, 0x0c, 0x04, 0x05, 0x06, 0x0c, 0x03, 0x0c, 0x02, 0x06, 0x02, 0x0c),
                    (0x01, 0x03, 0x06, 0x01, 0x06, 0x0a, 0x03, 0x0c, 0x06, 0x05, 0x06, 0x09, 0x0c, 0x09, 0x06),
                    (0x0a, 0x05, 0x06, 0x03, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x06, 0x0b, 0x04, 0x06, 0x03, 0x04, 0x05, 0x06, 0x04, 0x09, 0x05, 0x00, 0x00, 0x00),
                    (0x06, 0x0b, 0x03, 0x06, 0x03, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0b, 0x03, 0x04, 0x06, 0x0b, 0x04, 0x09, 0x06, 0x05, 0x06, 0x09, 0x01, 0x02, 0x0a),
                    (0x06, 0x0b, 0x03, 0x06, 0x03, 0x05, 0x02, 0x0a, 0x03, 0x0a, 0x05, 0x03, 0x00, 0x00, 0x00),
                    (0x09, 0x05, 0x06, 0x09, 0x06, 0x04, 0x04, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x05, 0x06, 0x02, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x05, 0x06, 0x09, 0x06, 0x04, 0x0a, 0x01, 0x06, 0x01, 0x04, 0x06, 0x00, 0x00, 0x00),
                    (0x0a, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0c, 0x08, 0x05, 0x0a, 0x0c, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x04, 0x05, 0x0a, 0x08, 0x0a, 0x0c, 0x08, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00),
                    (0x02, 0x0b, 0x0c, 0x02, 0x0c, 0x05, 0x02, 0x05, 0x01, 0x08, 0x05, 0x0c, 0x00, 0x00, 0x00),
                    (0x04, 0x02, 0x05, 0x04, 0x05, 0x09, 0x02, 0x0b, 0x05, 0x08, 0x05, 0x0c, 0x0b, 0x0c, 0x05),
                    (0x05, 0x0c, 0x08, 0x0a, 0x0c, 0x05, 0x0a, 0x03, 0x0c, 0x0a, 0x02, 0x03, 0x00, 0x00, 0x00),
                    (0x0a, 0x08, 0x05, 0x0a, 0x0c, 0x08, 0x0a, 0x02, 0x0c, 0x03, 0x0c, 0x02, 0x01, 0x09, 0x04),
                    (0x0c, 0x08, 0x05, 0x0c, 0x05, 0x03, 0x03, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x08, 0x05, 0x0c, 0x05, 0x03, 0x09, 0x04, 0x05, 0x04, 0x03, 0x05, 0x00, 0x00, 0x00),
                    (0x03, 0x0a, 0x0b, 0x03, 0x08, 0x0a, 0x03, 0x04, 0x08, 0x08, 0x05, 0x0a, 0x00, 0x00, 0x00),
                    (0x0a, 0x0b, 0x08, 0x0a, 0x08, 0x05, 0x0b, 0x03, 0x08, 0x09, 0x08, 0x01, 0x03, 0x01, 0x08),
                    (0x04, 0x08, 0x0b, 0x04, 0x0b, 0x03, 0x08, 0x05, 0x0b, 0x02, 0x0b, 0x01, 0x05, 0x01, 0x0b),
                    (0x02, 0x0b, 0x03, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0a, 0x02, 0x05, 0x02, 0x08, 0x08, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0a, 0x02, 0x05, 0x02, 0x08, 0x01, 0x09, 0x02, 0x09, 0x08, 0x02, 0x00, 0x00, 0x00),
                    (0x05, 0x01, 0x04, 0x08, 0x05, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x09, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x0b, 0x09, 0x0b, 0x0c, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x01, 0x0a, 0x04, 0x0a, 0x0c, 0x0c, 0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0b, 0x01, 0x0b, 0x09, 0x09, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x02, 0x0b, 0x0c, 0x04, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0c, 0x02, 0x0c, 0x0a, 0x0a, 0x0c, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x01, 0x0a, 0x04, 0x0a, 0x0c, 0x02, 0x03, 0x0a, 0x03, 0x0c, 0x0a, 0x00, 0x00, 0x00),
                    (0x01, 0x03, 0x0c, 0x09, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x03, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x04, 0x09, 0x03, 0x09, 0x0b, 0x0b, 0x09, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x0b, 0x03, 0x01, 0x0a, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x04, 0x09, 0x03, 0x09, 0x0b, 0x01, 0x02, 0x09, 0x02, 0x0b, 0x09, 0x00, 0x00, 0x00),
                    (0x02, 0x0b, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x04, 0x09, 0x0a, 0x02, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x04, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))

const _mc_verts = ((0x01, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x09, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x04, 0x02, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x03, 0x0b, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x09, 0x04, 0x0b, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0c, 0x03, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0a, 0x01, 0x03, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0c, 0x03, 0x0a, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0b, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0b, 0x02, 0x09, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0a, 0x01, 0x0c, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x09, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x04, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x09, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x02, 0x0a, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x09, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x05, 0x08, 0x01, 0x02, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x03, 0x0b, 0x01, 0x09, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x0b, 0x0a, 0x08, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x05, 0x08, 0x04, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x05, 0x08, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x01, 0x02, 0x09, 0x05, 0x08, 0x03, 0x04, 0x0c, 0x00, 0x00, 0x00),
                    (0x05, 0x08, 0x0c, 0x0a, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0b, 0x02, 0x0c, 0x08, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0c, 0x0b, 0x05, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x08, 0x09, 0x0a, 0x01, 0x0c, 0x0b, 0x04, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x08, 0x0c, 0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x01, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x06, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x06, 0x05, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x0a, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x01, 0x09, 0x02, 0x03, 0x0b, 0x05, 0x0a, 0x06, 0x00, 0x00, 0x00),
                    (0x06, 0x03, 0x0b, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x0b, 0x06, 0x04, 0x05, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x03, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0c, 0x03, 0x09, 0x05, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x06, 0x05, 0x02, 0x03, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x02, 0x06, 0x09, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0a, 0x06, 0x01, 0x09, 0x02, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x05, 0x01, 0x0c, 0x0b, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x05, 0x09, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x08, 0x09, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x04, 0x01, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x08, 0x09, 0x02, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x06, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x08, 0x09, 0x06, 0x0b, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x02, 0x03, 0x0a, 0x06, 0x01, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x01, 0x03, 0x06, 0x08, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x0b, 0x06, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x0a, 0x06, 0x09, 0x04, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x08, 0x03, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x04, 0x0c, 0x01, 0x02, 0x09, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x03, 0x02, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x09, 0x08, 0x0b, 0x02, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x08, 0x01, 0x0a, 0x0c, 0x02, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x0b, 0x01, 0x04, 0x06, 0x09, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x0b, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x04, 0x06, 0x0b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x01, 0x02, 0x06, 0x0b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x09, 0x04, 0x0a, 0x06, 0x0b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x07, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x07, 0x06, 0x03, 0x04, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x07, 0x06, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x0a, 0x09, 0x03, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x04, 0x0c, 0x0b, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x01, 0x09, 0x03, 0x0b, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x03, 0x04, 0x0c, 0x06, 0x0b, 0x07, 0x00, 0x00, 0x00),
                    (0x06, 0x0b, 0x07, 0x02, 0x0a, 0x03, 0x0c, 0x09, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x04, 0x0c, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x0c, 0x06, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0c, 0x07, 0x01, 0x06, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x06, 0x0a, 0x0c, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x0b, 0x07, 0x05, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x04, 0x01, 0x08, 0x07, 0x06, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0a, 0x01, 0x06, 0x0b, 0x07, 0x09, 0x05, 0x08, 0x00, 0x00, 0x00),
                    (0x0b, 0x07, 0x06, 0x02, 0x0a, 0x08, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x02, 0x03, 0x06, 0x05, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x06, 0x07, 0x04, 0x01, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x05, 0x08, 0x0a, 0x01, 0x06, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x04, 0x0a, 0x05, 0x03, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0c, 0x03, 0x08, 0x09, 0x05, 0x0b, 0x07, 0x06, 0x00, 0x00, 0x00),
                    (0x06, 0x0b, 0x07, 0x05, 0x08, 0x03, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x05, 0x08, 0x09, 0x03, 0x04, 0x0c, 0x06, 0x0b, 0x07),
                    (0x0a, 0x03, 0x02, 0x0c, 0x05, 0x08, 0x06, 0x0b, 0x07, 0x00, 0x00, 0x00),
                    (0x09, 0x05, 0x08, 0x04, 0x0c, 0x06, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x02, 0x0c, 0x07, 0x01, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x06, 0x0a, 0x07, 0x04, 0x0c, 0x09, 0x05, 0x08, 0x00, 0x00, 0x00),
                    (0x07, 0x06, 0x0a, 0x0c, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x05, 0x0a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0b, 0x07, 0x0a, 0x01, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x01, 0x02, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x04, 0x02, 0x07, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x05, 0x0a, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x01, 0x09, 0x02, 0x03, 0x0a, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x03, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x04, 0x03, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x05, 0x0a, 0x07, 0x0c, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x03, 0x0c, 0x05, 0x0a, 0x0b, 0x07, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0c, 0x03, 0x01, 0x02, 0x07, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x05, 0x02, 0x0b, 0x09, 0x03, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x07, 0x05, 0x04, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x0c, 0x02, 0x01, 0x07, 0x0a, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0c, 0x07, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x05, 0x09, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x0b, 0x07, 0x09, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x08, 0x04, 0x0b, 0x0a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x07, 0x08, 0x02, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x07, 0x08, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x07, 0x09, 0x0a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x07, 0x0a, 0x02, 0x08, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x09, 0x01, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x04, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x04, 0x0c, 0x0b, 0x07, 0x09, 0x0a, 0x08, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x01, 0x08, 0x0c, 0x0a, 0x07, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x09, 0x01, 0x08, 0x0b, 0x07, 0x03, 0x04, 0x0c, 0x00, 0x00, 0x00),
                    (0x0c, 0x03, 0x02, 0x08, 0x0b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x0a, 0x07, 0x08, 0x02, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0a, 0x02, 0x0c, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x09, 0x01, 0x07, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x07, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x01, 0x09, 0x0c, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x0c, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x02, 0x0a, 0x04, 0x0c, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x02, 0x03, 0x07, 0x0c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x04, 0x01, 0x09, 0x07, 0x0c, 0x08, 0x00, 0x00, 0x00),
                    (0x03, 0x0a, 0x01, 0x0b, 0x07, 0x0c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x0c, 0x08, 0x03, 0x0b, 0x04, 0x09, 0x0a, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x03, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x01, 0x09, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x08, 0x07, 0x04, 0x01, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x07, 0x03, 0x09, 0x0a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x08, 0x07, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x08, 0x07, 0x02, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x04, 0x08, 0x0b, 0x0a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x07, 0x0b, 0x09, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x09, 0x05, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x07, 0x0c, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x07, 0x0c, 0x05, 0x0a, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x05, 0x07, 0x04, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x09, 0x05, 0x0c, 0x03, 0x0b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x04, 0x01, 0x0c, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0c, 0x09, 0x07, 0x01, 0x03, 0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x0a, 0x04, 0x03, 0x05, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x03, 0x04, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x05, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0a, 0x01, 0x03, 0x04, 0x05, 0x07, 0x09, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0a, 0x05, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x02, 0x04, 0x07, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x02, 0x01, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x07, 0x04, 0x09, 0x0b, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x0a, 0x05, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0a, 0x06, 0x08, 0x07, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x04, 0x05, 0x0a, 0x06, 0x0c, 0x08, 0x07, 0x00, 0x00, 0x00),
                    (0x06, 0x01, 0x02, 0x05, 0x08, 0x07, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x08, 0x07, 0x09, 0x04, 0x05, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x0b, 0x02, 0x03, 0x08, 0x07, 0x0c, 0x00, 0x00, 0x00),
                    (0x07, 0x0c, 0x08, 0x02, 0x03, 0x0b, 0x01, 0x09, 0x04, 0x05, 0x0a, 0x06),
                    (0x08, 0x07, 0x0c, 0x06, 0x05, 0x0b, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x05, 0x09, 0x06, 0x03, 0x0b, 0x0c, 0x08, 0x07, 0x00, 0x00, 0x00),
                    (0x08, 0x03, 0x04, 0x07, 0x06, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x01, 0x09, 0x07, 0x03, 0x08, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x07, 0x03, 0x08, 0x02, 0x06, 0x01, 0x05, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x03, 0x09, 0x08, 0x02, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x05, 0x0b, 0x02, 0x07, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x07, 0x0b, 0x08, 0x01, 0x09, 0x0a, 0x06, 0x05, 0x00, 0x00, 0x00),
                    (0x05, 0x01, 0x0b, 0x06, 0x04, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x07, 0x0b, 0x09, 0x06, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x0a, 0x06, 0x0c, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x07, 0x0c, 0x01, 0x06, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0c, 0x09, 0x06, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x0c, 0x04, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0b, 0x0a, 0x06, 0x0c, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0c, 0x04, 0x07, 0x0a, 0x06, 0x02, 0x03, 0x0b, 0x00, 0x00, 0x00),
                    (0x0c, 0x09, 0x06, 0x07, 0x01, 0x0b, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x07, 0x0c, 0x04, 0x06, 0x03, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x09, 0x0a, 0x03, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x06, 0x07, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x06, 0x09, 0x01, 0x07, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x06, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x04, 0x07, 0x0b, 0x09, 0x06, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x02, 0x01, 0x07, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x04, 0x09, 0x06, 0x07, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x06, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x06, 0x0b, 0x08, 0x09, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x0c, 0x08, 0x0b, 0x02, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x08, 0x06, 0x0c, 0x0a, 0x09, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x02, 0x03, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x04, 0x02, 0x03, 0x08, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x08, 0x06, 0x03, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x08, 0x06, 0x03, 0x0c, 0x0a, 0x04, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x06, 0x0b, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x03, 0x01, 0x06, 0x08, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x01, 0x02, 0x06, 0x0b, 0x04, 0x08, 0x03, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x09, 0x03, 0x02, 0x08, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x04, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x08, 0x02, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x01, 0x04, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x09, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x09, 0x05, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x01, 0x05, 0x0c, 0x0b, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0a, 0x09, 0x05, 0x0b, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00),
                    (0x0b, 0x0c, 0x05, 0x06, 0x04, 0x0a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x06, 0x02, 0x09, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x05, 0x0c, 0x04, 0x06, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x03, 0x06, 0x0a, 0x0c, 0x05, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x05, 0x06, 0x03, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x06, 0x0b, 0x04, 0x05, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x06, 0x0b, 0x03, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x0b, 0x03, 0x06, 0x09, 0x05, 0x01, 0x02, 0x0a, 0x00, 0x00, 0x00),
                    (0x06, 0x0b, 0x03, 0x05, 0x02, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x05, 0x06, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x05, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x09, 0x05, 0x06, 0x04, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0c, 0x08, 0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x09, 0x04, 0x05, 0x0a, 0x08, 0x0c, 0x0b, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0b, 0x0c, 0x05, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x02, 0x05, 0x09, 0x0b, 0x08, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0c, 0x08, 0x0a, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x08, 0x05, 0x0c, 0x02, 0x03, 0x01, 0x09, 0x04, 0x00, 0x00, 0x00),
                    (0x0c, 0x08, 0x05, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0c, 0x08, 0x05, 0x03, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x0a, 0x0b, 0x08, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x0b, 0x08, 0x05, 0x03, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x08, 0x0b, 0x03, 0x05, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0b, 0x03, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0a, 0x02, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x0a, 0x02, 0x08, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x01, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x05, 0x09, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x0b, 0x09, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x01, 0x0a, 0x0c, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x02, 0x0b, 0x09, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x02, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x03, 0x0c, 0x0a, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x01, 0x0a, 0x0c, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x03, 0x0c, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x04, 0x03, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x04, 0x09, 0x0b, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x0a, 0x0b, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x03, 0x04, 0x09, 0x0b, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x0b, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x02, 0x04, 0x09, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x0a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                    (0x01, 0x04, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))

# equvalency mapping table to _mc_connectivity
const _mc_eq_mapping = (0x01, 0x01, 0x02, 0x01, 0x03, 0x02, 0x04, 0x01, 0x02, 0x03, 0x04,
                        0x02, 0x04, 0x04, 0x05, 0x01, 0x02, 0x03, 0x04, 0x03, 0x06, 0x06,
                        0x07, 0x03, 0x04, 0x08, 0x09, 0x06, 0x0a, 0x0b, 0x0c, 0x01, 0x03,
                        0x02, 0x04, 0x03, 0x08, 0x04, 0x09, 0x03, 0x06, 0x06, 0x0d, 0x06,
                        0x0e, 0x07, 0x0c, 0x02, 0x04, 0x04, 0x05, 0x06, 0x0e, 0x0d, 0x0c,
                        0x06, 0x07, 0x0e, 0x0c, 0x0f, 0x10, 0x10, 0x11, 0x01, 0x03, 0x03,
                        0x06, 0x02, 0x06, 0x04, 0x0d, 0x03, 0x06, 0x08, 0x0e, 0x04, 0x07,
                        0x09, 0x0c, 0x03, 0x06, 0x08, 0x0b, 0x06, 0x0f, 0x0e, 0x10, 0x08,
                        0x0b, 0x12, 0x13, 0x0b, 0x10, 0x13, 0x14, 0x02, 0x06, 0x04, 0x07,
                        0x04, 0x0e, 0x05, 0x0c, 0x06, 0x0f, 0x0b, 0x10, 0x0a, 0x10, 0x0c,
                        0x11, 0x04, 0x0a, 0x09, 0x0c, 0x07, 0x10, 0x0c, 0x11, 0x0b, 0x10,
                        0x13, 0x14, 0x10, 0x03, 0x14, 0x01, 0x01, 0x03, 0x03, 0x06, 0x03,
                        0x08, 0x06, 0x0e, 0x02, 0x04, 0x06, 0x15, 0x04, 0x16, 0x0d, 0x0c,
                        0x02, 0x04, 0x06, 0x0d, 0x06, 0x0e, 0x17, 0x10, 0x04, 0x18, 0x0b,
                        0x0c, 0x15, 0x0c, 0x10, 0x11, 0x03, 0x08, 0x06, 0x0e, 0x08, 0x12,
                        0x0e, 0x13, 0x06, 0x0b, 0x17, 0x10, 0x0e, 0x13, 0x10, 0x14, 0x04,
                        0x16, 0x15, 0x0c, 0x0b, 0x13, 0x10, 0x14, 0x0a, 0x0c, 0x10, 0x11,
                        0x10, 0x14, 0x03, 0x01, 0x02, 0x06, 0x06, 0x17, 0x04, 0x0b, 0x15,
                        0x10, 0x04, 0x0a, 0x0b, 0x10, 0x18, 0x0c, 0x0c, 0x11, 0x04, 0x15,
                        0x0b, 0x10, 0x0a, 0x10, 0x10, 0x03, 0x16, 0x0c, 0x13, 0x14, 0x0c,
                        0x11, 0x14, 0x01, 0x04, 0x0e, 0x0d, 0x10, 0x16, 0x13, 0x0c, 0x14,
                        0x15, 0x10, 0x10, 0x03, 0x0c, 0x14, 0x11, 0x01, 0x18, 0x0c, 0x0c,
                        0x11, 0x0c, 0x14, 0x11, 0x01, 0x0c, 0x11, 0x14, 0x01, 0x11, 0x01, 0x01)

const _mc_connectivity = ((0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x01, 0x04, 0x02, 0x04, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x03, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x01, 0x04, 0x02, 0x05, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x01, 0x03, 0x04, 0x01, 0x04, 0x05, 0x04, 0x03, 0x06, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x04, 0x01, 0x03, 0x04, 0x03, 0x05, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x01, 0x04, 0x02, 0x01, 0x05, 0x04, 0x06, 0x02, 0x04, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x04, 0x06, 0x07, 0x06, 0x05, 0x08, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x01, 0x03, 0x04, 0x04, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x01, 0x03, 0x04, 0x01, 0x04, 0x05, 0x06, 0x04, 0x03, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x05, 0x07, 0x06, 0x05, 0x08, 0x07, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x03, 0x02, 0x04, 0x05, 0x06, 0x07, 0x05, 0x07, 0x08, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x01, 0x03, 0x04, 0x02, 0x05, 0x03, 0x06, 0x03, 0x07, 0x05, 0x07, 0x03),
                            (0x01, 0x02, 0x03, 0x04, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x01, 0x04, 0x02, 0x01, 0x05, 0x04, 0x06, 0x04, 0x05, 0x07, 0x08, 0x09),
                            (0x01, 0x02, 0x03, 0x01, 0x03, 0x04, 0x05, 0x06, 0x03, 0x06, 0x04, 0x03, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x01, 0x04, 0x02, 0x01, 0x05, 0x04, 0x04, 0x06, 0x02, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x04, 0x02, 0x01, 0x04, 0x05, 0x02, 0x04, 0x06, 0x05, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x01, 0x04, 0x02, 0x05, 0x06, 0x07, 0x06, 0x08, 0x07, 0x00, 0x00, 0x00),
                            (0x01, 0x02, 0x03, 0x02, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00))

const _mc_edge_list = ((0x01, 0x02), (0x02, 0x03), (0x03, 0x04), (0x04, 0x01),
                        (0x05, 0x06), (0x06, 0x07), (0x07, 0x08), (0x08, 0x05),
                        (0x01, 0x05), (0x02, 0x06), (0x03, 0x07), (0x04, 0x08))


#
# proximal ALM implementation
#
module ProxAL

using Ipopt, JuMP
using Printf, CatViews
using ExaPF
using ExaTron
using LinearAlgebra
using SparseArrays
using MPI

abstract type AbstractPrimalSolution end
abstract type AbstractDualSolution end
abstract type AbstractBackend end
abstract type AbstractBlocks end
mutable struct ProxALProblem
    opfBlockData::AbstractBlocks

    #---- iterate information ----
    x::AbstractPrimalSolution
    λ::AbstractDualSolution
    xprev::AbstractPrimalSolution
    λprev::AbstractDualSolution
    objvalue::Vector{Float64}
    lyapunov::Vector{Float64}
    maxviol_t::Vector{Float64}
    maxviol_c::Vector{Float64}
    maxviol_d::Vector{Float64}
    maxviol_t_actual::Vector{Float64}
    maxviol_c_actual::Vector{Float64}
    dist_x::Vector{Float64}
    dist_λ::Vector{Float64}
    nlp_opt_sol::Array{Float64,2}
    nlp_soltime::Vector{Float64}
    wall_time_elapsed_actual::Float64
    wall_time_elapsed_ideal::Float64
    iter

    #---- other/static information ----
    opt_sol::Dict
    lyapunov_sol::Dict
    initial_solve::Bool
    par_order
    plt
end

include("Evaluators/Evaluators.jl")
include("params.jl")
include("OPF/opfdata.jl")
include("OPF/opfsolution.jl")
include("backends.jl")
include("blocks.jl")
include("OPF/opfmodel.jl")
include("communication.jl")
include("Evaluators/ProxALEvalutor.jl")
include("Evaluators/NonDecomposedModel.jl")

export ModelInfo, AlgParams
export ProxALEvaluator, NonDecomposedModel
export optimize!
export JuMPBackend, ExaPFBackend, ExaTronBackend

function update_primal_nlpvars(x::AbstractPrimalSolution, opfBlockData::AbstractBlocks, blk::Int,
                               modelinfo::ModelInfo,
                               algparams::AlgParams)
    block = opfBlockData.blkIndex[blk]
    k = block[1]
    t = block[2]
    range_k = algparams.decompCtgs ? (k:k) : (1:(modelinfo.num_ctgs + 1))

    from = 1
    to = size(x.Pg,1)*length(range_k)
    @views x.Pg[:,range_k,t][:] .= opfBlockData.colValue[from:to,blk]

    from = 1+to
    to = to + size(x.Qg, 1)*length(range_k)
    @views x.Qg[:,range_k,t][:] .= opfBlockData.colValue[from:to,blk]

    from = 1+to
    to = to + size(x.Vm, 1)*length(range_k)
    @views x.Vm[:,range_k,t][:] .= opfBlockData.colValue[from:to,blk]

    from = 1+to
    to = to + size(x.Va, 1)*length(range_k)
    @views x.Va[:,range_k,t][:] .= opfBlockData.colValue[from:to,blk]

    from = 1+to
    to = to + length(range_k)
    @views x.ωt[range_k,t] .= opfBlockData.colValue[from:to,blk]

    from = 1+to
    to = to + size(x.St, 1)
    if !algparams.decompCtgs || k == 1
        @views x.St[:,t] .= opfBlockData.colValue[from:to,blk]
    end

    # Zt will be updated in update_primal_penalty
    from = 1+to
    to = to + size(x.Zt, 1)

    from = 1+to
    to = to + size(x.Sk, 1)*length(range_k)
    if !algparams.decompCtgs || k > 1
        @views x.Sk[:,range_k,t][:] .= opfBlockData.colValue[from:to,blk]
    end

    from = 1+to
    to = to + size(x.Zk, 1)*length(range_k)
    if !algparams.decompCtgs
        @views x.Zk[:,range_k,t][:] .= opfBlockData.colValue[from:to,blk]
    end

    return nothing
end

function update_primal_penalty(x::AbstractPrimalSolution, opfdata::OPFData,
                               opfBlockData::AbstractBlocks, blk::Int,
                               primal::AbstractPrimalSolution,
                               dual::AbstractDualSolution,
                               modelinfo::ModelInfo,
                               algparams::AlgParams)
    ngen = size(x.Pg, 1)
    block = opfBlockData.blkIndex[blk]
    k = block[1]
    t = block[2]

    if t > 1 && k == 1 && modelinfo.time_link_constr_type == :penalty
        β = [opfdata.generators[g].ramp_agc for g=1:ngen]
        @views x.Zt[:,t] .= (((algparams.ρ_t/32.0)*primal.Zt[:,t]) .- dual.ramping[:,t] .-
                                (algparams.ρ_t*(x.Pg[:,1,t-1] .- x.Pg[:,1,t] .+ x.St[:,t] .- β))
                            ) ./  max(algparams.zero, (algparams.ρ_t/32.0) + algparams.ρ_t + (modelinfo.obj_scale*algparams.θ_t))
    end
    if k > 1 && algparams.decompCtgs
        if modelinfo.ctgs_link_constr_type ∈ [:frequency_penalty, :preventive_penalty, :corrective_penalty]
            if modelinfo.ctgs_link_constr_type == :corrective_penalty
                β = [opfdata.generators[g].scen_agc for g=1:ngen]
            elseif modelinfo.ctgs_link_constr_type == :frequency_penalty
                β = [-opfdata.generators[g].alpha*x.ωt[k,t] for g=1:ngen]
                @assert norm(x.Sk) <= algparams.zero
            else
                β = zeros(ngen)
                @assert norm(x.Sk) <= algparams.zero
            end
            @views x.Zk[:,k,t] .=   (((algparams.ρ_c/32.0)*primal.Zk[:,k,t]) .- dual.ctgs[:,k,t] .-
                                        (algparams.ρ_c*(x.Pg[:,1,t] .- x.Pg[:,k,t] .+ x.Sk[:,k,t] .- β))
                                    ) ./  max(algparams.zero, (algparams.ρ_c/32.0) + algparams.ρ_c + (modelinfo.obj_scale*algparams.θ_c))
        end
    end

    return nothing
end

function update_dual_vars(λ::AbstractDualSolution, opfdata::OPFData,
                          opfBlockData::AbstractBlocks, blk::Int,
                          primal::AbstractPrimalSolution,
                          modelinfo::ModelInfo,
                          algparams::AlgParams)
    block = opfBlockData.blkIndex[blk]
    k = block[1]
    t = block[2]

    maxviol_t, maxviol_c = 0.0, 0.0

    if t > 1 || (k > 1 && algparams.decompCtgs)
        d = Dict(:Pg => primal.Pg,
                 :ωt => primal.ωt,
                 :St => primal.St,
                 :Zt => primal.Zt,
                 :Sk => primal.Sk,
                 :Zk => primal.Zk)
    end

    if t > 1 && k == 1
        @assert modelinfo.time_link_constr_type == :penalty
        link_constr = compute_time_linking_constraints(d, opfdata, modelinfo, t)
        λ.ramping[:,t] += algparams.ρ_t*link_constr[:ramping][:]
        maxviol_t = maximum(abs.(link_constr[:ramping][:]))
    end
    if k > 1 && algparams.decompCtgs
        @assert modelinfo.ctgs_link_constr_type ∈ [:frequency_penalty, :preventive_penalty, :corrective_penalty]
        link_constr = compute_ctgs_linking_constraints(d, opfdata, modelinfo, k, t)
        λ.ctgs[:,k,t] += algparams.ρ_c*link_constr[:ctgs][:]
        maxviol_c = maximum(abs.(link_constr[:ctgs][:]))
    end

    return maxviol_t, maxviol_c
end

function ProxALProblem(
    opfdata::OPFData, rawdata::RawData,
    modelinfo::ModelInfo,
    algparams::AlgParams,
    backend::AbstractBackend,
    comm::Union{MPI.Comm,Nothing},
    opt_sol = Dict(),
    lyapunov_sol = Dict(),
    initial_primal = nothing,
    initial_dual = nothing
)
    if !isempty(opt_sol)
        (algparams.verbose > 0) &&
            @printf("Optimal objective value = %.2f\n", opt_sol["objective_value_nondecomposed"])
    end
    if !isempty(lyapunov_sol)
        (algparams.verbose > 0) &&
            @printf("Lyapunov lower bound = %.2f\n", lyapunov_sol["objective_value_lyapunov_bound"])
    end

    # initial values
    initial_solve = initial_primal === nothing
    x = (initial_primal === nothing) ?
            OPFPrimalSolution(opfdata, modelinfo) :
            deepcopy(initial_primal)
    λ = (initial_dual === nothing) ?
            OPFDualSolution(opfdata, modelinfo) :
            deepcopy(initial_dual)
    backend = if isa(backend, JuMPBackend)
        JuMPBlockBackend
    elseif isa(backend, ExaPFBackend)
        ExaBlockBackend
    elseif isa(backend, ExaTronBackend)
        TronBlockBackend
    end
    # NLP blocks
    blocks = OPFBlocks(
        opfdata, rawdata;
        modelinfo=modelinfo, algparams=algparams,
        backend=backend, comm
    )
    blkLinIndex = LinearIndices(blocks.blkIndex)
    for blk in blkLinIndex
        if ismywork(blk, comm)
            # model = blocks.blkModel[blk]
            # init!(model, algparams)
            blocks.colValue[:,blk] .= get_block_view(x, blocks.blkIndex[blk], modelinfo, algparams)
        end
    end

    par_order = []
    if algparams.jacobi
        par_order = blkLinIndex
    elseif algparams.decompCtgs
        par_order = @view blkLinIndex[2:end,:]
    end
    plt = nothing
    iter = 0
    objvalue = []
    lyapunov = []
    maxviol_t = []
    maxviol_c = []
    maxviol_d = []
    maxviol_t_actual = []
    maxviol_c_actual = []
    dist_x = []
    dist_λ = []
    nlp_opt_sol = Array{Float64, 2}(undef, blocks.colCount, blocks.blkCount)
    nlp_opt_sol .= blocks.colValue
    nlp_soltime = Vector{Float64}(undef, blocks.blkCount)
    wall_time_elapsed_actual = 0.0
    wall_time_elapsed_ideal = 0.0
    xprev = deepcopy(x)
    λprev = deepcopy(λ)

    return ProxALProblem(
        blocks,
        x,
        λ,
        xprev,
        λprev,
        objvalue,
        lyapunov,
        maxviol_t,
        maxviol_c,
        maxviol_d,
        maxviol_t_actual,
        maxviol_c_actual,
        dist_x,
        dist_λ,
        nlp_opt_sol,
        nlp_soltime,
        wall_time_elapsed_actual,
        wall_time_elapsed_ideal,
        iter,
        opt_sol,
        lyapunov_sol,
        initial_solve,
        par_order,
        plt
    )
end

function runinfo_update(
    runinfo::ProxALProblem, opfdata::OPFData,
    opfBlockData::AbstractBlocks,
    modelinfo::ModelInfo,
    algparams::AlgParams,
    comm::Union{MPI.Comm,Nothing}
)
    iter = runinfo.iter
    obj = 0.0
    for blk in runinfo.par_order
        if ismywork(blk, comm)
            obj += compute_objective_function(runinfo.x, opfdata, opfBlockData, blk, modelinfo, algparams)
        end
    end
    obj = comm_sum(obj, comm)
    push!(runinfo.objvalue, obj)

    iter = runinfo.iter
    lyapunov = 0.0
    for blk in runinfo.par_order
        if ismywork(blk, comm)
            lyapunov += compute_lyapunov_function(runinfo.x, runinfo.λ, opfdata, opfBlockData, blk, runinfo.xprev, modelinfo, algparams)
        end
    end
    lyapunov = comm_sum(lyapunov, comm)
    push!(runinfo.lyapunov, lyapunov)

    maxviol_t_actual = 0.0
    for blk in runinfo.par_order
        if ismywork(blk, comm)
            lmaxviol_t_actual = compute_true_ramp_error(runinfo.x, opfdata, opfBlockData, blk, modelinfo)
            maxviol_t_actual = max(maxviol_t_actual, lmaxviol_t_actual)
        end
    end
    maxviol_t_actual = comm_max(maxviol_t_actual, comm)
    push!(runinfo.maxviol_t_actual, maxviol_t_actual)

    maxviol_c_actual = 0.0
    for blk in runinfo.par_order
        if ismywork(blk, comm)
            lmaxviol_c_actual = compute_true_ctgs_error(runinfo.x, opfdata, opfBlockData, blk, modelinfo)
            maxviol_c_actual = max(maxviol_c_actual, lmaxviol_c_actual)
        end
    end
    maxviol_c_actual = comm_max(maxviol_c_actual, comm)
    push!(runinfo.maxviol_c_actual, maxviol_c_actual)

    # FIX ME: Frigging bug in the parallel implementation of the dual error
    # FIX ME: Re-implement parallel implementation of the dual error
    # (ngen, K, T) = size(runinfo.x.Pg)
    # smaxviol_d = 3*ngen*K + 2*ngen + K
    # @show smaxviol_d
    # maxviol_d = zeros(Float64, smaxviol_d)
    # for blk in runinfo.par_order
    #     if ismywork(blk, comm)
    #         maxviol_d .+= compute_dual_error(runinfo.x, runinfo.xprev, runinfo.λ, runinfo.λprev, opfdata, opfBlockData, blk, modelinfo, algparams)
    #         # compute_dual_error(runinfo.x, runinfo.xprev, runinfo.λ, runinfo.λprev, opfdata, opfBlockData, blk, modelinfo, algparams)
    #     end
    # end
    # maxviol_d = MPI.Allreduce(maxviol_d, MPI.SUM, comm)
    # maxviol_d = norm(maxviol_d, Inf)
    # push!(runinfo.maxviol_d, maxviol_d)
    maxviol_d = compute_dual_error(runinfo.x, runinfo.xprev, runinfo.λ, runinfo.λprev, opfdata, modelinfo, algparams)
    maxviol_d = comm_max(maxviol_d, comm)
    push!(runinfo.maxviol_d, maxviol_d)

    push!(runinfo.dist_x, NaN)
    push!(runinfo.dist_λ, NaN)
    #=
    optimgap = NaN
    lyapunov_gap = NaN
    if !isempty(runinfo.opt_sol)
        xstar = runinfo.opt_sol["primal"]
        zstar = runinfo.opt_sol["objective_value_nondecomposed"]
        runinfo.dist_x[iter] = dist(runinfo.x, xstar, modelinfo, algparams)
        optimgap = 100.0 * abs(runinfo.objvalue[iter] - zstar) / abs(zstar)
    end
    if !isempty(runinfo.lyapunov_sol)
        lyapunov_star = runinfo.lyapunov_sol["objective_value_lyapunov_bound"]
        lyapunov_gap = 100.0 * (runinfo.lyapunov[end] - lyapunov_star) / abs(lyapunov_star)
    end

    if algparams.verbose > 0 && comm_rank(comm) == 0
        @printf("iter %3d: ramp_err = %.3e, ctgs_err = %.3e, dual_err = %.3e, |x-x*| = %.3f, gap = %.2f%%, lyapgap = %.2f%%\n",
                    iter,
                    runinfo.maxviol_t[iter],
                    runinfo.maxviol_c[iter],
                    runinfo.maxviol_d[iter],
                    runinfo.dist_x[iter],
                    optimgap,
                    lyapunov_gap)
    end
    =#
    if algparams.verbose > 0 && comm_rank(comm) == 0
        if iter == 1
            @printf("--------------------------------------------------------------------------------------------------------------------\n");
            @printf("iter ramp_err   ramp_err   ctgs_err   ctgs_err   dual_error lyapunov_f    rho_t    rho_c  theta_t  theta_c      tau \n");
            @printf("     (penalty)  (actual)   (penalty)  (actual)\n");
            @printf("--------------------------------------------------------------------------------------------------------------------\n");
        end
        @printf("%4d ", iter-1);
        @printf("%10.4e ", runinfo.maxviol_t[iter])
        @printf("%10.4e ", runinfo.maxviol_t_actual[iter])
        @printf("%10.4e ", runinfo.maxviol_c[iter])
        @printf("%10.4e ", runinfo.maxviol_c_actual[iter])
        @printf("%10.4e ", runinfo.maxviol_d[iter])
        @printf("%10.4e ", runinfo.lyapunov[iter])
        @printf("%8.2e ", algparams.ρ_t)
        @printf("%8.2e ", algparams.ρ_c)
        @printf("%8.2e ", algparams.θ_t)
        @printf("%8.2e ", algparams.θ_c)
        @printf("%8.2e ", algparams.τ)
        @printf("\n")
    end
end

end # module


export plottrial, trialaxes

iv2t_s(iv) = (minimum(iv)/(1s), maximum(iv)/(1s))

"""
    plottrial(dfr::DataFrameRate, td::TrialData; axsniff, axtiming)
    plottrial(signal::AbstractVector, td::TrialData; fs, axsniff, axtiming)

Plot a trial in the specified axes. See [`trialaxes`](@ref) to create them.
"""
function plottrial(signal::AbstractVector, td::TrialData; fs, axsniff, axtiming, showlegend=true)
    axsniff.cla()
    axtiming.cla()
    sniff = signal[td.trialrange]
    t = (0:length(sniff)-1)/fs
    axsniff.plot(t * (1Hz), sniff, color="green")
    axsniff.set_xlabel("Time (s)")
    axsniff.set_ylabel("Chest expansion (V)")
    xl = axsniff.get_xlim()
    axtiming.plot(iv2t_s(td.soundinterval), (1, 1), color="blue")
    tcue = convert(Float64, td.cuetime / (1s))
    axtiming.plot(tcue, 1.5, "kv")
    axtiming.plot(iv2t_s(td.odorinterval), (2, 2), color="cyan")
    axtiming.text(iv2t_s(td.odorinterval)[end], 2, string(td.odordirection) * (is_lick(td) ? "+" : "-"))
    tlick = td.lickonsets / (1s)
    if !isempty(tlick)
        axtiming.plot([tlick'; tlick'], [fill(2.75, length(tlick))'; fill(3.25, length(tlick))'], color="red")
    end
    axtiming.set_xlim(xl)
    axtiming.set_ylim((0.5, 3.75))
    axtiming.set_xticks([])
    axtiming.set_yticks([])
    axsniff.set_frame_on(false)
    axtiming.set_frame_on(false)
    axtiming.invert_yaxis()
    if showlegend
        axtiming.legend(("sound", "cue", "odor", "licks"))
    end
    return nothing
end

plottrial(dfr::DataFrameRate, td::TrialData; kwargs...) = plottrial(dfr.sniff, td; fs=dfr.fs, kwargs...)

"""
    axsniff, axtiming = plottrial(dfr::DataFrameRate, td::TrialData, fig::PyPlot.Figure)

Plot a trial in the given `fig`ure.
"""
function plottrial(dfr::DataFrameRate, td::TrialData, fig::PyPlot.Figure)
    axsniff, axtiming = trialaxes(fig)
    plottrial(dfr, td; axsniff, axtiming)
    return axsniff, axtiming
end

"""
    axsniff, axtiming = trialaxes(fig)

Create axes for plotting trials.
"""
function trialaxes(fig::PyPlot.Figure)
    gs = PyPlot.plt.GridSpec(2, 1, fig, height_ratios=[1, 3])
    return fig.add_subplot(gs[2]), fig.add_subplot(gs[1])
end


""""

 NOTE: Here we don't implement the interface for cost transformation (e.g. ∂l/∂ξ).
 Instead, the problem write should provide the transfomed cost directly.

 Feedback linearizable systems shall implement this interface and join the trait.
"""

# Holy traits for linearization style dispatch
abstract type LinearizationStyle end
# systems without a special structure (e.g. use jacobian linearization)
struct JacobianLinearization <: LinearizationStyle end
# systems that are feedback linearizable (i.e. differentially flat systems)
struct FeedbackLinearization <: LinearizationStyle end
# systems that are trivially linearized (e.g. already linear)
struct TrivialLinearization <: LinearizationStyle end

LinearizationStyle(cs) = JacobianLinearization()

"--------------------- The Feedback Linearization Interface ---------------------"

"""
    $(FUNCTIONNAME)(cs::ControlSystem)

Returns the number of ξ states (linearized states).
"""
function n_linstates end

"""
$(FUNCTIONNAME)(cs::ControlSystem)

Returns the indices of the cartesian x and y coordinates in the linearized state
vector ξ.
"""
# TODO, technically this could be computed by propagating xyindex(cs) through
# ξ_from.
function ξxyindex end

"""
    $(FUNCTIONNAME)(cs::ControlSystem)

Returns a discretized LinearSystem that descibes the dynamics of the linearized
state coordinate.

NOTE: this must not be used with the non-linear state coordinates.
"""
#TODO: maybe wrap state type for safety.
function feedbacklin end

## State transformation λ

"""
    $(FUNCTIONNAME)(cs::ControlSystem, ξ)

The state conversion map `λ(ξ)`. Transforms linear states `ξ` to nonlinear states
`x`.
"""

function x_from end

"""
    $(FUNCTIONNAME)(cs::ControlSystem, x)

Inverse state conversion map `λ⁻¹(x)`. Transforms nonlinear states `x` to linear
states `ξ`.
"""
function ξ_from end

"""
    $(FUNCTIONNAME)(cs::ControlSystem, ξ)

Returns true if the state converstion map is singular at the given *linear* system
states `ξ`.
"""
function λ_issingular end

# Cost transformation

"""
    $(FUNCTIONNAME)(cs::ControlSystem, c::PlayerCost, np::Int)

Computes the transformed cost for the linear ξ coordinates.

NOTE: This may either be an exact transformation (by applying the chain-rule to the
x-domain cost) or an approximation based on a new cost directly formulated in ξ (as
suggested in https://arxiv.org/abs/1910.00681)
"""
function transformed_cost end

"-------------------------- Optional Interface Extension --------------------------"

## Affine input transformation: u = Minv(x) * (z - m(x))

"""
    $(FUNCTIONNAME)(cs::ControlSystem, x)

Returns the inverse decoupling matrix M⁻¹(x) for input transformation.
"""
function inverse_decoupling_matrix end

"""
    $(FUNCTIONNAME)(cs::ControlSystem, x)

Returns the drift term m(x) for input transformation.
"""
function decoupling_drift_term end