static A pairGet(Pair p, int idx) { if (i == 0) ret p.a; if (i == 1) ret p.b; fail("Index out of range for pair", i); }