Problem: Vitya is studying in the third grade. During the last math lesson all the pupils wrote on arithmetic quiz. Vitya is a clever boy, so he managed to finish all the tasks pretty fast and Oksana Fillipovna gave him a new one, that is much harder.

Let's denote a flip operation of an integer as follows: number is considered in decimal notation and then reverted. If there are any leading zeroes afterwards, they are thrown away. For example, if we flip 123 the result is the integer 321, but flipping 130 we obtain 31, and by flipping 31 we come to 13.

Oksana Fillipovna picked some number a without leading zeroes, and flipped it to get number ar. Then she summed a and ar, and told Vitya the resulting value n. His goal is to find any valid a.

As Oksana Fillipovna picked some small integers as a and ar, Vitya managed to find the answer pretty fast and became interested in finding some general algorithm to deal with this problem. Now, he wants you to write the program that for given n finds any a without leading zeroes, such that a + ar = n or determine that such a doesn't exist.

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 10100 000).

Output

If there is no such positive integer a without leading zeroes that a + ar = n then print 0. Otherwise, print any valid a. If there are many possible answers, you are allowed to pick any.

Examples

Input

4


Output

2


Input

11


Output

10


Input

5


Output

0


Input

33


Output

21

Note

In the first sample 4 = 2 + 2, a = 2 is the only possibility.

In the second sample 11 = 10 + 1, a = 10 — the only valid solution. Note, that a = 01 is incorrect, because a can't have leading zeroes.

It's easy to check that there is no suitable a in the third sample.

In the fourth sample 33 = 30 + 3 = 12 + 21, so there are three possibilities for a: a = 30, a = 12, a = 21. Any of these is considered to be correct answer.

Solution (in JAVA):

Solution:
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.io.*;
import java.util.*;

public class C342D
{

private static StringTokenizer st;
    
    public static void nextLine(BufferedReader br) throws IOException
    {
        st = new StringTokenizer(br.readLine());
    }
    
    public static int nextInt()
    {
        return Integer.parseInt(st.nextToken());
    }
    
    public static String next()
    {
        return st.nextToken();
    }
    
    public static long nextLong()
    {
        return Long.parseLong(st.nextToken());
    }

    public static double nextDouble()
    {
        return Double.parseDouble(st.nextToken());
    }
    
    static int[] arr;
    static int n;
    static int[][][] dp;
    
    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        nextLine(br);
        String s = next();
        n = s.length();
        arr = new int[s.length()];
        for (int i = 0; i < s.length(); i++)
        {
            arr[i] = s.charAt(i) - '0';
        }
        int[] ans = new int[s.length()];
        dp = new int[n][10][8];
        for (int i = 1; i <= arr[0]; i++)
        {
            //System.out.println("Trying " + i + " with bc0");
            if (dfs1(ans, 0, i, 0, 0, 0))
            {
                printAns(ans);
                return;
            }
            //System.out.println("Trying " + i + " with bc1");
            if (i < arr[0] && dfs1(ans, 0, i, 1, 0, 0))
            {
                printAns(ans);
                return;
            }
        }
        if (arr[0] != 1 || n == 1)
        {
            System.out.println(0);
            return;
        }
        int[] arr2 = new int[n-1];
        for (int i = 0; i < n-1; i++)
        {
            arr2[i] = arr[i+1];
        }
        arr2[0] += 10;
        arr = arr2;
        n--;
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < 10; j++)
            {
                Arrays.fill(dp[i][j], 0);
            }
        }
        ans = new int[n];
        for (int i = 1; i <= 9; i++)
        {
            if (i + 9 >= arr[0])
            {
               // System.out.println("Trying! " + i + " with bc0");
                if (dfs1(ans, 0, i, 0, 0, 0))
                {
                    printAns(ans);
                    return;
                }
            }
            if (i + 10 >= arr[0])
            {
                //System.out.println("Trying! " + i + " with bc1");
                if (dfs1(ans, 0, i, 1, 0, 0))
                {
                    printAns(ans);
                    return;
                }
            }
        }
        System.out.println("0");
    }
    
    public static void printAns(int[] ans)
    {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < ans.length; i++)
        {
            sb.append(ans[i]);
        }
        sb.append("\n");
        System.out.println(sb.toString());
    }

    public static boolean dfs1(int[] ans, int pos, int val, int bc, int tc, int lc)
    {
        int bot = n - pos - 1;
        int botDigit = (arr[pos] - val - bc + 20) % 10;
        //System.out.println("For val " + val + " Determined botdigit at pos " + bot + " is " + botDigit + " and form " + form(bc, tc, lc));
        switch (dp[pos][val][form(bc, tc, lc)])
        {
        case 1:
            ans[pos] = val;
            ans[bot] = botDigit;
            return true;
        case -1:
            return false;
        }
        if (n % 2 == 1 && pos == n/2)
        {
            //System.out.println("Considering pos " + pos + " value " + val + " form " + form(bc, tc, lc));
            if (arr[pos] >= 10)
            {
                if (val * 2 == arr[pos])
                {
                    ans[pos] = val;
                    return true;
                }
                return false;
            }
            if (bc != lc)
            {
                return false;
            }
            int sum = val * 2;
            if (bc == 1)
            {
                sum++;
            }
            if (sum % 10 != arr[pos])
            {
                return false;
            }
            if (tc == 1 && sum < 10)
            {
                return false;
            }
            if (tc == 0 && sum >= 10)
            {
                return false;
            }
            ans[pos] = val;
            return true;
        }
        else if (n % 2 == 0 && pos == (n/2-1))
        {
            if (arr[pos] >= 10)
            {
                int digit = arr[pos] - val - bc;
                if (digit >= 10)
                {
                    return false;
                }
                if ((digit + val) % 10 != arr[pos+1])
                {
                    return false;
                }
                int mc = (digit + val) / 10;
                if (digit + val + mc != arr[pos])
                {
                    return false;
                }
                ans[pos] = val;
                ans[pos+1] = digit;
                return true;
            }
            if (tc == 1)
            {
                if (arr[pos] > val || (arr[pos] == val && bc != 1))
                {
                    return false;
                }
            }
            else
            {
                if (arr[pos] < val || (arr[pos] == val && bc == 1))
                {
                    return false;
                }
            }
            int digit = (arr[pos] + 10 - val) % 10;
            digit = (digit + 10 - bc) % 10;
            if ((digit + val + lc) % 10 != arr[pos+1])
            {
                return false;
            }
            int mc = (digit + val + lc) / 10;
            if ((mc + digit + val) % 10 != arr[pos])
            {
                return false;
            }
            if (mc != bc) return false;
            ans[pos] = val;
            ans[pos+1] = digit;
            return true;
        }
        
        if (tc == 1 && (botDigit + val + bc) < 10)
        {
            return false;
        }
        
        if (botDigit + val + bc != tc*10 + arr[pos])
        {
            return false;
        }
        
        if ((botDigit + val + lc) % 10 != arr[bot])
        {
            return false;
        }
        int nextlc = (botDigit + val + lc) / 10;
        for (int i = 0; i <= 9; i++)
        {
            for (int j = 0; j < 2; j++)
            {
                boolean res = dfs1(ans, pos + 1, i, j, bc, nextlc);
                dp[pos+1][i][form(j, bc, nextlc)] = res ? 1 : -1;
                if (res)
                {
                    ans[pos] = val;
                    ans[bot] = botDigit;
                    return true;
                }
            }
        }
        return false;
    }
    
    public static int form(int a, int b, int c)
    {
        return (a << 2) + (b << 1) + c;
    }
}