{"raw_statement":[{"iden":"statement","content":"_There exists an island called Arpa’s land, some beautiful girls live there, as ugly ones do._\n\nMehrdad wants to become minister of Arpa’s land. Arpa has prepared an exam. Exam has only one question, given _n_, print the last digit of 1378_n_.\n\n<center>![image](https://espresso.codeforces.com/ac805c7c78540a009fed5a8407fb3448d2a085a6.png)</center>Mehrdad has become quite confused and wants you to help him. Please help, although it's a naive cheat."},{"iden":"input","content":"The single line of input contains one integer _n_ (0  ≤  _n_  ≤  109)."},{"iden":"output","content":"Print single integer — the last digit of 1378_n_."},{"iden":"examples","content":"Input\n\n1\n\nOutput\n\n8\n\nInput\n\n2\n\nOutput\n\n4"},{"iden":"note","content":"In the first example, last digit of 13781 = 1378 is 8.\n\nIn the second example, last digit of 13782 = 1378·1378 = 1898884 is 4."}],"translated_statement":[{"iden":"statement","content":"_存在一个名为 Arpa 土地的岛屿，那里住着一些美丽的女孩，也有丑陋的女孩。_\n\nMehrdad 想成为 Arpa 土地的部长。Arpa 准备了一场考试，考试只有一道题：给定 #cf_span[n]，请输出 #cf_span[1378n] 的最后一位数字。\n\nMehrdad 感到非常困惑，希望你帮助他。请帮帮他吧，尽管这只是一个简单的作弊方法。\n\n输入的唯一一行包含一个整数 #cf_span[n]（#cf_span[0  ≤  n  ≤  109]）。\n\n请输出一个整数 —— #cf_span[1378n] 的最后一位数字。\n\n在第一个例子中，#cf_span[13781 = 1378] 的最后一位数字是 #cf_span[8]。\n\n在第二个例子中，#cf_span[13782 = 1378·1378 = 1898884] 的最后一位数字是 #cf_span[4]。\n\n"},{"iden":"input","content":"输入的唯一一行包含一个整数 #cf_span[n]（#cf_span[0  ≤  n  ≤  109]）。"},{"iden":"output","content":"请输出一个整数 —— #cf_span[1378n] 的最后一位数字。"},{"iden":"examples","content":"输入1输出8输入2输出4"},{"iden":"note","content":"在第一个例子中，#cf_span[13781 = 1378] 的最后一位数字是 #cf_span[8]。在第二个例子中，#cf_span[13782 = 1378·1378 = 1898884] 的最后一位数字是 #cf_span[4]。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $, $ 0 \\leq n \\leq 10^9 $.  \n\n**Objective**  \nCompute the last digit of $ 1378^n $, i.e., compute $ 1378^n \\mod 10 $.","simple_statement":null,"has_page_source":false}