#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double E = exp(1.0);
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int maxn = 9 + 2 * 1e5;
const int maxm = 9 + 1e5;
int n;
int no[1003][10];
int cnt;
bool vis[1003];
int main() {
  scanf("%d", &n);
  for (int(i) = (0); (i) < (n); (i)++) {
    for (int(j) = (0); (j) < (5); (j)++) {
      scanf("%d", &no[i][j]);
    }
  }
  cnt = n;
  memset(vis, 1, sizeof(vis));
  ;
  for (int(i) = (0); (i) < (n); (i)++) {
    for (int(j) = (0); (j) < (n); (j)++) {
      if (j == i) continue;
      for (int(k) = (0); (k) < (n); (k)++) {
        if (k == i) continue;
        if (k == j) continue;
        if ((no[j][0] - no[i][0]) * (no[k][0] - no[i][0]) +
                (no[j][1] - no[i][1]) * (no[k][1] - no[i][1]) +
                (no[j][2] - no[i][2]) * (no[k][2] - no[i][2]) +
                (no[j][3] - no[i][3]) * (no[k][3] - no[i][3]) +
                (no[j][4] - no[i][4]) * (no[k][4] - no[i][4]) >
            0) {
          vis[i] = 0;
          cnt--;
          break;
        }
      }
      if (vis[i] == 0) break;
    }
  }
  printf("%d\n", cnt);
  bool tag = 1;
  for (int(i) = (0); (i) < (n); (i)++) {
    if (vis[i]) {
      if (tag) {
        tag = 0;
        printf("%d", i + 1);
      } else
        printf(" %d", i + 1);
    }
  }
  return 0;
}
