import sys

import numpy as np

a=[int(x)for x in list(sys.stdin.readline()[0:3])]+[-1]

print((str(a[0]+(1if(np.trim_zeros(np.diff(a))[0]>0)else 0))*3))

import sys

import numpy as np

a=[int(x)for x in list(sys.stdin.readline()[:3])]+[0]

print(((a[0]+(1if(np.trim_zeros(np.diff(a))[0]>0)else 0))*111))

import sys
import numpy as np

a = [int(x) for x in list(sys.stdin.readline()[0:3])] + [-1]
print((str(a[0] + (1 if (np.trim_zeros(np.diff(a))[0] > 0) else 0)) * 3))

import sys
import numpy as np

a = [int(x) for x in list(sys.stdin.readline()[:3])] + [0]
print(((a[0] + (1 if (np.trim_zeros(np.diff(a))[0] > 0) else 0)) * 111))

-a = [int(x) for x in list(sys.stdin.readline()[0:3])] + [-1] -print((str(a[0] + (1 if (np.trim_zeros(np.diff(a))[0] > 0) else 0)) * 3)) +a = [int(x) for x in list(sys.stdin.readline()[:3])] + [0] +print(((a[0] + (1 if (np.trim_zeros(np.diff(a))[0] > 0) else 0)) * 111))