#include <bits/stdc++.h>
using namespace std;
int a[1000][5];
bool bad[1000];
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]);
    }
  }
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (j == i) continue;
      bool f = true;
      for (int k = j + 1; k < n; ++k) {
        if (k == i) continue;
        int w = 0;
        for (int z = 0; z < 5; ++z) {
          w += (a[j][z] - a[i][z]) * (a[k][z] - a[i][z]);
        }
        if (w > 0) {
          ++cnt;
          bad[i] = true;
          f = false;
          break;
        }
      }
      if (!f) break;
    }
  }
  printf("%d\n", n - cnt);
  for (int i = 0; i < n; ++i) {
    if (!bad[i]) printf("%d\n", i + 1);
  }
}
