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 remove_digits(n):
    # Check if the number is divisible by 8
    if n % 8 != 0:
        return "NO"

    # Search for a digit that can be removed
    for i in range(len(str(n))):
        if str(n)[i] == '0':
            continue
        new_n = int(str(n)[:i] + str(n)[i+1:])
        if new_n % 8 == 0:
            return "YES", new_n

    # Check if the number can be divided into two parts
    for i in range(1, len(str(n))):
        if str(n)[:i] % 8 == 0 and str(n)[i:] % 8 == 0:
            return "YES", int(str(n)[:i])

    # Check if the number can be divided into three parts
    for i in range(1, len(str(n))-1):
        if str(n)[:i] % 8 == 0 and str(n)[i:i+1] % 8 == 0 and str(n)[i+1:] % 8 == 0:
            return "YES", int(str(n)[:i])

    return "NO"

s = input().strip()
ans = remove_digits(s)
print(ans)
if ans == "YES":
    ans, num = remove_digits(s)
    print(num)
