#include <cstdio>
#include <cstring>
#include <cassert>

#define forn(i, n) for (int i = 0; i < (int)(n); i++)

#define m 100010

int a[m], n;
char s[m];

int main()
{
  freopen("lucky.in", "r", stdin);
  freopen("lucky.out", "w", stdout);
  scanf("%s", s);
  n = strlen(s);
  assert(1 <= n && n <= 100);
  assert(s[0] != '0');
  forn (i, n)
  {
    assert('0' <= s[i] && s[i] <= '9');
    a[i + 1] = s[i] - '0';
  }
  a[0] = 0;
  while (true)
  {
    a[n]++;
    for (int i = n; i >= 1; i--)
      if (a[i] >= 10)
        a[i] -= 10, a[i - 1]++;
    int s1 = 0, s2 = 0;
    forn (i, n + 1)
      if (i & 1)
        s1 += a[i];
      else
        s2 += a[i];
    if (s1 == s2)
    {
      if (a[0] != 0)
        putc(a[0] + '0', stdout);
      forn (i, n)
        putc(a[i + 1] + '0', stdout);
      puts("");
      return 0;
    }
  }
  return 0;
}
