#include <bits/stdc++.h>
using namespace std;
bool is_accute(vector<int> a, vector<int> b, vector<int> c) {
  for (int i = 0; i < 5; ++i) b[i] -= a[i], c[i] -= a[i];
  int ans = 0;
  for (int i = 0; i < 5; ++i) ans += b[i] * c[i];
  return ans > 0;
}
bool is_good[2000] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  if (n > 100) cout << 0 << '\n', exit(0);
  vector<vector<int>> A(n, vector<int>(5));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 5; ++j) cin >> A[i][j];
  }
  int ans = n;
  for (int i = 0; i < n; ++i) {
    bool found = false;
    for (int j = 0; j < n and not found; ++j) {
      for (int k = 0; k < n and not found; ++k) {
        if (i == j or j == k or k == i) continue;
        found |= is_accute(A[i], A[j], A[k]);
      }
    }
    is_good[i] = found;
    ans -= found;
  }
  cout << ans << '\n';
  for (int i = 0; i < n; ++i)
    if (is_good[i] == 0) cout << i + 1 << '\n';
}
