#include <bits/stdc++.h>
using namespace std;
int N;
signed long long V[2001][70];
signed long long sel[2001][70];
int bm[2002];
void conv(int cur, string s) {
  int i, j;
  signed long long v[105] = {};
  for (i = 0; i < 100; i++) {
    v[i] += (s[i * 6 + 5] - '0') * 100000;
    v[i] += (s[i * 6 + 4] - '0') * 10000;
    v[i] += (s[i * 6 + 3] - '0') * 1000;
    v[i] += (s[i * 6 + 2] - '0') * 100;
    v[i] += (s[i * 6 + 1] - '0') * 10;
    v[i] += (s[i * 6 + 0] - '0') * 1;
  }
  for (i = 0; i < 2000; i++) {
    V[cur][i / 32] |= (v[0] & 1) << (i % 32);
    for (j = 0; j < 100; j++) v[j] = (v[j] >> 1) + ((v[j + 1] & 1) * 500000);
  }
}
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  memset(bm, 0xff, sizeof(bm));
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> s;
    reverse(s.begin(), s.end());
    s = s + string(601, '0');
    conv(i, s.substr(0, 600));
    sel[i][i / 32] = 1LL << (i % 32);
    for (j = 1999; j >= 0; j--)
      if (V[i][j / 32] & (1LL << (j % 32))) {
        if (bm[j] >= 0) {
          for (x = 0; x < 70; x++) V[i][x] ^= V[bm[j]][x];
          for (x = 0; x < 70; x++) sel[i][x] ^= sel[bm[j]][x];
        } else {
          (void)printf("0\n");
          bm[j] = i;
          break;
        }
      }
    if (j == -1) {
      y = 0;
      for (x = 0; x < 70; x++) y += __builtin_popcountll(sel[i][x]);
      (void)printf("%d", y - 1);
      for (x = 0; x < i; x++)
        if (sel[i][x / 32] & (1LL << (x % 32))) (void)printf(" %d", x);
      (void)printf("\n");
    }
  }
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false);
  for (i = 0; i < argc - 1; i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < s.size(); i++) ungetc(s[s.size() - 1 - i], stdin);
  solve();
  return 0;
}
