#include <bits/stdc++.h>
const int INF = 1e9 + 7;
const long long INFLL = 1e17;
const double EPS = 1e-6;
using namespace std;
const int maxn = 1005;
int n;
int arr[maxn][5];
int main() {
  scanf("%d", &n);
  for (int k = (int)0; k < (int)n; k++)
    for (int i = (int)0; i < (int)5; i++) scanf("%d", &arr[k][i]);
  vector<int> ret;
  for (int k = (int)0; k < (int)n; k++) {
    int bisa = 1;
    for (int i = (int)0; i < (int)n; i++)
      if (i != k) {
        for (int j = (int)i + 1; j < (int)n; j++)
          if (j != k && j != k) {
            int cur = 0;
            for (int a = (int)0; a < (int)5; a++)
              cur += (arr[i][a] - arr[k][a]) * (arr[j][a] - arr[k][a]);
            if (cur > 0) bisa = 0;
            if (!bisa) break;
          }
        if (!bisa) break;
      }
    if (bisa) ret.push_back(k);
  }
  printf("%d\n", ret.size());
  for (auto a : ret) cout << a + 1 << endl;
}
