#include <bits/stdc++.h>
using namespace std;
int n;
struct node {
  int a[5];
} p[1005];
inline bool check(int i, int j, int k) {
  int ret = 0;
  for (int o = 0; o < 5; ++o)
    ret += (p[j].a[o] - p[i].a[o]) * (p[k].a[o] - p[i].a[o]);
  return ret <= 0;
}
int main() {
  scanf("%d", &n);
  if (n > 50) return 0 * puts("0");
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < 5; ++j) scanf("%d", &p[i].a[j]);
  vector<int> res;
  for (int i = 1; i <= n; ++i) {
    bool flag = true;
    for (int j = 1; j <= n; ++j)
      if (i != j)
        for (int k = j + 1; k <= n; ++k)
          if (i != k) flag &= check(i, j, k);
    if (flag) res.push_back(i);
  }
  printf("%d\n", res.size());
  for (auto x : res) printf("%d\n", x);
  return 0;
}
