#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
int a[maxn][5];
int n;
bool check(int top) {
  for (int i = 1; i <= n; i++)
    if (i != top)
      for (int j = 1; j <= n; j++)
        if (j != top && j != i) {
          int sum = 0;
          for (int x = 0; x < 5; x++)
            sum += (a[i][x] - a[top][x]) * (a[j][x] - a[top][x]);
          if (sum > 0) return 0;
        }
  return 1;
}
int main() {
  scanf("%d", &n);
  if (n > 11) {
    puts("0");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 5; j++) scanf("%d", &a[i][j]);
  }
  vector<int> v;
  for (int i = 1; i <= n; i++)
    if (check(i)) v.push_back(i);
  printf("%d\n", v.size());
  for (int i : v) printf("%d\n", i);
  return 0;
}
