#include <bits/stdc++.h>
using namespace std;
int n;
bitset<2100> linear[2100], b[2100];
char s[610];
long long buf[610];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    int len = strlen(s);
    bitset<2100> c, used;
    c.reset();
    used.reset();
    used[i] = 1;
    reverse(s, s + len);
    for (int i = len - 1; i >= 0; i--) buf[i] = s[i] - '0';
    int tpos = 0;
    while (len) {
      const long long t = (1ll << 50);
      long long cur = 0;
      for (int j = len - 1; j >= 0; j--) {
        cur = cur * 10 + buf[j];
        buf[j] = cur / t;
        cur %= t;
      }
      for (int j = 0; j < 50; j++) {
        c[tpos++] = cur & 1;
        cur >>= 1;
      }
      while (len && buf[len - 1] == 0) len--;
    }
    bool r = 1;
    for (int j = 2099; j >= 0; j--) {
      if (c[j]) {
        if (linear[j].any()) {
          used ^= b[j];
          c ^= linear[j];
        } else {
          linear[j] = c;
          b[j] = used;
          r = 0;
          break;
        }
      }
    }
    if (r) {
      int cnt = 0;
      for (int j = 1; j < i; j++)
        if (used[j]) cnt++;
      printf("%d ", cnt);
      for (int j = 1; j < i; j++)
        if (used[j]) printf("%d ", j - 1);
      puts("");
    } else
      puts("0");
  }
  return 0;
}
