#include <bits/stdc++.h>
using namespace std;
int n;
long long num[100001][5];
int total = 0;
bool ret[100001];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= 5; j++) scanf("%I64d", &num[i][j]);
  }
  if (n > 33)
    printf("0\n");
  else {
    for (int i = 1; i <= n; i++) {
      ret[i] = true;
      for (int j = 1; j <= n; j++) {
        for (int k = 1; k <= n; k++) {
          if (j != k && j != i && k != i) {
            long long mul = 0;
            for (int d = 1; d <= 5; d++)
              mul += (num[j][d] - num[i][d]) * (num[k][d] - num[i][d]);
            if (mul > 0) ret[i] = false;
          }
        }
      }
    }
    for (int i = 1; i <= n; i++) total += (int)ret[i];
    printf("%d\n", total);
    for (int i = 1; i <= n; i++) {
      if (ret[i]) printf("%d\n", i);
    }
  }
  return 0;
}
