n = eval(input())

for i in range(1,10):

    N = str(i) + str(i) + str(i)

    if n <= N:

        print(N)

        break
# coding: utf-8

# Your code here!



N = eval(input())

if N[0]==N[1]==N[2]:

    print(N)

else:

    if int(N) <int(N[0]*3):

        print((int(N[0]*3)))

    else:

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

        

n = eval(input())
for i in range(1, 10):
    N = str(i) + str(i) + str(i)
    if n <= N:
        print(N)
        break

# coding: utf-8
# Your code here!
N = eval(input())
if N[0] == N[1] == N[2]:
    print(N)
else:
    if int(N) < int(N[0] * 3):
        print((int(N[0] * 3)))
    else:
        print((str((int(N[0]) + 1)) * 3))

-n = eval(input()) -for i in range(1, 10): -    N = str(i) + str(i) + str(i) -    if n <= N: -        print(N) -        break +# coding: utf-8 +# Your code here! +N = eval(input()) +if N[0] == N[1] == N[2]: +    print(N) +else: +    if int(N) < int(N[0] * 3): +        print((int(N[0] * 3))) +    else: +        print((str((int(N[0]) + 1)) * 3))