#include <bits/stdc++.h>
using namespace std;
int n;
int pts[1005][5];
bool bad(int i) {
  int x[5];
  for (int j = 0; j < n; ++j) {
    if (j == i) continue;
    for (int t = 0; t < 5; ++t) {
      x[t] = pts[i][t] - pts[j][t];
    }
    for (int k = j + 1; k < n; ++k) {
      if (k == i) continue;
      int res = 0;
      for (int t = 0; t < 5; ++t) {
        res += (x[t]) * (pts[i][t] - pts[k][t]);
      }
      if (res > 0) return true;
    }
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> pts[i][0] >> pts[i][1] >> pts[i][2] >> pts[i][3] >> pts[i][4];
  }
  int cnt = 0;
  vector<int> res;
  res.reserve(1005);
  for (int i = 0; i < n; ++i) {
    if (bad(i)) continue;
    ++cnt;
    res.push_back(i + 1);
  }
  cout << cnt << endl;
  for (int i = 0; i < cnt; ++i) {
    cout << res[i] << endl;
  }
  return 0;
}
