inf = open("lucky.in", "r")
ouf = open("lucky.out", "w")

n = long(inf.readline().strip()) + 1
s = '0' + str(n)
l = len(s)

d = []
for i in range(0, l):
	d.append(int(n % 10))
	n /= 10

finished = False
while not finished:
	needInc = False
	sum = [0, 0]

	for i in range(0, l):
		sum[i % 2] += d[i]

	for i in range(0, l):
		this = i % 2
		that = 1 - i % 2
		if sum[this] > sum[that]:
			delta = min(sum[this] - sum[that], d[i])
			needInc = needInc or (delta != 0)
			d[i] -= delta
			sum[this] -= delta
		elif sum[that] > sum[this]:
			delta = min(sum[that] - sum[this], 9 - d[i])
			needInc = needInc and (delta == 0)
			d[i] += delta
			sum[this] += delta
		elif needInc:
			delta = min(1, 9 - d[i])
			if delta > 0:
				d[i] += delta
				for j in range(0, i):
					d[j] = 0
				break
   		else:
   			finished = True
   			break

while d[l - 1] == 0:
	l -= 1

ouf.write(reduce(lambda s, t: str(s) + str(d[t]), [""] + range(l - 1, -1, -1)))
ouf.write("\n")

inf.close()
ouf.close()
