{"raw_statement":[{"iden":"background","content":"译自 [XXVIII Olimpiada Informatyczna - III etap](https://sio2.mimuw.edu.pl/c/oi28-3/dashboard/) [Kolekcjoner Bajtemonów 2](https://szkopul.edu.pl/problemset/problem/yI8VISW680r7ktJAPvA5QPkl/statement/)。\n\n试机题。"},{"iden":"statement","content":"给你 $n$ 个数对，你要进行 $n$ 次二选一，这样你就有了 $n$ 个数，最大化这 $n$ 个数的 $\\gcd$。"},{"iden":"input","content":"第一行一个正整数 $n$。\n\n接下来 $n$ 行，每行两个整数，$a_i,b_i$。"},{"iden":"output","content":"一行一个数：最大的 $\\gcd$。"},{"iden":"note","content":"对于所有数据，$1\\leq n\\leq 10^6$，$1\\leq a_i\\leq 5\\times 10^5$，$1\\leq b_i<2^{63}$。\n\n对于 $42pts$ 的数据，$n\\leq 5000$。"}],"translated_statement":null,"sample_group":[["4\n5 7\n10 15\n13 20\n7 5\n","5"],["2\n18900 22050\n14700 17640\n","7350"],["见附件","2"]],"show_order":[],"formal_statement":null,"simple_statement":null,"has_page_source":false}