Problem: Berland, 2016. The exchange rate of currency you all know against the burle has increased so much that to simplify the calculations, its fractional part was neglected and the exchange rate is now assumed to be an integer.

Reliable sources have informed the financier Anton of some information about the exchange rate of currency you all know against the burle for tomorrow. Now Anton knows that tomorrow the exchange rate will be an even number, which can be obtained from the present rate by swapping exactly two distinct digits in it. Of all the possible values that meet these conditions, the exchange rate for tomorrow will be the maximum possible. It is guaranteed that today the exchange rate is an odd positive integer n. Help Anton to determine the exchange rate of currency you all know for tomorrow!

Input

The first line contains an odd positive integer n — the exchange rate of currency you all know for today. The length of number n's representation is within range from 2 to 105, inclusive. The representation of n doesn't contain any leading zeroes.

Output

If the information about tomorrow's exchange rate is inconsistent, that is, there is no integer that meets the condition, print  - 1.

Otherwise, print the exchange rate of currency you all know against the burle for tomorrow. This should be the maximum possible number of those that are even and that are obtained from today's exchange rate by swapping exactly two digits. Exchange rate representation should not contain leading zeroes.

Examples

Input

527


Output

572


Input

4573


Output

3574


Input

1357997531


Output

-1

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.BigInteger;


public class Main {
  


	public static void main(String[] args) throws Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] my = new String[1005];
		 StringBuffer bf = new StringBuffer();
		String line = br.readLine();
        int i;
        int found = -1;
         int l = line.length();
        for(i=0;i<l;i++)
        {
            int  ch = line.charAt(i);
            ch = ch-'0';
            if(ch%2==0){
                found = i;break;
            }
        }
    
        if(found==-1)System.out.println(-1);
        else {
           int small = -1;
         int last = line.charAt(l-1)-'0';
           for(i=0;i<l-1;i++)
           {
                int  ch = line.charAt(i);
            ch = ch-'0';
            if(ch%2==0){
              
                if(ch < last )
                {
                   // System.out.println(ch + " is less than " + last);
                    small = i;
                break;
            }
            }
           }
          
           if(small==-1)
           {
             //  System.out.println("small was not there");
              for(i=l-2;i>=0;i--)
              {
                  int  ch = line.charAt(i);
            ch = ch-'0';
            if(ch%2==0){
                small = i;
                break;
            }
              }
           }
           for(i=0;i<small;i++)
           bf.append(line.charAt(i));
           bf.append(line.charAt(l-1));
           for(i=small+1;i<l-1;i++)
           bf.append(line.charAt(i));
           bf.append(line.charAt(small));
           System.out.println(bf.toString());
          
           
        }
     
        }
    
}
class SegmentTree{
    int[] a;
    int[] tr;
    int n;
    public SegmentTree(int[] b)
    {
        n = b.length;
        a = new int[n];
        tr =new  int[4*n + 5];
        int i;
        for(i=0;i<n;i++)
        a[i] = b[i];
        build(1,0,n-1);
    }
    public void build(int v,int l,int r)
    {
        if(l==r)tr[v] = a[l];
        else {
            int mid = (l+r)/2;
            build(2*v, l,mid);
            build(2*v+1, mid+1,r);
            tr[v] = Math.max(tr[2*v], tr[2*v+1]);
        }
    }
    public int query(int v, int lo, int hi, int l, int r)
    {
        if(hi<0)return -1;
        if(lo<0)return -1;
        if(hi >=n)return -1;
        if(lo > hi)return -1;
        
        if(lo==l && hi==r)return tr[v];
        
        int mid = (l+r)/2;
        
        int first = query(2*v, lo, Math.min(hi,mid), l, mid);
        int second = query(2*v+1, Math.max(lo,mid+1), hi, mid+1,r);
        return Math.max(first,second);
    }
}
class ut implements Comparator<Team>{
    public int compare(Team first, Team other)
    {
          if(first.pr > other.pr)return -1;
        if(first.pr < other.pr)return 1;
        if(first.ti < other.ti)return -1;
        if(first.ti > other.ti)return 1;
        if(first.in < other.in)return -1;
        if(first.in > other.in)return 1;
        return 0;
    }
}
class Team implements Comparable{
    int pr,ti,in;
    public Team(int a, int b, int c)
    {
        pr = a;
        ti = b;
        in = c;
    }
    public String toString()
    {
        return pr + " " + ti + " " + in+ "\n";
    }
    public int compareTo(Object obj)
    {
        Team other = (Team)obj;
        if(pr > other.pr)return -1;
        if(pr < other.pr)return 1;
        if(ti < other.ti)return -1;
        if(ti > other.ti)return 1;
        if(in < other.in)return -1;
        if(in > other.in)return 1;
        return 0;
    }
}