#include <bits/stdc++.h>
using namespace std;
int n, p[1001][5];
bool check(int i, int j, int k) {
  long long tmp = 0;
  for (int l = 0; l < 5; l++) tmp += (p[j][l] - p[i][l]) * (p[k][l] - p[i][l]);
  return (tmp > 0);
}
void code() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 5; j++) cin >> p[i][j];
  }
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    bool flag = 1;
    for (int j = 0; j < n; j++) {
      if (j == i) continue;
      for (int k = j + 1; k < n; k++) {
        if (k == i) continue;
        if (check(i, j, k)) {
          flag = 0;
          break;
        }
      }
      if (flag == 0) break;
    }
    if (flag) ans.push_back(i);
  }
  cout << ans.size() << '\n';
  for (int i : ans) cout << i + 1 << " ";
}
int main() {
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    code();
  }
}
