#include <bits/stdc++.h>
using namespace std;
int N;
bool b[2010];
int b2[2010];
unsigned int Mat[2010][2010];
int v[2010];
char s[2010];
unsigned int sol[2010][2010];
long long imp(int* a, long long b) {
  long long r = 0;
  for (int i = a[0]; i > 0; --i) {
    r = (r * 10 + a[i]);
    a[i] = r / b;
    r %= b;
  }
  while (a[0] > 1 && a[a[0]] == 0) --a[0];
  return r;
}
void change(unsigned int* v, int pos) { v[pos / 32] ^= (1u << (pos & 31)); }
int count(int val) {
  int ret = 0;
  while (val) {
    ++ret;
    val &= (val - 1);
  }
  return ret;
}
void gauss() {
  for (int i = 1; i <= N; ++i) {
    int j;
    for (j = 1; j <= 70 && !Mat[i][j]; ++j)
      ;
    if (j > 70) continue;
    int pos;
    b[i] = true;
    for (pos = 31; pos >= 0 && ((1LL << pos) & Mat[i][j]) == 0; --pos)
      ;
    for (int k = i + 1; k <= N; ++k)
      if (Mat[k][j] & (1LL << pos)) {
        for (int l = 1; l <= 70; ++l) Mat[k][l] ^= Mat[i][l];
        change(sol[k], i - 1);
        for (int l = 0; l <= 70; ++l) sol[k][l] ^= sol[i][l];
      }
  }
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) {
    scanf("%s", s + 1);
    memset(v, 0, sizeof(v));
    v[0] = strlen(s + 1);
    for (int j = 1; j <= v[0]; ++j) v[j] = s[v[0] - j + 1] - '0';
    for (int j = 1; j <= 70; ++j) Mat[i][j] = imp(v, (1LL << 32));
  }
  gauss();
  for (int i = 1; i <= N; ++i) {
    if (b[i]) {
      printf("0\n");
      continue;
    }
    int s = 0;
    for (int j = 0; j <= 70; ++j) s += count(sol[i][j]);
    printf("%d ", s);
    for (int j = 0; j <= 70; ++j)
      for (int k = 0; k < 32; ++k)
        if (sol[i][j] & (1LL << k)) printf("%d ", j * 32 + k);
    printf("\n");
  }
  return 0;
}
