{"raw_statement":[{"iden":"problem statement","content":"Find the last digit of the remainder when $2^N$ is divided by $2^M - 2^K$.\nYou are given $T$ test cases, each of which must be solved."},{"iden":"constraints","content":"*   $1 \\le T \\le 2 \\times 10^5$\n*   $1 \\le N \\le 10^{18}$\n*   $1 \\le K < M \\le 10^{18}$\n*   $N,M,K$ are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format, where $\\mathrm{case}_i$ represents the $i$\\-th test case:\n\n$T$\n$\\mathrm{case}_1$\n$\\mathrm{case}_2$\n$\\vdots$\n$\\mathrm{case}_T$\n\nEach test case is given in the following format:\n\n$N$ $M$ $K$"},{"iden":"sample input 1","content":"5\n9 6 2\n123 84 50\n95 127 79\n1000000007 998244353 924844033\n473234053352300580 254411431220543632 62658522328486675"},{"iden":"sample output 1","content":"2\n8\n8\n8\n4\n\nFor the first test case, the remainder of $2^9$ divided by $2^6 - 2^2$ is $32$. Thus, the answer is the last digit of $32$, which is $2$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}