#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int n;
int a[1111][5];
int coss(int i, int j, int k) {
  int ans = 0;
  for (int it = 0; it < 5; it++) {
    ans += (a[i][it] - a[j][it]) * (a[i][it] - a[k][it]);
  }
  return ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 5; j++) {
      cin >> a[i][j];
    }
  }
  int count = 0;
  for (int i = 0; i < n; i++) {
    bool ok = true;
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      for (int k = j + 1; k < n; k++) {
        if (k == i) continue;
        if (coss(i, j, k) > 0) ok = false;
      }
      if (!ok) break;
    }
    if (ok) {
      v.push_back(i + 1);
    }
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
}
