public static List<Integer[]> pyths (int n) {
  List<Integer[]> list = new ArrayList<Integer[]>();
  for (int x = 1; x <= n; x++) for (int y = 1; y <= n; y++) for (int z = 1; z <= n; z++) if (x * x + y * y == z * z) list.add({x, y, z});
  return list;
}