#include <bits/stdc++.h>
using namespace std;
int a[1050][6], n, x[6], y[6];
bool ok[1050];
int main() {
  scanf("%d", &n);
  if (n >= 100) {
    printf("%d\n", 0);
    return 0;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 5; j++) scanf("%d", &a[i][j]);
  for (int i = 0; i < n; i++) {
    bool good = true;
    for (int j = 0; j < n - 1; j++) {
      if (i == j) continue;
      for (int k = j + 1; k < n; k++) {
        if (k == i) continue;
        int res = 0;
        for (int l = 0; l < 5; l++) {
          res += (a[j][l] - a[i][l]) * (a[k][l] - a[i][l]);
        }
        good &= (res <= 0);
      }
    }
    if (good) ok[i] = true;
  }
  int res = 0;
  for (int i = 0; i < n; i++)
    if (ok[i]) res++;
  printf("%d\n", res);
  for (int i = 0; i < n; i++)
    if (ok[i]) printf("%d\n", i + 1);
  return 0;
}
