#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > pt;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  if (n > 300) {
    cout << 0 << endl;
    return 0;
  }
  pt.resize(n, vector<int>(5));
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (5); ++j) cin >> pt[i][j];
  }
  vector<int> gd;
  bool isg;
  int tpr;
  for (int i = 0; i < (n); ++i) {
    isg = 1;
    for (int j = 0; j < (n); ++j) {
      if (i == j) continue;
      for (int k = 0; k < (j); ++k) {
        if (i == k) continue;
        tpr = 0;
        for (int z = 0; z < (5); ++z) {
          tpr += (pt[j][z] - pt[i][z]) * (pt[k][z] - pt[i][z]);
        }
        if (tpr > 0) {
          isg = 0;
          break;
        }
      }
      if (!isg) break;
    }
    if (isg) gd.push_back(i + 1);
  }
  cout << (int((gd).size())) << endl;
  for (int i = 0; i < ((int((gd).size()))); ++i) cout << gd[i] << " ";
  cout << endl;
  return 0;
}
