#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-10;
const long long MOD = 1e9 + 7;
const long long OO = 1e18 + 9;
const int N = 1e3 + 3;
int points[N][5];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < 5; ++j) cin >> points[i][j];
  if (n > 20) {
    cout << 0;
    return 0;
  }
  vector<int> ans;
  for (int i = 0; i < n; ++i) {
    bool good = 1;
    for (int j = 0; j < n; ++j) {
      if (j == i) continue;
      for (int k = 0; k < n; ++k) {
        if (k == j || k == i) continue;
        long long sum = 0;
        for (int e = 0; e < 5; ++e)
          sum += (points[j][e] - points[i][e]) * (points[k][e] - points[i][e]);
        if (sum > 0) {
          good = 0;
          break;
        }
      }
    }
    if (good) ans.push_back(i + 1);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) cout << ans[i] << endl;
}
