#include <bits/stdc++.h>
using namespace std;
int in[1050][5];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, i, j, k, l;
  cin >> n;
  for (int i = (1); i <= (n); ++i)
    for (int j = 0; j < (5); ++j) cin >> in[i][j];
  if (n >= 20) {
    cout << "0";
    return 0;
  }
  vector<int> v;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      for (k = j + 1; k <= n; k++) {
        if (i == j || i == k) continue;
        long long s = 0;
        for (int l = 0; l < (5); ++l)
          s += (in[j][l] - in[i][l]) * (in[k][l] - in[i][l]);
        if (s > 0) break;
      }
      if (k <= n) break;
    }
    if (j > n) v.push_back(i);
  }
  cout << v.size() << endl;
  for (int i = 0; i < (v.size()); ++i) cout << v[i] << endl;
  return 0;
}
