#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int mod = 1e8;
vector<int> ver, hor;
int f(int x, int y) {
  printf("0 %d %d\n", x, y);
  fflush(stdout);
  int d;
  scanf("%d", &d);
  return d;
}
int main() {
  int t = rand() % mod;
  while (f(t, t) == 0) t = rand() % mod;
  int cur = -mod;
  while (cur <= mod) {
    int res;
    while (cur <= mod && (res = f(cur, cur)) != 0) cur += res;
    if (cur > mod) break;
    if (f(cur, t) == 0) ver.push_back(cur);
    if (f(t, cur) == 0) hor.push_back(cur);
    if (cur + 1000 <= mod && f(cur + 1000, cur + 1000) >= 1000)
      cur += 1000;
    else
      ++cur;
  }
  printf("1 %d %d\n", ver.size(), hor.size());
  for (auto v : ver) printf("%d ", v);
  printf("\n");
  for (auto v : hor) printf("%d ", v);
  printf("\n");
  fflush(stdout);
  return 0;
}
