#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#pragma GCC diagnostic ignored "-Wmissing-declarations"
int main() {
  ios_base::sync_with_stdio(false);
  int const d = 5;
  int n;
  cin >> n;
  vector<array<int, d> > a(n);
  for (auto& arr : a)
    for (int& x : arr) cin >> x;
  vector<int> ans;
  for (int i = 0; i < n; ++i) {
    bool good = true;
    for (int j = 0; good && j < n; ++j)
      for (int k = j + 1; good && k < n; ++k) {
        int res = 0;
        for (int t = 0; t < d; ++t)
          res += (a[k][t] - a[i][t]) * (a[j][t] - a[i][t]);
        if (res > 0) good = false;
      }
    if (good) ans.push_back(i + 1);
  }
  cout << ans.size() << endl;
  for (int x : ans) cout << x << '\n';
}
