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 CPP):

Solution:
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:268435456")
using namespace std;
template <typename T>
inline T abs(T a) {
  return ((a < 0) ? -a : a);
}
template <typename T>
inline T sqr(T a) {
  return a * a;
}
template <class T>
T gcd(T a, T b) {
  return a ? gcd(b % a, a) : b;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
T sign(T a) {
  return a > 0 ? 1 : (a < 0 ? -1 : 0);
}
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
const int dxK[] = {-1, -1, 0, 1, 1, 1, 0, -1};
const int dyK[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dxKn[] = {-2, -1, 1, 2, 2, 1, -1, -2};
const int dyKn[] = {1, 2, 2, 1, -1, -2, -2, -1};
const int N = int(1e6) + 9;
const int M = int(2e2) + 9;
const int LOGN = 22;
const int SQN = 350;
const int MOD = int(1e9) + 7;
const int INF = 1e9 + 100;
const long long INF64 = 2e18;
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-9;
int n;
int dd;
string s;
int a[N];
int dp[N][2][2];
pair<int, int> p[N][2][2];
pair<int, int> to[N][2][2];
int go(int len, bool mustl, bool dr) {
  int &res = dp[len][mustl][dr];
  if (res != -1) return res;
  res = 0;
  int l = len, r = n - dd - len;
  if (l > r) return res = 1;
  if (l == r) {
    for (int i = 0; i < (int)(10); ++i) {
      if ((i + i + dr) % 10 == a[l])
        if ((i + i + dr) / 10 == mustl) {
          to[len][mustl][dr] = make_pair(i, i);
          return res = 1;
        }
    }
    return res;
  }
  for (int i = 0; i < (int)(10); ++i)
    for (int j = 0; j < (int)(10); ++j)
      for (int nmustl = 0; nmustl < (int)(2); ++nmustl) {
        if (len + i == 0) continue;
        bool ndr = ((i + j + dr) / 10) > 0;
        if ((i + j + dr) % 10 != a[r]) continue;
        if ((i + j + nmustl) % 10 != a[l]) continue;
        if ((i + j + nmustl) / 10 != mustl) continue;
        if (l == r - 1 && nmustl != ndr) continue;
        if (go(len + 1, nmustl, ndr)) {
          p[len][mustl][dr] = make_pair(nmustl, ndr);
          to[len][mustl][dr] = make_pair(i, j);
          return res = 1;
        }
      }
  return res;
}
void solve() {
  cin >> s;
  n = (int)(s.size());
  for (int i = 0; i < (int)(n); ++i) a[i] = s[i] - '0';
  memset(dp, -1, sizeof dp);
  dd = 1;
  go(0, 0, 0);
  if (dp[0][0][0] == 1) {
    pair<int, int> cur = make_pair(0, 0);
    int pos = 0, l = 0, r = n - 1;
    while (l <= r) {
      pair<int, int> ncur = p[pos][cur.first][cur.second];
      a[l] = to[pos][cur.first][cur.second].first,
      a[r] = to[pos][cur.first][cur.second].second;
      ++l, --r, ++pos;
      cur = ncur;
    }
    for (int i = 0; i < (int)(n); ++i) cout << a[i];
    return;
  }
  memset(dp, -1, sizeof dp);
  dd = 0;
  go(1, 1, 0);
  if (a[0] == 1 && n > 1 && dp[1][1][0] == 1) {
    pair<int, int> cur = make_pair(1, 0);
    int pos = 1, l = 1, r = n - 1;
    while (l <= r) {
      pair<int, int> ncur = p[pos][cur.first][cur.second];
      a[l] = to[pos][cur.first][cur.second].first,
      a[r] = to[pos][cur.first][cur.second].second;
      ++l, --r, ++pos;
      cur = ncur;
    }
    for (int i = 1; i < (int)(n); ++i) cout << a[i];
    return;
  }
  cout << 0;
}
int main() {
  srand(time(NULL));
  srand(time(NULL));
  cout << setprecision(10) << fixed;
  cerr << setprecision(10) << fixed;
  solve();
  return 0;
}