#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  using Point = array<int, 5>;
  vector<Point> points(n);
  for (Point& p : points)
    for (int i = 0; i < 5; i++) cin >> p[i];
  vector<int> good_indices;
  for (int i = 0; i < n; i++) {
    Point p = points[i];
    vector<Point> translates;
    for (int j = 0; j < n; j++)
      if (j != i) {
        Point q = points[j];
        for (int k = 0; k < 5; k++) q[k] -= p[k];
        translates.push_back(q);
      }
    bool bad = false;
    for (int j = 0; j < n - 1; j++) {
      if (bad) break;
      for (int k = j + 1; k < n - 1; k++)
        if (translates[j][0] * translates[k][0] +
                translates[j][1] * translates[k][1] +
                translates[j][2] * translates[k][2] +
                translates[j][3] * translates[k][3] +
                translates[j][4] * translates[k][4] >
            0) {
          bad = true;
          break;
        }
    }
    if (!bad) good_indices.push_back(i);
  }
  cout << good_indices.size() << endl;
  for (const int i : good_indices) cout << i + 1 << "\n";
}
