#include <bits/stdc++.h>
using namespace std;
int ed, tot, cnt, a[100010], b[100010], c[100010], t, f, w;
int ask(int x, int y) {
  int d;
  printf("0 %d %d\n", x, y);
  fflush(stdout);
  scanf("%d", &d);
  return d;
}
int main() {
  t = -1e8;
  while (t <= 1e8) {
    int d = ask(t, t);
    if (d) w = t;
    if (!d) {
      a[++ed] = t;
      if (t + 1000 <= 1e8 && ask(t + 1000, t + 1000) == 1000)
        t += 1000;
      else
        ++t;
      continue;
    }
    if (d <= 1000) {
      t += d;
      if (t > 1e8) break;
      d = ask(t, t);
      if (d == 0) a[++ed] = t;
      t += d;
      if (d == 0) ++t;
    } else
      t += d;
  }
  for (int i = (1); i <= (ed); ++i) {
    if (ask(w, a[i]) == 0) c[++tot] = a[i];
    if (ask(a[i], w) == 0) b[++cnt] = a[i];
  }
  printf("1 %d %d\n", cnt, tot);
  for (int i = (1); i <= (cnt); ++i) printf("%d ", b[i]);
  puts("");
  for (int i = (1); i <= (tot); ++i) printf("%d ", c[i]);
  puts("");
  return 0;
}
