{"problem":{"name":"A. Arpa’s hard exam and Mehrdad’s naive cheat(Hard)","description":{"content":"_There exists an island called Arpa’s land, some beautiful girls are living there, as ugly ones do._ Mehrdad wants to become minister of Arpa’s land. Arpa has prepared an exam. Exam has only one ques","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10118A"},"statements":[{"statement_type":"Markdown","content":"_There exists an island called Arpa’s land, some beautiful girls are living 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 1378n. \n\nMehrdad has become quite confused and wants you to help him. Please help, although it's a naive cheat.\n\nThe single line of input contains one integer n (0  ≤  n  ≤  10106).\n\nPrint single integer — the last digit of 1378n.\n\nIn the first example, last digit of 13781 = 1378 is 8.\n\nIn the second example, last digit of 13782 = 1378·1378 = 1898884 is 4.\n\n## Input\n\nThe single line of input contains one integer n (0  ≤  n  ≤  10106).\n\n## Output\n\nPrint single integer — the last digit of 1378n.\n\n[samples]\n\n## Note\n\nIn the first example, last digit of 13781 = 1378 is 8.In the second example, last digit of 13782 = 1378·1378 = 1898884 is 4.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $, $ 0 \\leq n \\leq 10^{106} $.  \n\n**Objective**  \nCompute the last digit of $ 1378^n $, i.e., find $ 1378^n \\mod 10 $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10118A","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}