#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long m) {
  long long x = 1 % m;
  a %= m;
  while (b) {
    if ((1 & b)) x = x * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return x;
}
int a[1005][5];
int bad[1005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 5; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  memset(bad, 0, sizeof(bad));
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (bad[i]) continue;
    if (cnt == n) break;
    for (int j = 0; j < n; j++) {
      if (bad[i]) break;
      if (cnt == n) break;
      for (int k = 0; k < n; k++) {
        if (j == i || j == k || k == i) continue;
        int dot = 0;
        for (int p = 0; p < 5; p++) {
          dot += (a[j][p] - a[i][p]) * (a[k][p] - a[i][p]);
        }
        if (cnt == n) break;
        if (dot > 0) {
          if (!bad[i]) ++cnt;
          bad[i] = 1;
          break;
        } else {
          if (!bad[j]) ++cnt;
          bad[j] = 1;
          if (!bad[k]) ++cnt;
          bad[k] = 1;
          if (cnt == n) break;
          continue;
        }
      }
    }
  }
  int k = 0;
  for (int i = 0; i < n; i++)
    if (!bad[i]) ++k;
  printf("%d\n", k);
  for (int i = 0; i < n; i++)
    if (!bad[i]) printf("%d\n", (i + 1));
}
