#include <bits/stdc++.h>
using namespace std;
struct point5d {
  int c[5];
  friend istream& operator>>(istream& in, point5d& p) {
    for (int i = 0; i < 5; i++) in >> p.c[i];
    return in;
  }
  int inner(const point5d& p1, const point5d& p2) {
    int res = 0;
    for (int i = 0; i < 5; i++) res += (p1.c[i] - c[i]) * (p2.c[i] - c[i]);
    return res;
  }
};
bool isgoodpoint(int i, vector<point5d>& vp, int n) {
  for (int j = 0; j < n; j++) {
    for (int k = j + 1; k < n; k++) {
      if (i != j && i != k && vp[i].inner(vp[j], vp[k]) > 0) return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  vector<point5d> vp(n);
  for (int i = 0; i < n; i++) cin >> vp[i];
  vector<bool> isgood(n);
  int count = 0;
  for (int i = 0; i < n; i++) {
    isgood[i] = isgoodpoint(i, vp, n);
    if (isgood[i]) count++;
  }
  cout << count << '\n';
  for (int i = 0; i < n; i++)
    if (isgood[i]) cout << (i + 1) << '\n';
}
