package contest190705; import java.io.PrintWriter; import java.util.Arrays; import java.util.Random; import java.util.Scanner; public class E2 { static Scanner in; static PrintWriter out; static String INPUT = ""; static int stronger(int x, int y) { out.println("? " + x + " " + y); out.flush(); return ni(); } static void solve() { int n = ni(); Random gen = new Random(); int[] ord = shuffle(n, gen); for(int i = 0;i < n;i++)ord[i]++; int o1 = 0, o2 = 0; if(stronger(ord[0], ord[1]) == ord[0]) { o1 = ord[0]; o2 = ord[1]; }else { o1 = ord[1]; o2 = ord[0]; } for(int i = 2;i < n;i++) { if(stronger(ord[i], o2) == ord[i]) { if(stronger(ord[i], o1) == ord[i]) { o2 = o1; o1 = ord[i]; }else { o2 = ord[i]; } } } out.println("! " + o2); out.flush(); } public static int[] shuffle(int n, Random gen){ int[] a = new int[n]; for(int i = 0;i < n;i++)a[i] = i; for(int i = 0;i < n;i++){ int ind = gen.nextInt(n-i)+i; int d = a[i]; a[i] = a[ind]; a[ind] = d; } return a; } public static void main(String[] args) throws Exception { in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT); out = new PrintWriter(System.out); solve(); out.flush(); } static int ni() { return Integer.parseInt(in.next()); } static long nl() { return Long.parseLong(in.next()); } static double nd() { return Double.parseDouble(in.next()); } static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); } }