#include <bits/stdc++.h>
using namespace std;
int a[1005][6], i, j, k, l, s, n, m, ans, da[1005];
inline bool check(int x, int y, int z) {
  int s = 0;
  for (int i = 1; i <= 5; i++) s += (a[x][i] - a[y][i]) * (a[x][i] - a[z][i]);
  return s > 0;
}
int main() {
  scanf("%d", &n);
  if (n >= 200) return puts("0"), 0;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= 5; j++) scanf("%d", &a[i][j]);
  for (i = 1; i <= n; i++) {
    int bb = 0;
    for (j = 1; j <= n; j++)
      if (i != j) {
        for (k = 1; k <= n; k++)
          if (j != k && i != k)
            if (check(i, j, k)) bb = 1;
      }
    if (!bb) da[++ans] = i;
  }
  printf("%d\n", ans);
  for (i = 1; i <= ans; i++) printf("%d ", da[i]);
}
