#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
struct node {
  int a, b, c, d, e;
} nodes[maxn];
bool vis[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d%d%d", &nodes[i].a, &nodes[i].b, &nodes[i].c, &nodes[i].d,
          &nodes[i].e);
  }
  long long temp;
  int cnt = 0;
  int ans[maxn];
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      bool flag = true;
      for (int j = 1; j <= n; j++)
        if (j != i)
          for (int k = 1; k <= n; k++)
            if (k != i && k != j) {
              temp = (nodes[j].a - nodes[i].a) * (nodes[k].a - nodes[i].a) +
                     (nodes[j].b - nodes[i].b) * (nodes[k].b - nodes[i].b) +
                     (nodes[j].c - nodes[i].c) * (nodes[k].c - nodes[i].c) +
                     (nodes[j].d - nodes[i].d) * (nodes[k].d - nodes[i].d) +
                     (nodes[j].e - nodes[i].e) * (nodes[k].e - nodes[i].e);
              if (temp > 0) {
                k = n + 1;
                j = n + 1;
                flag = false;
              } else {
                vis[j] = 1;
                vis[k] = 1;
              }
            }
      if (flag) {
        cnt++;
        ans[cnt] = i;
      }
    }
  cout << cnt << endl;
  for (int i = 1; i <= cnt; i++) cout << ans[i] << endl;
  return 0;
}
