#include <bits/stdc++.h>
using namespace std;
struct point {
  int x[5];
};
int N;
point P[1005];
vector<int> ans;
int dot(point a, point b) {
  int ret = 0;
  for (int i = 0; i < 5; i++) ret += a.x[i] * b.x[i];
  return ret;
}
point subtract(point a, point b) {
  point c;
  for (int i = 0; i < 5; i++) c.x[i] = a.x[i] - b.x[i];
  return c;
}
bool check(int cur) {
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++)
      if (i != cur && j != cur && i != j) {
        point a = subtract(P[i], P[cur]), b = subtract(P[j], P[cur]);
        if (dot(a, b) > 0) return false;
      }
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> N;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < 5; j++) cin >> P[i].x[j];
  for (int i = 0; i < N; i++)
    if (check(i)) ans.push_back(i);
  cout << ans.size() << "\n";
  if (!ans.empty()) {
    for (int i = 0; i < ans.size(); i++) cout << ans[i] + 1 << " ";
    cout << "\n";
  }
  return 0;
}
