#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a[1024];
bool asd(int i, int j, int k) {
  int r = 0;
  for (int _ = 0, ThxDem = 5; _ < ThxDem; ++_)
    r += (a[j][_] - a[i][_]) * (a[k][_] - a[i][_]);
  return r > 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    for (int _ = 0, ThxDem = 5; _ < ThxDem; ++_) {
      int k;
      scanf("%d", &k);
      a[i].push_back(k);
    }
  }
  vector<int> r;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    bool g = true;
    for (int j = 0, ThxDem = n; j < ThxDem; ++j) {
      if (j == i) continue;
      for (int k = j + 1, ThxDem = n; k < ThxDem; ++k) {
        if (k == i) continue;
        if (asd(i, j, k)) {
          g = false;
          break;
        }
      }
      if (!g) break;
    }
    if (g) r.push_back(i);
  }
  printf("%d\n", ((int)r.size()));
  for (int x : r) printf("%d\n", x + 1);
  return 0;
}
