#include <bits/stdc++.h>
using namespace std;
struct point {
  int p[5];
  int &operator[](int i) { return p[i]; }
};
point operator-(point &l, point &r) {
  point ans;
  for (int i = 0; i < 5; i++) ans[i] = r[i] - l[i];
  return ans;
}
point p[1010];
double dot(point &l, point &r) {
  double ans = 0;
  for (int i = 0; i < 5; i++) ans += 1.0 * l[i] * r[i];
  return ans;
}
double length(point &i) { return sqrt(dot(i, i)); }
double ang(point &l, point &r) {
  return acos(dot(l, r) / (length(l) * length(r)));
}
double max_theta = acos(-1.0) / 2.0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 5; j++) cin >> p[i][j];
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    bool good = true;
    for (int j = 0; j < n && good; j++) {
      if (i == j) continue;
      for (int k = 0; k < n && good; k++) {
        if (i == k || j == k) continue;
        point ij = p[j] - p[i];
        point ik = p[k] - p[i];
        double theta = ang(ij, ik);
        good &= theta >= max_theta;
      }
    }
    if (good) ans.push_back(i + 1);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
