#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 9;
const long long int MOD = 1e9 + 696969;
const long long INF = 1e18 + 3;
int tab[1010][5];
long long int x[5], y[5];
bool spoko[1010];
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = (1); i <= (n); ++i) {
    for (int dim = (0); dim <= (4); ++dim) cin >> tab[i][dim];
  }
  for (int i = (1); i <= (n); ++i) spoko[i] = 1;
  for (int i = 1; i <= n; ++i) {
    if (!spoko[i]) continue;
    for (int j = 1; j <= n; ++j) {
      if (!spoko[i]) break;
      for (int k = 1; k <= n; ++k) {
        if (i == j || i == k || k == j) continue;
        for (int h = (0); h <= (4); ++h) x[h] = tab[i][h] - tab[j][h];
        long long int res = 0;
        for (int h = (0); h <= (4); ++h) {
          y[h] = tab[k][h] - tab[i][h];
          res += x[h] * y[h];
        }
        if (res < 0) {
          spoko[i] = 0;
          break;
        }
      }
    }
  }
  int wskaz = 0;
  for (int i = (1); i <= (n); ++i)
    if (spoko[i]) ++wskaz;
  cout << wskaz << endl;
  for (int i = (1); i <= (n); ++i)
    if (spoko[i]) cout << i << ' ';
}
