# ABC 111: B – AtCoder Beginner Contest 111

n = int(eval(input()))

i = n // 111



if n % 111 != 0:

    i += 1



print((i * 111))
# ABC 111: B – AtCoder Beginner Contest 111

n = eval(input())



n = '10' if len(n) == 1 else n



while len(set(n)) != 1:

    n = str(int(n) + 1)



print(n)
# ABC 111: B – AtCoder Beginner Contest 111
n = int(eval(input()))
i = n // 111
if n % 111 != 0:
    i += 1
print((i * 111))

# ABC 111: B – AtCoder Beginner Contest 111
n = eval(input())
n = "10" if len(n) == 1 else n
while len(set(n)) != 1:
    n = str(int(n) + 1)
print(n)

-n = int(eval(input())) -i = n // 111 -if n % 111 != 0: -    i += 1 -print((i * 111)) +n = eval(input()) +n = "10" if len(n) == 1 else n +while len(set(n)) != 1: +    n = str(int(n) + 1) +print(n)