#include <bits/stdc++.h>
using namespace std;
int N, A[1005][10], X[10], Y[10];
int main() {
  cin >> N;
  for (int i = (1); i <= (N); i++)
    for (int j = (1); j <= (5); j++) cin >> A[i][j];
  vector<int> ans;
  for (int i = (1); i <= (N); i++) {
    bool good = true;
    for (int j = (1); j <= (N); j++)
      for (int k = (1); k <= (N); k++)
        if (i != j && i != k && j != k) {
          for (int z = (1); z <= (5); z++) X[z] = A[j][z] - A[i][z];
          for (int z = (1); z <= (5); z++) Y[z] = A[k][z] - A[i][z];
          int val = 0;
          for (int z = (1); z <= (5); z++) val += X[z] * Y[z];
          if (val > 0) good = false;
          if (!good) j = N + 1, k = N + 1;
        }
    if (good) ans.push_back(i);
  }
  cout << ans.size() << "\n";
  for (int x : ans) cout << x << "\n";
}
