#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  std::ios::sync_with_stdio(false);
  long long n, k = 0;
  cin >> n;
  vector<vector<int> > a(n, vector<int>(5, 0));
  for (int i = (int)(0); i < ((int)n); i++) {
    cin >> a[i][0] >> a[i][1] >> a[i][2] >> a[i][3] >> a[i][4];
  }
  vector<int> good(n, 1);
  for (int i = (int)(0); i < ((int)n); i++) {
    bool notGood = 0;
    for (int j = (int)(0); j < ((int)n); j++) {
      if (i == j) continue;
      for (int k = (int)(j + 1); k < ((int)n); k++) {
        if (k == i) continue;
        long long sign = 0;
        for (int p = (int)(0); p < ((int)5); p++)
          sign += (a[j][p] - a[i][p]) * (a[k][p] - a[i][p]);
        if (sign > 0) {
          good[i] = 0;
          notGood = 1;
          break;
        }
        if (notGood) break;
      }
      if (notGood) break;
    }
  }
  for (int i = (int)(0); i < ((int)n); i++) {
    k += good[i];
  }
  cout << k << endl;
  for (int i = (int)(0); i < ((int)n); i++) {
    if (good[i]) cout << i + 1 << endl;
  }
  return 0;
}
