#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> res;
  int arr[n][5];
  for (int i = 0; i < n; i++) {
    cin >> arr[i][0] >> arr[i][1] >> arr[i][2] >> arr[i][3] >> arr[i][4];
  }
  vector<int> sol;
  if (n < 12) {
    for (int i = 0; i < n; i++) {
      vector<vector<int> > lines;
      for (int j = 0; j < n; j++) {
        vector<int> tmp(5);
        for (int k = 0; k < 5; k++) {
          tmp[k] = (arr[j][k] - arr[i][k]);
        }
        lines.push_back(tmp);
      }
      int flag = 0;
      for (int j = 0; j < lines.size(); j++) {
        for (int k = j + 1; k < lines.size(); k++) {
          float a = lines[j][0] * lines[k][0] + lines[j][1] * lines[k][1] +
                    lines[j][2] * lines[k][2] + lines[j][3] * lines[k][3] +
                    lines[j][4] * lines[k][4];
          float b = lines[j][0] * lines[j][0] + lines[j][1] * lines[j][1] +
                    lines[j][2] * lines[j][2] + lines[j][3] * lines[j][3] +
                    lines[j][4] * lines[j][4];
          float c = lines[j][0] * lines[k][0] + lines[k][1] * lines[k][1] +
                    lines[k][2] * lines[k][2] + lines[k][3] * lines[k][3] +
                    lines[k][4] * lines[k][4];
          float ans = acos(a / (sqrt(b) * sqrt(c)));
          if ((abs(ans)) < (3.14159265 / 2)) {
            flag = 1;
            break;
          }
        }
        if (flag == 1) break;
      }
      if (flag != 1) {
        sol.push_back(i);
      }
    }
    cout << sol.size() << "\n";
    if (sol.size() != 0) {
      for (int i = 0; i < sol.size(); i++) cout << sol[i] + 1 << " ";
      cout << endl;
    }
  } else {
    cout << "0\n";
  }
}
