#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
inline int two(int n) { return 1 << n; }
long long extgcd(long long a, long long b, long long& x, long long& y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    int g = extgcd(b, a % b, y, x);
    y -= a / b * x;
    return g;
  }
}
long long modpow(long long a, long long b, long long md) {
  long long res = 1;
  a %= md;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % md;
    a = a * a % md;
  }
  return res;
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
const int sz = 1e3 + 5;
int a[sz][5];
vector<vector<int>> pts[sz];
inline bool foo(vector<int> p, vector<int> q) {
  int s = 0;
  for (int i = 0; i < 5; i++) s += p[i] * q[i];
  return s <= 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ifstream in("input.txt");
  ofstream out("output.txt");
  int n;
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> a[i][0] >> a[i][1] >> a[i][2] >> a[i][3] >> a[i][4];
  vector<int> good;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j == i) continue;
      vector<int> tmp(5);
      for (int k = 0; k < 5; k++) tmp[k] = a[j][k] - a[i][k];
      pts[i].push_back(tmp);
    }
  }
  for (int i = 0; i < n; i++) {
    bool is = true;
    for (int j = 0; j < n - 1; j++) {
      for (int k = j + 1; k < n - 1; k++) {
        if (!foo(pts[i][j], pts[i][k])) {
          is = 0;
          break;
        }
      }
      if (!is) break;
    }
    if (is) good.push_back(i);
  }
  cout << good.size() << endl;
  for (int k : good) cout << k + 1 << " ";
  return 0;
}
