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>
template <typename T>
using Vector2D = std::vector<std::vector<T>>;
template <typename T>
using Vector3D = std::vector<Vector2D<T>>;
using PairInt = std::pair<int, int>;
using PairInt64 = std::pair<int64_t, int64_t>;
using MapInt = std::map<int, int>;
using MMapInt = std::multimap<int, int>;
using MMapInt64 = std::multimap<int64_t, int64_t>;
using UMapIntString = std::unordered_map<int, std::string>;
using SetInt = std::set<int>;
using SetPairInt64 = std::set<PairInt64>;
using VectorInt = std::vector<int>;
using VectorInt2D = Vector2D<int>;
using VectorInt64 = std::vector<int64_t>;
using VectorUInt64 = std::vector<uint64_t>;
using VectorInt642D = Vector2D<int64_t>;
using VectorChar = std::vector<char>;
using VectorChar2D = Vector2D<char>;
using VectorString = std::vector<std::string>;
using QueuePairInt = std::queue<PairInt>;
using QueueInt = std::queue<int>;
using VectorPairInt = std::vector<PairInt>;
using VectorPairInt64 = std::vector<PairInt64>;
using VectorPairInt2D = Vector2D<PairInt>;
using SetInt = std::set<int>;
using MSetInt = std::multiset<int>;
using UMapChar = std::map<char, int>;
using ListInt = std::list<int>;
using VectorListInt = std::vector<ListInt>;
using VectorDouble = std::vector<double>;
const PairInt bad_digs = {-1, -1};
const auto s09 = VectorPairInt{{0, 0}, {1, 0}, {1, 1}, {3, 0}, {2, 2},
                               {5, 0}, {3, 3}, {7, 0}, {4, 4}, {9, 0}};
const auto s10 = VectorPairInt{{5, 5}, {9, 2}, {6, 6}, {9, 4}, {7, 7},
                               {9, 6}, {8, 8}, {9, 8}, {9, 9}, bad_digs};
PairInt check_digs(const VectorPairInt& s, int dback, int dfront, int& n,
                   int& p) {
  auto digs = s[dback];
  int digs_sum = digs.first + digs.second;
  if (digs_sum == dfront || digs_sum + 1 == dfront) {
    n = dfront - digs_sum;
    p = (digs_sum + p >= 10) ? 1 : 0;
  } else {
    digs = bad_digs;
  }
  return digs;
}
PairInt check_equal(const VectorPairInt& s, int dback, int dfront, int p) {
  auto digs = s[dback];
  auto digs_sum = digs.first + digs.second;
  if (digs_sum + p != dfront || digs.first != digs.second) {
    digs = bad_digs;
  }
  return digs;
}
bool next_step(const std::string& num, std::string& ans, int i, int j, int& n,
               int& p) {
  if (i > j) {
    return false;
  }
  int dback = num[j] - '0' - p;
  if (dback < 0) {
    dback = 9;
  }
  int dfront = n * 10 + (num[i] - '0');
  auto digs = bad_digs;
  if (i == j) {
    digs = check_equal(s09, dback, dfront, p);
    if (digs == bad_digs) {
      digs = check_equal(s10, dback, dfront, p);
    }
  } else {
    int lastn = n;
    int lastp = p;
    digs = check_digs(s09, dback, dfront, n, p);
    if (digs == bad_digs) {
      digs = check_digs(s10, dback, dfront, n, p);
    }
    if (digs != bad_digs && i + 1 == j) {
      int res = (num[j] - '0') + (num[i] - '0') * 10 + lastn * 100;
      int digs_sum = digs.first + digs.second;
      if (digs_sum + digs_sum * 10 + lastp != res) {
        digs = bad_digs;
      }
    }
  }
  if (digs == bad_digs) {
    ans = "0";
    return false;
  } else {
    ans[i] = digs.first + '0';
    ans[j] = digs.second + '0';
    return true;
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  std::string num;
  std::cin >> num;
  int sz = num.length();
  std::string ans(sz, '0');
  int n = 0;
  int p = 0;
  for (int i = 0, j = sz - 1; next_step(num, ans, i, j, n, p); ++i, --j)
    ;
  if (ans[0] == '0' && num[0] == '1' && sz > 1) {
    num.erase(0, 1);
    --sz;
    ans = std::string(sz, '0');
    n = 1;
    p = 0;
    for (int i = 0, j = sz - 1; next_step(num, ans, i, j, n, p); ++i, --j)
      ;
  }
  if (ans[0] == '0') {
    ans = "0";
  }
  std::cout << ans;
  return 0;
}