@@ -0,0 +1,390 @@
+import sys%0A%0A%0Adef fib(n):%0A    a, b = 1, 1%0A    n = int(n)%0A    if n %3E= 2:%0A        yield a%0A        yield b%0A        for _ in range(2, n):%0A            summator = a + b%0A            yield int(str(summator)%5B-1%5D)%0A            a = int(str(b)%5B-1%5D)%0A            b = int(str(summator)%5B-1%5D)%0A    else:%0A        yield a%0A%0A%0Aif __name__ == '__main__':%0A    inp = sys.stdin.readline()%0A    print(list(fib(inp))%5B-1%5D)%0A

add take last fibonacci digit