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