#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
int n;
long long val[1100][10];
bool accute(long long o, long long a, long long b) {
  long long ip = 0;
  for (int i = 0; i < 5; i++) {
    ip += (val[a][i] - val[o][i]) * (val[b][i] - val[o][i]);
  }
  return ip > 0;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 5; j++) {
      cin >> val[i][j];
    }
  }
  if (n > 100) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    bool ok = true;
    for (int j = 0; j < n; j++) {
      for (int k = j + 1; k < n; k++) {
        if (j == i || k == i) continue;
        if (accute(i, j, k)) ok = false;
      }
    }
    if (ok) ans.push_back(i + 1);
  }
  cout << ans.size() << endl;
  ;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
