#include <bits/stdc++.h>
using namespace std;
int n, a[1001][10], cnt, ans[1001];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d%d%d", &a[i][0], &a[i][1], &a[i][2], &a[i][3], &a[i][4]);
  }
  if (n > 11) {
    printf("0");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    bool flg = 0;
    for (int j = 1; j <= n; j++)
      if (i != j)
        for (int k = j + 1; k <= n; k++)
          if (k != i) {
            int mx = 0;
            double mmx = 0, mmy = 0;
            for (int p = 0; p < 5; p++) {
              mx += (a[i][p] - a[j][p]) * (a[i][p] - a[k][p]);
              mmx += (a[i][p] - a[j][p]) * (a[i][p] - a[j][p]);
              mmy += (a[i][p] - a[k][p]) * (a[i][p] - a[k][p]);
            }
            mmx = sqrt(mmx);
            mmy = sqrt(mmy);
            if (acos((double)mx / (mmx * mmy)) * 2 <= acos(-1) - 1e-8) flg = 1;
          }
    if (!flg) ans[++cnt] = i;
  }
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++) printf("%d\n", ans[i]);
}
