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.

import functools


def memoize(func):
    cache = {}  # Create a cache to store previously computed results

    @functools.wraps(func)
    def wrapper(*args):
        if args not in cache:  # Check if the result is already in the cache
            cache[args] = func(*args)  # Compute and store the result in the cache
        return cache[args]  # Return the result from the cache

    return wrapper


@memoize
def recursion(n):
    if n % 8 == 0:
        return n
    if n < 10:
        return 0
    arr_num = [x for x in str(n)]
    for i in range(len(arr_num)):
        new_arr_num = arr_num.copy()
        new_arr_num.pop(i)
        new_num = int(''.join(new_arr_num))
        result = recursion(new_num)
        if result != 0:
            return result
    return 0


def main():
    n = input()
    if n.count('8') >= 1:
        print("YES")
        print(8)
    elif n.count('0') >= 1:
        print("YES")
        print(0)
    else:
        x = recursion(int(n))
        if x != 0:
            print("YES")
            print(x)
        else:
            print("NO")


main()
