#include <bits/stdc++.h>
using namespace std;
int A[1005][5];
bool good[1005];
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, i, j, k, l, tmp, res;
  cin >> n;
  for (i = 1; i <= n; i++)
    for (j = 0; j < 5; j++) cin >> A[i][j];
  if (n > 11) {
    cout << 0 << '\n';
    return 0;
  }
  for (i = 1, res = 0; i <= n; i++) {
    good[i] = true;
    for (j = 1; j <= n; j++)
      for (k = 1; k <= n; k++)
        if (j != i && k != i && j != k) {
          for (l = tmp = 0; l < 5; l++)
            tmp += (A[j][l] - A[i][l]) * (A[k][l] - A[i][l]);
          if (tmp > 0) {
            good[i] = false;
            j = n + 1;
            break;
          }
        }
    if (good[i]) res++;
  }
  cout << res << '\n';
  for (i = 1; i <= n; i++)
    if (good[i]) cout << i << '\n';
  return 0;
}
