while 1:

    try:n=eval(input())

    except:break

    n=list(map(int,n))

    while len(n)>1:

        n= [(i+j)%10 for i,j in zip(n[:-1],n[1:])]

    print((*n))
while 1:

    try:n=eval(input())

    except:break

    while len(n)>1:

        n= [(int(i)+int(j))%10 for i,j in zip(n[:-1],n[1:])]

    print((*n))
while 1:
    try:
        n = eval(input())
    except:
        break
    n = list(map(int, n))
    while len(n) > 1:
        n = [(i + j) % 10 for i, j in zip(n[:-1], n[1:])]
    print((*n))

while 1:
    try:
        n = eval(input())
    except:
        break
    while len(n) > 1:
        n = [(int(i) + int(j)) % 10 for i, j in zip(n[:-1], n[1:])]
    print((*n))

-    n = list(map(int, n)) -        n = [(i + j) % 10 for i, j in zip(n[:-1], n[1:])] +        n = [(int(i) + int(j)) % 10 for i, j in zip(n[:-1], n[1:])]