#include <bits/stdc++.h>
using namespace std;
const int MAX = 1005;
int p[MAX][5];
inline int check(int a, int b, int c) {
  int sum = 0;
  for (int i = 0; i < 5; i++) sum += (p[a][i] - p[b][i]) * (p[a][i] - p[c][i]);
  return sum > 0;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 5; j++) scanf("%d", &p[i][j]);
  vector<int> T;
  int per[n];
  for (int i = 0; i < n; i++) per[i] = i;
  random_shuffle(per, per + n);
  for (int i = 0; i < n; i++) {
    int da = 0;
    for (int j = 0; j < n; j++) {
      for (int k = (j + 1); k < (n); k++) {
        if (j != i && k != i && check(per[i], per[j], per[k])) {
          da = 1;
          break;
        }
      }
      if (da) break;
    }
    if (!da) T.push_back(per[i]);
  }
  sort(T.begin(), T.end());
  printf("%d\n", (int)T.size());
  for (auto it : T) printf("%d ", it + 1);
  printf("\n");
  return 0;
}
