#include <bits/stdc++.h>
using namespace std;
const string __sep = "\n";
const int INF = 1000000001;
const int MOD = 998244353;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  t = 1;
  while (t-- > 0) {
    int n;
    cin >> n;
    vector<vector<int>> x(n);
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < 5; ++j) {
        int a;
        cin >> a;
        x[i].push_back(a);
      }
    }
    vector<int> good_;
    for (int i = 0; i < n; ++i) {
      bool good = true;
      for (int j = 0; j < n; ++j) {
        if (j == i) continue;
        for (int l = j + 1; l < n; ++l) {
          if (l == i) continue;
          int sum = 0;
          for (int k = 0; k < 5; ++k) {
            sum += (x[j][k] - x[i][k]) * (x[l][k] - x[i][k]);
          }
          if (sum > 0) {
            good = false;
            break;
          }
        }
        if (!good) break;
      }
      if (good) {
        good_.push_back(i);
      }
    }
    cout << good_.size() << endl;
    for (int s : good_) {
      cout << (1 + s) << "\n";
    }
  }
  return 0;
}
