{"raw_statement":[{"iden":"statement","content":"The following problem is well-known: given integers _n_ and _m_, calculate\n\n<center>,</center>where 2_n_ = 2·2·...·2 (_n_ factors), and denotes the remainder of division of _x_ by _y_.\n\nYou are asked to solve the \"reverse\" problem. Given integers _n_ and _m_, calculate\n\n<center>.</center>"},{"iden":"input","content":"The first line contains a single integer _n_ (1 ≤ _n_ ≤ 108).\n\nThe second line contains a single integer _m_ (1 ≤ _m_ ≤ 108)."},{"iden":"output","content":"Output a single integer — the value of ."},{"iden":"examples","content":"Input\n\n4\n42\n\nOutput\n\n10\n\nInput\n\n1\n58\n\nOutput\n\n0\n\nInput\n\n98765432\n23456789\n\nOutput\n\n23456789"},{"iden":"note","content":"In the first example, the remainder of division of 42 by 24 = 16 is equal to 10.\n\nIn the second example, 58 is divisible by 21 = 2 without remainder, and the answer is 0."}],"translated_statement":[{"iden":"statement","content":"以下问题是众所周知的：给定整数 #cf_span[n] 和 #cf_span[m]，计算\n\n其中 #cf_span[2n = 2·2·...·2]（#cf_span[n] 个因子），且  表示 #cf_span[x] 除以 #cf_span[y] 的余数。\n\n你被要求解决这个“逆向”问题。给定整数 #cf_span[n] 和 #cf_span[m]，计算\n\n第一行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 108]）。\n\n第二行包含一个整数 #cf_span[m]（#cf_span[1 ≤ m ≤ 108]）。\n\n请输出一个整数 ——  的值。\n\n在第一个示例中，42 除以 #cf_span[24 = 16] 的余数等于 10。\n\n在第二个示例中，58 能被 #cf_span[21 = 2] 整除，余数为 0。"},{"iden":"input","content":"第一行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 108]）。第二行包含一个整数 #cf_span[m]（#cf_span[1 ≤ m ≤ 108]）。"},{"iden":"output","content":"请输出一个整数 ——  的值。"},{"iden":"examples","content":"输入442输出10输入158输出0输入9876543223456789输出23456789"},{"iden":"note","content":"在第一个示例中，42 除以 #cf_span[24 = 16] 的余数等于 10。在第二个示例中，58 能被 #cf_span[21 = 2] 整除，余数为 0。"}],"sample_group":[],"show_order":[],"formal_statement":"Given integers $ n $ and $ m $, compute:\n\n$$\n2^n \\bmod m\n$$","simple_statement":null,"has_page_source":false}