n = eval(input())

if int(n) > int(n[0] * 3):

    print((str(int(n[0]) + 1) * 3))

else:

    print((n[0] * 3))

n = int(eval(input()))

n = (n + 110) // 111 * 111

print(n)

n = eval(input())
if int(n) > int(n[0] * 3):
    print((str(int(n[0]) + 1) * 3))
else:
    print((n[0] * 3))

n = int(eval(input()))
n = (n + 110) // 111 * 111
print(n)

-n = eval(input()) -if int(n) > int(n[0] * 3): -    print((str(int(n[0]) + 1) * 3)) -else: -    print((n[0] * 3)) +n = int(eval(input())) +n = (n + 110) // 111 * 111 +print(n)