#include <bits/stdc++.h>
using namespace std;
int p[1010][10], a[110], P[110][110];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= 5; j++) {
      scanf("%d", &p[i][j]);
    }
  }
  if (n > 11) {
    printf("0\n");
  } else {
    int xx = 0;
    for (int i = 1; i <= n; i++) {
      memset(P, 0, sizeof(P));
      int flag = 1;
      for (int j = 1; j <= n; j++) {
        if (i != j) {
          for (int k = 1; k <= 5; k++) {
            P[j][k] = p[j][k] - p[i][k];
          }
          for (int k = 1; k < j; k++) {
            if (k != i) {
              int qq = 0;
              for (int q = 1; q <= 5; q++) qq += P[k][q] * P[j][q];
              if (qq <= 0)
                continue;
              else {
                flag = 0;
                break;
              }
            }
          }
          if (!flag) break;
        }
      }
      if (flag) a[xx++] = i;
    }
    printf("%d\n", xx);
    for (int i = 0; i < xx; i++) printf("%d\n", a[i]);
  }
  return 0;
}
