import java.util.ArrayDeque; import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); ArrayDeque que = new ArrayDeque<>(); for (int i = 1; i <= N; ++i) que.addLast(i); while (que.size() > 1) { ArrayDeque next = new ArrayDeque<>(); while (!que.isEmpty()) { if (que.size() >= 2) { System.out.println("? " + que.pop() + " " + que.pop()); int ans = sc.nextInt(); next.add(ans); } else if (que.size() == 1) { next.add(que.pop()); } } que = next; } int first=que.pop(); for(int i=1;i<=N;++i) { if(i!=first) { que.addLast(i); } } while (que.size() > 1) { ArrayDeque next = new ArrayDeque<>(); while (!que.isEmpty()) { if (que.size() >= 2) { System.out.println("? " + que.pop() + " " + que.pop()); int ans = sc.nextInt(); next.add(ans); } else if (que.size() == 1) { next.add(que.pop()); } } que = next; } int second=que.pop(); System.out.println("! " + second); } void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }