#include <bits/stdc++.h>
using namespace std;
const int MAX = 1111;
struct Point {
  int a, b, c, d, e;
  Point() {}
};
int n;
Point p[MAX];
int dst[MAX][MAX];
bool bad[MAX];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> p[i].a >> p[i].b >> p[i].c >> p[i].d >> p[i].e;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      dst[i][j] = p[i].a * p[j].a + p[i].b * p[j].b + p[i].c * p[j].c +
                  p[i].d * p[j].d + p[i].e * p[j].e;
    }
  }
  int ans = n;
  for (int k = 0; k < n; ++k) {
    for (int i = 0; i < n; ++i) {
      if (i == k) continue;
      for (int j = i + 1; j < n; ++j) {
        if (dst[i][j] - dst[k][i] - dst[k][j] + dst[k][k] > 0) bad[k] = true;
      }
    }
    if (bad[k]) --ans;
  }
  cout << ans << "\n";
  for (int i = 0; i < n; ++i) {
    if (!bad[i]) cout << i + 1 << "\n";
  }
  return 0;
}
