#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f2f1f0f;
const long long LINF = 1ll * INF * INF;
const int MAX_N = 1e3 + 10;
int N, Nr[MAX_N][5];
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++)
    for (int j = 0; j < 5; j++) scanf("%d", &Nr[i][j]);
  if (N >= 100) {
    puts("0");
    return 0;
  }
  vector<int> Ans;
  for (int i = 1; i <= N; i++) {
    bool isCan = true;
    for (int j = 1; j <= N; j++)
      if (j != i)
        for (int k = j + 1; k <= N; k++)
          if (k != i) {
            int sum = 0;
            for (int b = 0; b < 5; b++)
              sum += (Nr[j][b] - Nr[i][b]) * (Nr[k][b] - Nr[i][b]);
            if (sum > 0) {
              isCan = false;
              goto finish;
            }
          }
  finish:
    if (isCan) Ans.push_back(i);
  }
  printf("%d\n", ((int)(Ans).size()));
  for (int x : Ans) printf("%d\n", x);
  return 0;
}
