#include <bits/stdc++.h>
using namespace std;
const int maxs = 1e5 + 7;
int k[maxs][23], good[maxs];
int h, ans, sum;
int i, u, t, j;
int main() {
  scanf("%d", &h);
  for (i = 1; i <= h; i++) {
    for (u = 1; u <= 5; u++) {
      scanf("%d", &k[i][u]);
    }
  }
  for (i = 1; i <= h; i++) {
    for (u = 1; u <= h; u++) {
      if (i != u) {
        for (t = u + 1; t <= h; t++) {
          if (i != t) {
            sum = 0;
            for (j = 1; j <= 5; j++) {
              sum = sum + (k[u][j] - k[i][j]) * (k[t][j] - k[i][j]);
            }
            if (sum > 0) {
              goto nxt;
            }
          }
        }
      }
    }
    good[++ans] = i;
  nxt:;
  }
  printf("%d\n", ans);
  for (t = 1; t <= ans; t++) {
    printf("%d\n", good[t]);
  }
  return 0;
}
