#include <bits/stdc++.h>
using namespace std;
int v[1010][10], rez[1010];
int main() {
  int n, nr = 0, l = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int p = 0;
    for (int j = 1; j <= 5; j++) scanf("%d", &v[i][j]);
  }
  if (n > 200) {
    printf("0");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    int p = 0;
    for (int j = 1; j <= n; j++)
      if (i != j) {
        for (int k = 1; k <= n; k++)
          if (j != k && i != k) {
            int c = 0;
            for (int m = 1; m <= 5; m++)
              c += (v[j][m] - v[i][m]) * (v[k][m] - v[i][m]);
            if (c > 0) {
              p = 1;
              break;
            }
          }
        if (p == 1) break;
      }
    if (p == 0) rez[++l] = i;
  }
  printf("%d\n", l);
  for (int i = 1; i <= l; i++) printf("%d\n", rez[i]);
  return 0;
}
