You are given a non-negative integer *n*, its decimal representation consists of at most 100 digits and doesn't contain leading zeroes.

Your task is to determine if it is possible in this case to remove some of the digits (possibly not remove any digit at all) so that the result contains at least one digit, forms a non-negative integer, doesn't have leading zeroes and is divisible by 8. After the removing, it is forbidden to rearrange the digits.

If a solution exists, you should print it.
The single line of the input contains a non-negative integer *n*. The representation of number *n* doesn't contain any leading zeroes and its length doesn't exceed 100 digits.
def f(arr):
    n=len(arr)
    if n==0:
        return "",False
    if n==1 and int(arr)%8==0:
        return arr,True
    elif n==1:
        return "",False

    for st in range(1,n):
        low=0
        high=low+st-1

        while high<n:
            if low!=0 and int(arr[:low])%8==0:
                
                return arr[:low],True
            elif high<n-1 and int(arr[high+1:])%8==0:
                
                return arr[high+1:],True
            elif low!=0 and high<n-1 and int(arr[:low]+arr[high+1:])%8==0:
                
                return arr[:low]+arr[high+1:],True

            lco,lcb=f(arr[:low])
            rco,rcb=f(arr[high+1:])
            if lcb:
                return lco,lcb
            if rcb:
                return rco,rcb
            
            low+=1
            if high<n:
                high+=1
    return "",False
arr=input()
o,b=f(arr)
if b:
    print("YES")
    print(o)
else:
    print("NO")
