#include <bits/stdc++.h>
using namespace std;
int a[1005][5], ans[1005], n, i, j, k, l, h, c = 0;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 5; j++) scanf("%d", &a[i][j]);
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++)
      if (j != i)
        for (k = j + 1; k < n; k++)
          if (k != i) {
            h = 0;
            for (l = 0; l < 5; l++)
              h += (a[j][l] - a[i][l]) * (a[k][l] - a[i][l]);
            if (h > 0) goto SKIP;
          }
    ans[c++] = i + 1;
  SKIP:;
  }
  printf("%d\n", c);
  for (int i = 0; i < c; i++) printf("%d\n", ans[i]);
  return 0;
}
