#include <bits/stdc++.h>
using namespace std;
int x[1000][1000];
int y[12];
int g(int a) {
  int b = 0;
  for (int i = 1; i <= a - 2; i++) b += i;
  return b;
}
int f(int a, int b, int c) {
  int d = 0;
  for (int i = 1; i <= 5; i++) d += (x[b][i] - x[a][i]) * (x[c][i] - x[a][i]);
  if (d <= 0)
    return 1;
  else
    return 0;
}
int main() {
  int a, b = 0, c = 0;
  cin >> a;
  for (int i = 1; i <= a; i++)
    for (int j = 1; j <= 5; j++) cin >> x[i][j];
  for (int i = 1; i <= a; i++) {
    b = 0;
    int o = 0;
    for (int j = 1; j <= a; j++) {
      for (int k = 1; k <= a; k++) {
        if (j < k && i != j && i != k) {
          if (f(i, j, k) == 1) b++;
          if (f(i, j, k) == 0) {
            o++;
            break;
          }
        }
      }
      if (o != 0) {
        i++;
        break;
      }
    }
    if (c == 11) {
      cout << 0;
      return 0;
    }
    if (b == g(a)) {
      c++;
      y[c] = i;
    }
  }
  cout << c << endl;
  for (int i = 1; i <= c; i++) cout << y[i] << " ";
  return 0;
}
