#include <bits/stdc++.h>
using namespace std;
int point[1010][10], n, cnt = 0, ans[20], dis[20][10], flag;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= 5; j++) scanf("%d", &point[i][j]);
  if (n > 11) {
    printf("0\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    memset(dis, 0, sizeof dis);
    flag = 1;
    for (int j = 1; j <= n; j++) {
      if (j == i) continue;
      for (int k = 1; k <= 5; k++) dis[j][k] = point[j][k] - point[i][k];
      for (int k = 1; k < j; k++) {
        if (k == i) continue;
        int sum = 0;
        for (int l = 1; l <= 5; l++) sum += dis[k][l] * dis[j][l];
        if (sum <= 0)
          continue;
        else {
          flag = 0;
          break;
        }
      }
      if (!flag) break;
    }
    if (flag) ans[++cnt] = i;
  }
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++) printf("%d\n", ans[i]);
  return 0;
}
