Problem:
 Score : 200 points    Problem Statement Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N -th ABC ever held).
Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?      Constraints  100 \leq N \leq 999  N is an integer.         Input Input is given from Standard Input in the following format:  N       Output If the earliest ABC where Kurohashi can make his debut is ABC n , print n .        Sample Input 1 111      Sample Output 1 111  The next ABC to be held is ABC 111 , where Kurohashi can make his debut.       Sample Input 2 112      Sample Output 2 222  The next ABC to be held is ABC 112 , which means Kurohashi can no longer participate in ABC 111 .
Among the ABCs where Kurohashi can make his debut, the earliest one is ABC 222 .       Sample Input 3 750      Sample Output 3 777

Solution (Python):
n = int(input())

for i in range(111, 1000, 111):
    if i >= n:
        print(i)
        exit(0)

Solution (Python):
N = int(input())
if 100 <= N <= 111:
    ans = 111
elif 112 <= N <= 222:
    ans = 222
elif 223 <= N <= 333:
    ans = 333
elif 334 <= N <= 444:
    ans = 444
elif 445 <= N <= 555:
    ans = 555
elif 556 <= N <= 666:
    ans = 666
elif 667 <= N <= 777:
    ans = 777
elif 778 <= N <= 888:
    ans = 888
elif 889 <= N <= 999:
    ans = 999
print(ans)

Solution (Python):
n = int(input())
li = [111, 222, 333, 444, 555, 666, 777, 888, 999]
for i in range(len(li)):
    if n <= li[i]:
        break;
print(li[i])

Solution (Python):
N = int(input())

z = N / 111

if N % 111 == 0:
    print(N)
else:
    print((int(N/111) + 1) * 111)

Solution (Python):
n = int(input())

if (n % 111)==0:
    print(n)
else:
    print(((n // 111) +1)*111)

Solution (Python):
num = input()

ans_num = int(num[0])

if int(num[1]) > ans_num or int(num[2]) > ans_num:
    ans_num += 1

print(ans_num * 100 + ans_num * 10 + ans_num)

Solution (Python):


n = int(input())
a = 0
if n <= 111:
    a = 111
elif n <= 222:
    a = 222
elif n <= 333:
    a = 333
elif n <= 444:
    a = 444
elif n <= 555:
    a = 555
elif n <= 666:
    a = 666
elif n <= 777:
    a = 777
elif n <= 888:
    a = 888
elif n <= 999:
    a = 999
print(a)

Solution (Python):
N=int(input())

if N<=111:
    ans=111
elif N<=222:
    ans=222
elif N<=333:
    ans=333
elif N<=444:
    ans=444
elif N<=555:
    ans=555
elif N<=666:
    ans=666
elif N<=777:
    ans=777
elif N<=888:
    ans=888
else:
    ans=999

print(ans)

Solution (Python):
n=int(input())

a=n//100
b=(n-a*100)//10
c=n%10

if a==b and b==c:
    print(n)
else:   
    if n<a*100+a*10+a:
        print(a*100+a*10+a)
    else:
        a=a+1
        print(a*100+a*10+a)

Solution (Python):
N=int(input())
x=N//100
if(100*x+10*x+x<N):
    print(100*(x+1)+10*(x+1)+x+1)
else:
    print(100*x+10*x+x)

Solution (Python):
n = int(input())

l = [111 * i for i in range(1, 10)]

for num in l:
    if n > num:
        continue
    else:
        ans = num
        break
print(ans)

Solution (Python):
if __name__ == '__main__' :
    A = [111,222,333,444,555,666,777,888,999]
    n = int(input())

    for i,a in enumerate(A):
        if n <= a:
            print(A[i])
            exit()

Solution (Python):
n = int(input())
if n <= int(str(n)[:1])*111:
  print(int(str(n)[:1])*111)
else:
  print((int(str(n)[:1])+1)*111)

Solution (Python):
N = int(input())
L = [111,222,333,444,555,666,777,888,999,1111]
for i in range(len(L)) :
    if L[i] == N :
        print(N)
        break
    elif L[i] < N < L[i+1] :
        print(L[i+1])
        break
    elif N < 111 :
        print(111)
        break

Solution (Python):
n = int(input())
n = (n-1)//111
if n == 0:
    print(111)
elif n == 1:
    print(222)
elif n == 2:
    print(333)
elif n == 3:
    print(444)
elif n == 4:
    print(555)
elif n == 5:
    print(666)
elif n == 6:
    print(777)
elif n == 7:
    print(888)
elif n == 8:
    print(999)
elif n == 9:
    print(1111)

Solution (Python):
n=int(input())

for i in range(10):
    x=i*100+i*10+i
    if n > x-111 and n <= x:
        print(x)

Solution (Python):
n = int(input())
while True:
    if str(n)[0:1] ==str(n)[1:2] == str(n)[2:3]:
        print(n)
        break
    else:
        n += 1

Solution (Python):
N = int(input())

if N <= 111:
    ans = 111
elif 111 < N <= 222:
    ans = 222
elif 222 < N <= 333:
    ans = 333
elif 333 < N <= 444:
    ans = 444
elif 444 < N <= 555:
    ans = 555
elif 555 < N <= 666:
    ans = 666
elif 666 < N <= 777:
    ans = 777
elif 777 < N <= 888:
    ans = 888
elif 888 < N <= 999:
    ans = 999

print(ans)

Solution (Python):
import numpy as np

N = int(input())
for i in range(1, 10):
    ii = i*111
    if ii >= N:
        print(ii)
        break

Solution (Python):


n = int(input())

if n <= 111:
    print('111')
elif n <= 222:
    print('222')
elif n <= 333:
    print('333')
elif n <= 444:
    print('444')
elif n <= 555:
    print('555')
elif n <= 666:
    print('666')
elif n <= 777:
    print('777')
elif n <= 888:
    print('888')
else:
    print('999')

Solution (Python):
N = int(input())

def check(n):
    s = str(n)
    return (s[0] == s[1]) and (s[1] == s[2])

while True:
    if check(N):
        print(N)
        break
    N += 1

Solution (Python):
n = int(input())

l = [111, 222, 333, 444, 555, 666, 777, 888, 999]
i = 0
while n > l[i]: i += 1

print(l[i])

Solution (Python):
import numpy as np
import math







sN = input()
N = int(sN)
arN = list(map(int, sN))

def match(p):
    arP = list(map(int, str(p)))
    return arP[0] == arP[1] and arP[1] == arP[2]

if N <= 111:
    print(111)
    exit(0)

while not match(N):
    N = N + 1
    
    

print(N)

Solution (Python):


N = int(input())

for i in range(1, 10, 1):
    if(N <= 111 * i):
        print(111 * i)
        break

Solution (Python):

n = int(input())
while True:
    if n % 111 == 0:break
    n += 1
print(n)

Solution (Python):
N = input()
n = N / 100
next_n = 0
if N <= n * 100 + n * 10 + n:
	next_n = n
else:
	next_n = n + 1

print next_n * 100 + next_n * 10 + next_n

Solution (Python):
import sys
input = sys.stdin.readline

n = int(input())
hyaku = n//100
answer = 0
if n > (hyaku*100 + hyaku*10 +hyaku):
	hyaku += 1

print(hyaku*100 + hyaku*10 +hyaku)

Solution (Python):
N=int(input())
if(N<=111):
  print(111)
elif(111<N<=222):
  print(222)
elif(222<N<=333):
  print(333)
elif(333<N<=444):
  print(444)
elif(444<N<=555):
  print(555)
elif(555<N<=666):
  print(666)
elif(666<N<=777):
  print(777)
elif(777<N<=888):
  print(888)
elif(888<N<=999):
  print(999)

Solution (Python):
n = int(input())

print(((n - 1) // 111 + 1) * 111)

Solution (Python):
n = input()

n1 = int(n[0])
n2 = int(n[1])

keta = n1

for s in n:
    if int(s) > n1:
        keta = n1 + 1
        break

print(str(keta) * len(n))

Solution (Python):
n = input()

for i in range(1,10):
    if str(i)*3 >= n:
        print(str(i)*3)
        break

Solution (Python):
N = int(input())

def solve(N):
    for d in range(1, 10):
        x = int(str(d) * 3)
        if N <= x:
            return x

print(solve(N))

Solution (Python):
n = int(input())
if n <= 111:
    print(111)
elif n<=222:
    print(222)
elif n<=333:
    print(333)
elif n<=444:
    print(444)
elif n<=555:
    print(555)
elif n<=666:
    print(666)
elif n<=777:
    print(777)
elif n<=888:
    print(888)
else:
    print(999)

Solution (Python):
import sys
Input = sys.stdin.readline

N = int(Input())

for n in range(N, 999+1):
    s = str(n)
    if all(map(lambda c: c == s[0], s[1:])):
        print(n)
        break

Solution (Python):
N = int(input())
p = N // 111
q = N % 111
if q == 0:
  x = N
else:
  x = (p+1) * 111
print(x)

Solution (Python):
if __name__ == '__main__':
    n = input()
    h = int(n[0])
    if int(10*h+h) < int(n[1:]):
        print(100*(h+1)+10*(h+1)+(h+1))
    else:
        print(100*h+10*h+h)

Solution (Python):
N = int(input())

lis = [ i for i in range(111,1000,111)]

j = 0
for i in lis:
    if N <= i:
        print(lis[j])
        exit()
    j += 1

Solution (Python):
n = int(input())
listN = list(str(n))

if listN[0]==listN[1] and listN[1] ==listN[2]:
    print(n)
else:
    if listN[0] > listN[1]:
        print(listN[0]+listN[0]+listN[0])
    elif listN[0] == listN[1] and listN[1] > listN[2]:
        print(listN[0]+listN[0]+listN[0])
    else:
        number = str(int(listN[0])+1)
        print(number+number+number)

Solution (Python):
N = int(input())
if N % 111 == 0:
    print(N)
else:
    q = N // 111
    ans = 111 * (q + 1)
    print(ans)

Solution (Python):
import math
print(111 * math.ceil(int(input()) / 111))

Solution (Python):
N = int(input())

if N % 111 == 0:
  print(N)
  
else:
  print((N //111 +1) *111)

Solution (Python):
N = int(input())
output = ""

for i in range(1, 10):
  x = i*100 + i*10 + i
  if N <= x:
    print(x)
    break

Solution (Python):
n=int(input())
nn=n//100
if nn*100+nn*10+nn>=n:
    print(nn*100+nn*10+nn)
else:
    print((nn+1)*100+(nn+1)*10+nn+1)

Solution (Python):
n = int(input())
a = [i for i in range(111, 1000, 111)]
for i in a:
    if n <= i:
        print(i)
        break

Solution (Python):

def main():
    n = int(input())

    if n > int(str(n//100)*3):
        print(int(str(n//100+1)*3))
    else:
        print(int(str(n//100)*3))



if __name__ == "__main__":
        main()

Solution (Python):
n = int(input())
a = [111,222,333,444,555,666,777,888,999]
while True:
    if a[0] < n:
        a.pop(0)
    else:
        break
print(a[0])

Solution (Python):
n = int(input())
arr = [111,222,333,444,555,666,777,888,999]
for i in arr:
    if n <= i:
        print(i)
        break

Solution (Python):
A=int(input())
for i in range(100,1000):
    
    
    if (str(i)[0] == str(i)[1]) and (str(i)[1] == str(i)[2]) and (i >= A):
        print(i)
        break

Solution (Python):
N=int(input())
if N>N//100*111:
    print((N//100+1)*111)
else: print(N//100*111)

Solution (Python):
N = int(input())
A = N // 100
S = 100 * A + 10 * A + A
T = 100 * (A + 1) + 10 * (A + 1) + (A + 1)
if N <= S:
    print(S)
else:
    print(T)

Solution (Python):
question="B"
input=raw_input
if question=="A":
	t=input()
	t=t.replace("9","n")
	t=t.replace("1","o")
	t=t.replace("n","1")
	t=t.replace("o","9")
	print(t)
if question=="B":
	s=int(input())
	t=[111,222,333,444,555,666,777,888,999]
	t=filter(lambda x:x>=s,t)[0]
	print(t)
if question=="C":
	pass
if question=="D":
	pass
if question=="E":
	pass

Solution (Python):
n = int(input())
li = [111, 222, 333, 444, 555, 666, 777, 888]
end = False
for x in li:
  if n <= x:
    print(x)
    end = True
    break
if not end:
  print(999)

Solution (Python):
N = int(input())
cands = [111*i for i in range(1, 10)] + [1111]
cands = [c for c in cands if c >= N]

print(min(cands))

Solution (Python):
n = input()
out = int(n[0]*3)
N = int(n)

if out < N:
    out += 111

print(out)

Solution (Python):
N = int(input())

for i in range(N,1000):
    if i % 111 == 0:
        print(i)
        break

Solution (Python):
def repdigit(n):
    s = str(n)
    a = s[0]
    for c in s:
        if c != a:
            return False
    return True
N = int(input())

while not repdigit(N):
    N += 1
print(N)

Solution (Python):
N=int(input())
if N<=111:
	print('111')
elif N<=222:
	print('222')
elif N<=333:
	print('333')
elif N<=444:
	print('444')
elif N<=555:
	print('555')
elif N<=666:
	print('666')
elif N<=777:
	print('777')
elif N<=888:
	print('888')
else:
	print('999')

Solution (Python):
N = int(input())
C = [i * 111 for i in range(1, 10)]
R = min([n for n in C if n >= N])
print(R)

Solution (Python):
import math

n=int(input())

k=111

nex=math.ceil(n/k)

print(nex*111)

Solution (Python):
N = int(input())

if N <= 111:
    print(111)
elif 111 < N <= 222:
    print(222)
elif 222 < N <= 333:
    print(333)
elif 333 < N <= 444:
    print(444)
elif 444 < N <= 555:
    print(555)
elif 555 < N <= 666:
    print(666)
elif 666 < N <= 777:
    print(777)
elif 777 < N <= 888:
    print(888)
elif 888 < N <= 999:
    print(999)

Solution (Python):
N = int(input())
ans = -1
for i in range(1,10):
    if i*111 >= N:
        ans = i * 111
        break
print(ans)

Solution (Python):
N=input().strip()
nn=int(N[0])
if int(N[0]*3)>=int(N):
    print(N[0]*3)
else:
    print(str(nn+1)*3)

Solution (Python):

def solve():
    N = int(input())
    for i in range(1, 10):
        if 111*i >= N:
            res = 111*i
            break
    return str(res)

if __name__ == '__main__':
    print(solve())

Solution (Python):
n = int(input())
if n % 111 == 0:
    ind = n // 111
else:
    ind = n // 111 + 1
print(str(ind)*3)

Solution (Python):
N = int(input())


while(True):
    Ns = str(N)

    if(Ns[0] == Ns[1] and Ns[1] == Ns[2]):
        break
    N += 1

print(N)

Solution (Python):
n = input()
if int(n[0]) == int(n[1]) == int(n[2]):
    print(n)
elif int(n[0] * 3) > int(n):
    print(n[0] * 3)
else:
    print(str(int(n[0]) + 1) * 3)

Solution (Python):

N = int(input())

for i in range(1, 10):
    krhs = i * 111
    if N <= krhs: break

print(krhs)

Solution (Python):
n = int(input())
list = [111,222,333,444,555,666,777,888,999]

for x in list:
    if x >= n:
        print(x)
        break

Solution (Python):
n = int(input())

ns = [111,222,333,444,555,666,777,888,999]

for nn in ns:
    if n <= nn:
        print(nn)
        break

Solution (Python):
N = int(input())
l = [111 * i for i in range(1, 10)]


def f():
    for num in l:
        if N <= num:
            print(num)
            return

f()

Solution (Python):
N = int(input())
flag = False
for i in range(1,10):
  if (N <= 111*i):
    flag = True
    break
if flag:
  print(111*i)

Solution (Python):
N = int(input())

thresholds = [111, 222, 333, 444, 555, 666, 777, 888, 999]
for threshold in thresholds:
    if N <= threshold:
        print(threshold)
        break

Solution (Python):
def main():
    N = int(input())

    for i in range(N, 999+1):
        if len(set(list(str(i)))) == 1:
            print(i)
            return


if __name__ == '__main__':
    main()

Solution (Python):
inp = list(map(int, list(input())))
if inp[0] < inp[1] or (inp[0] == inp[1] and inp[1] < inp[2]):
    for i in range(3):
        print(inp[0] + 1, end="")
    print()
else:
    for i in range(3):
        print(inp[0], end="")
    print()

Solution (Python):
nl = list(input())
n = int(nl[0])*100 + int(nl[1])*10 + int(nl[2])
ans = 111
while ans < n:
    ans += 111
print(ans)

Solution (Python):
n = int(input())

if n <= 111:
    print("111")
elif n <= 222:
    print("222")
elif n <= 333:
    print("333")
elif n <= 444:
    print("444")
elif n <= 555:
    print("555")
elif n <= 666:
    print("666")
elif n <= 777:
    print("777")
elif n <= 888:
    print("888")
elif n <= 999:
    print("999")

Solution (Python):
from collections import Counter
n=int(input())
s=str(n)
while(True):
    s=str(n)
    co=Counter(s)
    if(len(list(co.keys()))==1):
        print(n)
        exit()
    else:
        n+=1

Solution (Python):
N = int(input())
def check():
    for i in range(N,1112):
        if len(set(list(str(i)))) == 1:
            return i
print(check())

Solution (Python):
N = int(input())

if N <= 111:
    print(111)
elif N <= 222:
    print(222)
elif N<= 333:
    print(333)
elif N <= 444:
    print(444)
elif N <= 555:
    print(555)
elif N <= 666:
    print(666)
elif N <= 777:
    print(777)
elif N <= 888:
    print(888)
elif N <= 999:
    print(999)

Solution (Python):

n=int(input())
if n <= 111:
    print(111)
elif n <= 222:
    print(222)
elif n <= 333:
    print(333)
elif n <= 444:
    print(444)
elif n <= 555:
    print(555)
elif n <= 666:
    print(666)
elif n <= 777:
    print(777)
elif n <= 888:
    print(888)
elif n <= 999:
    print(999)

Solution (Python):
N = int(input())
import collections
for x in range(N, 5000):
    c = collections.Counter(str(x))
    if len(c.keys()) == 1:
        print(x)
        break

Solution (Python):
N = int(input())

def f(x):
    s = str(x)
    return s[0] == s[1] == s[2]

while not f(N):
    N += 1
print(N)

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    for i in range(n, 1000):
        if i % 111 == 0:
            print(i)
            quit(0)

Solution (Python):

n = raw_input()
x = n[0]
s = ''
for i in xrange(len(n)):
    s += x 
if int(s) >= int(n):
    print s
else:
    s = ''
    for i in xrange(len(n)):
        s += str(int(n[0])+1)
    print s

Solution (Python):
a = int(input())

for x in range(a,1000):
    if x%111 == 0:
        print(x)
        break

Solution (Python):
n = int(input())
while True:
    if n % 111 == 0:
        break
    else:
        n += 1
print(n)

Solution (Python):
S = input()
T = set(list(k for k in S))
if len(T) == 1:
    print(S)
    exit(0)
N = int(S)
while True:
    N += 1
    if N%111==0:
        print(N)
        exit(0)

Solution (Python):
n = int(input())
for i in range(1000):
    if len(set(list(str(i+n)))) == 1:
        print(i+n)
        break

Solution (Python):
n=int(input())
for i in range(1,10):
    if n<=i*111:
        print(i*111)
        break

Solution (Python):
N = int(input())
if N%111:
    ans = ((N//111)+1)*111
else:
    ans = N
print(ans)

Solution (Python):
str = input()

head = str[0]

zoro = int(head+head+head)

if(int(str) <= zoro):
    print(zoro)
else:
    print(zoro+111)

Solution (Python):
from bisect import bisect_left
n=int(input())
l=[111*i for i in range(1,10)]
print(l[bisect_left(l,n)])

Solution (Python):
N=int(input())
a=[]
for i in range(111,1000,111):
    a.append(i)
for i in range(10):
    if N<=a[i]:
        print(a[i])
        break

Solution (Python):
N = int(input())

for i in range(1, 10):
    num = int(str(i)*3)
    if num >= N:
        print(num)
        raise SystemExit

Solution (Python):


current = int(input())

while True:
    digits = set(str(current))
    if len(digits) == 1:
        print(current)
        break
    current += 1

Solution (Python):
N = int(input())

for i in range(1,10):
  if N <= i * 111:
    print(i * 111)
    exit(0)

Solution (Python):


INF = float('inf')


def inpl(): return list(map(int, input().split()))


N = int(input())

for i in range(1, 10):
    tmp = int(str(i)*3)
    if N <= tmp:
        print(tmp)
        break

Solution (Python):
a = int(input())

d = a//111
f = a%111
if f>0:
    print((d+1)*111)
else:
    print(d*111)

Solution (Python):
n = int(input())

while True:
    s = str(n)

    if s[0] == s[1] == s[2]:
        print(s)
        break
    
    n += 1

Solution (Python):

import math,string,itertools,fractions,heapq,collections,re,array,bisect

N = int(input())
li = [111,222,333,444,555,666,777,888,999]

for ans in li:
    if N <= ans:
        print(ans)
        exit()

Solution (Python):
N=int(input())
for i in range(9):
    if 111*(1+i)-N>=0:
        print(111*(1+i))
        break

Solution (Python):
n = int(input())

if n <= 111:
    print("111")

elif n <= 222:
    print("222")

elif n <= 333:
    print("333")

elif n <= 444:
    print("444")

elif n <= 555:
    print("555")

elif n <= 666:
    print("666")

elif n <= 777:
    print("777")

elif n <= 888:
    print("888")

else:
    print("999")

Solution (Python):
N = int(input())
for i in range(N, 1000):
    if len(list(set(str(i)))) == 1:
        print(i)
        break

Solution (Python):




def main():
    n = int(input())

    for i in range(10):
        if n <= i * 100 + i * 10 + i:
            print(i * 100 + i * 10 + i)
            exit()


if __name__ == '__main__':
    main()

Solution (Python):
a=int(input())
for i in range(1,10):
    b=i*111
    if a<=b:
        print(b)
        exit()

Solution (Python):
n = int(input())
a = 111 * ((n-1)//111+1)
print(a)

Solution (Python):
n = int(input())
ans = 111
while ans < n:
  ans += 111
print(ans)

Solution (Python):
a = int(input())
print(111 * ((a - 1) // 111 + 1))

Solution (Python):


def main():
    n = int(input())
    for i in range(n, 1000):
        s = str(i)
        if s[0] == s[1] and s[1] == s[2]:
            print(i)
            break
    
if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())

ans = n
while True:
    if len(set(str(ans))) == 1:
        break
    else:
        ans += 1
print(ans)

Solution (Python):
def solve(N):
    for i in range(N, 1000):
        if str(i)[2] == str(i)[1] == str(i)[0]:
            return i

if __name__ == "__main__":
    l = input()
    print(solve(int(l)))

Solution (Python):
N = int(input())
i = 0
while True:
    if (N + i)%111 == 0:
        print(N + i)
        break
    else:
        i += 1

Solution (Python):
t = 111
n = int(input())
while t < n:
    t += 111
print(t)

Solution (Python):
N = int(input())

for i in range(N, 1000):
    if i%111 == 0:
        res = i
        break
print(res)

Solution (Python):
n = int(input())
print(111 * (int((n-1)/111)+1))

Solution (Python):
s=input()
for i in range(int(s),1000):
    t=str(i)
    if t[0]==t[1] and t[1]==t[2]:
        print(t)
        break

Solution (Python):
N = int(input())
for i in range(N, 1000):
    n = str(i)
    if n[0] == n[1] and n[1] == n[2]:
        print(n)
        break

Solution (Python):
n = int(input())
m = int(n/100)
a = 100*m + 10*m + m
if(n <= a):
  print(a)
else:
  print(a + 111)

Solution (Python):
N=int(input())
A=[111 * i for i in range(1, 10)]
for a in A:
    if N <= a:
        print(a)
        exit()

Solution (Python):
n = int(input())

for i in range(111, 1000, 111):
    if i >= n:
        print(i)
        break

Solution (Python):
N = int(input())
r = N%111
if r == 0:
    print(N)
else:
    print(N+111-r)

Solution (Python):
N = int(input())
for i in range(N, 1000):
    if i % 111 == 0:
        print(i)
        exit(0)

Solution (Python):
array = [111,222,333,444,555,666,777,888,999]
n = int(input())
for i in array:
    if n <= i:
        print(i)
        break

Solution (Python):
n = int(input())

if n%111 == 0:
    print(n)
else:
    print(111*(n//111+1))

Solution (Python):
N = int(input())
for i in range(N, 1000):
    a = str(i)
    if len(set(a)) == 1:
        print(i)
        break

Solution (Python):
a = int(input())
if a % 111 == 0:
    print(a)
else:
    temp = a // 111
    print((temp+1)*111)

Solution (Python):

def inputN(typ=str):
    return map(typ, raw_input().split())

N = inputN(int)[0]
print ((N - 1) / 111 + 1) * 111

Solution (Python):
import math
a = int(input())
b = math.ceil(a/111)
print (b*111)

Solution (Python):
num = int(input())

print(111*((num+110)//111))

Solution (Python):
n = int(input())
if n % 111 == 0:
    print(n)
else:
    print((n//111+1)*111)

Solution (Python):
n = int(input())

a = -(-n//111)

print(a*111)

Solution (Python):
N = int(input())

for x in range(N, 1000):
    if x % 111 == 0:
        print(x)
        exit()

Solution (Python):
n = int(input())
i = int(n / 111)
if n % 111 != 0:
    i += 1
print(i * 111)