import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("0 0"); int lower_y = 0, upper_y = 1000000 + 1; int glob_y_dist = sc.nextInt(); if(glob_y_dist == 0){ return; } while(lower_y + 1 < upper_y){ final int middle_y = (lower_y + upper_y) / 2; System.out.println("0 " + middle_y); final int result = sc.nextInt(); if(result == 0){ return; } if(result <= glob_y_dist){ lower_y = middle_y; }else{ upper_y = middle_y; } } System.out.println("0 " + lower_y); int lower_x = 0, upper_x = 1000000 + 1; int glob_x_dist = sc.nextInt(); if(glob_x_dist == 0){ return; } while(lower_x + 1 < upper_x){ final int middle_x = (lower_x + upper_x) / 2; System.out.println(middle_x + " " + lower_y); final int result = sc.nextInt(); if(result == 0){ return; } if(result <= glob_x_dist){ lower_x = middle_x; }else{ upper_x = middle_x; } } System.out.println(lower_x + " " + lower_y); } }