#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int SIZE = 1e6 + 10;
int p[SIZE][5];
int main() {
  int(n);
  scanf("%d", &n);
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = 0; j < (5); ++j) scanf("%d", &(p[i][j]));
  }
  vector<int> an;
  for (int i = (1); i < (n + 1); ++i) {
    bool fail = 0;
    for (int j = (1); j < (n + 1); ++j) {
      if (j == i) continue;
      int d1[5];
      for (int r = 0; r < (5); ++r) d1[r] = p[j][r] - p[i][r];
      for (int k = (1); k < (j); ++k) {
        int d2[5] = {};
        int v = 0;
        for (int r = 0; r < (5); ++r) v += (p[k][r] - p[i][r]) * d1[r];
        if (v > 0) {
          fail = 1;
          break;
        }
      }
      if (fail) break;
    }
    if (!fail) an.push_back(i);
  }
  printf("%d\n", ((int)(an).size()));
  for (int i = 0; i < (((int)(an).size())); ++i)
    printf("%d%c", an[i], " \n"[i == ((int)(an).size()) - 1]);
  return 0;
}
