Problem: 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.

Input

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. 

Output

Print "NO" (without quotes), if there is no such way to remove some digits from number n. 

Otherwise, print "YES" in the first line and the resulting number after removing digits from number n in the second line. The printed number must be divisible by 8.

If there are multiple possible answers, you may print any of them.

Examples

Input

3454


Output

YES
344


Input

10


Output

YES
0


Input

111111


Output

NO

Solution (in JAVA):

Solution:
//package codeforces.practice.div2c;

import java.io.*;
import java.util.*;

public class DivisibilityByEight {
    public static void main(String[] args) {
//        try {
//            FastScanner in = new FastScanner(new FileInputStream("src/input.in"));
//            PrintWriter out = new PrintWriter(new FileOutputStream("src/output.out"));

        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

            solve(1, in, out);

//        } catch (IOException e) {
//            e.printStackTrace();
//        }
    }

    private static void solve(int q, FastScanner in, PrintWriter out) {
        for (int qq = 0; qq < q; qq++) {
            String s = in.next();
            boolean can = false;
            int d = -1;
            //16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96
            Set<Integer> seen = new HashSet<>();
            for(int i = 0; i < s.length(); i++) {
                d = s.charAt(i) - '0';
                if(d == 0 || d == 8) {
                    can = true;
                }
                else {
                    switch (d) {
                        case 6:
                            if(seen.contains(1) || seen.contains(5) || seen.contains(9)) {
                                can = true;
                                if(seen.contains(1)) {
                                    d = 1;
                                }
                                else if(seen.contains(5)) {
                                    d = 5;
                                }
                                else {
                                    d = 9;
                                }
                                d = d * 10 + 6;
                            }
                            break;
                        case 4:
                            if(seen.contains(2) || seen.contains(6)) {
                                can = true;
                                if(seen.contains(2)) {
                                    d = 2;
                                }
                                else {
                                    d = 6;
                                }
                                d = d * 10 + 4;
                            }
                            break;
                        case 2:
                            if(seen.contains(3) || seen.contains(7)) {
                                can = true;
                                if(seen.contains(3)) {
                                    d = 3;
                                }
                                else {
                                    d = 7;
                                }
                                d = d * 10 + 2;
                            }
                            break;
                    }
                }
                if(can) {
                    break;
                }
                seen.add(d);
            }
            //3 digits with the last 2 digits divisible by 4 and the hundred digit odd
            //12, 36, 44, 52, 76, 92
            if(!can) {
                seen.clear();
                int d2 = -1;
                for(int i = s.length() - 1; i >= 0; i--) {
                    int d1 = s.charAt(i) - '0';
                    if(d2 > 0 && d1 % 2 != 0) {
                        can = true;
                        d = d1 * 100 + d2;
                        break;
                    }
                    if(d1 == 1 && seen.contains(2)) {
                        d2 = 12;
                    }
                    else if(d1 == 3 && seen.contains(6)) {
                        d2 = 36;
                    }
                    else if(d1 == 4 && seen.contains(4)) {
                        d2 = 44;
                    }
                    else if(d1 == 5 && seen.contains(2)) {
                        d2 = 52;
                    }
                    else if(d1 == 7 && seen.contains(6)) {
                        d2 = 76;
                    }
                    else if(d1 == 9 && seen.contains(2)) {
                        d2 = 92;
                    }
                    seen.add(d1);
                }
            }
            if(can) {
                out.println("YES");
                out.println(d);
            }
            else {
                out.println("NO");
            }
        }
        out.close();
    }

    private static long modularAdd(long a, long b, int mod) {
        long sum = a + b;
        if (sum >= mod) {
            sum -= mod;
        }
        return sum;
    }

    private static long modularSubtract(long a, long b, int mod) {
        long diff = a - b;
        if (diff < 0) {
            diff += mod;
        }
        return diff;
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream stream) {
            try {
                br = new BufferedReader(new InputStreamReader(stream));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}