#include <bits/stdc++.h>
using namespace std;
int n, x, len, tmp[2001], cnt;
char s[2001];
int id[2001];
bitset<2000> num[2001], a;
bitset<2000> ans[2001], Ans, ms;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    len = strlen(s + 1);
    cnt = 0;
    a.reset();
    for (int j = 1; j <= len; j++) tmp[j] = s[len - j + 1] - '0';
    while (len) {
      int ys = 0;
      for (int j = len; j; j--) {
        int tt = (ys * 10 + tmp[j]) >> 1;
        ys = (ys * 10 + tmp[j]) & 1;
        tmp[j] = tt;
      }
      a[++cnt] = ys;
      while (len > 0 && !tmp[len]) len--;
    }
    Ans.reset();
    for (int k = 2000; k >= 0; k--)
      if (a[k]) {
        if (!num[k].count()) {
          num[k] = a;
          id[k] = i;
          ans[k] = Ans;
          ans[k][i] = 1;
          break;
        } else {
          a ^= num[k];
          Ans ^= ans[k];
        }
      }
    if (!a.count()) {
      printf("%d ", Ans.count());
      for (int j = 1; j <= n; j++)
        if (Ans[j]) printf("%d ", j - 1);
      printf("\n");
    } else
      printf("0\n");
  }
}
