ZhenlongDai/ACPR huggingface dataset:
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
for n in range(n, 999):
    if len(set(list(str(n)))) == 1:
        print(n)
        exit()

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):

n = int(input())
for n in range(n, 999+1):
    if len(set(list(str(n)))) == 1:
        print(n)
        exit()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

for i in range(1,9):
    if n <= 111*i:
        print(111*i)

Failing test case input:
410

Expected output:
444


Actual output:
444
555
666
777
888


Fixed submission (verdict: Accepted):
n = int(input())

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

Problem: p03243
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
i = int(n / 111)
if n % 111 != 0:
    i += 1
    print(i)
print(i * 111)

Failing test case input:
528

Expected output:
555


Actual output:
5
555


Fixed submission (verdict: Accepted):
n = int(input())
i = int(n / 111)
if n % 111 != 0:
    i += 1
print(i * 111)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

flag = 0
for n in range(N, 999):
    if n % 111 == 0:
        print(n)
        break


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())

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

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=[int(str(i)*3)-n for i in range(1,10)]
print(a)
ans=[j for j in a if j>=0]
print(n+min(ans))

Failing test case input:
662

Expected output:
666


Actual output:
[-551, -440, -329, -218, -107, 4, 115, 226, 337]
666


Fixed submission (verdict: Accepted):
n=int(input())
a=[int(str(i)*3)-n for i in range(1,10)]
ans=[j for j in a if j>=0]
print(n+min(ans))

Problem: p03243
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
x = 111
while N < x:
    x += 111
print(x)

Failing test case input:
410

Expected output:
444


Actual output:
111


Fixed submission (verdict: Accepted):
N = int(input())
x = 111
while x < N:
    x += 111
print(x)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())

if 100<=n<=111:
            print(111)
a=0
for a in range(1,9):
            if 1+111*a<=n<=111*(a+1):
                        print(n)
                        print(111*(a+1))


Failing test case input:
543

Expected output:
555


Actual output:
543
555


Fixed submission (verdict: Accepted):
n=int(input())

if 100<=n<=111:
            print(111)
a=0
for a in range(1,9):
            if 1+111*a<=n<=111*(a+1):
                        
                        print(111*(a+1))

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
for i in range(n,999):
  if i%111 == 0:
    print(i)
    break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
for i in range(n,1000):
  if i%111 == 0:
    print(i)
    break
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
repdigit = [111, 222, 333, 444, 555, 666, 777, 888, 999]

for rep in repdigit:
    if N >= rep:
        print(rep)
        break

Failing test case input:
528

Expected output:
555


Actual output:
111


Fixed submission (verdict: Accepted):
N = int(input())
repdigit = [111, 222, 333, 444, 555, 666, 777, 888, 999]

for rep in repdigit:
    if N <= rep:
        print(rep)
        break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
for i in range(N, 999):
    a = str(i)
    if a[0] == a[1] and a[1] == a[2]:
        print(a)
        exit()

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
for i in range(N, 1000):
    a = str(i)
    if a[0] == a[1] and a[1] == a[2]:
        print(a)
        exit()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
if N % 111 == 0:
  print(N)
else:
  for i in range(N, 999):
    if i % 111 == 0:
      print(i)
      break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
if N % 111 == 0:
  print(N)
else:
  for i in range(N, 1000):
    if i % 111 == 0:
      print(i)
      break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
for i in range(111,999,111):
    if n <= i:
        print (i)
        break


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
for i in range(111,1000,111):
    if n <= i:
        print (i)
        break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
i=0
for i in range(8):
    if 111*i<N and N<111*(i+1):
        print(111*(i+1))
        break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N=int(input())
i=0
for i in range(9):
    if 111*i<N and N<=111*(i+1):
        print(111*(i+1))
        break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    N = input()
    hun = N[0]
    hikaku = int(hun + hun + hun)
    N = int(N)
    if(hikaku >= N):
        print(N)
        return 
    
    new_hun = str(int(hun) +1)
    print(new_hun + new_hun + new_hun)

if __name__ == "__main__":
    main()

Failing test case input:
410

Expected output:
444


Actual output:
410


Fixed submission (verdict: Accepted):
def main():
    N = input()
    hun = N[0]
    hikaku = int(hun + hun + hun)
    N = int(N)
    if(hikaku >= N):
        print(hun + hun + hun)
        return 
    
    new_hun = str(int(hun) +1)
    print(new_hun + new_hun + new_hun)

if __name__ == "__main__":
    main()
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
print(N[2])
if N[0]>N[1]:
    print(int(N[0]*3))

elif N[0] == N[1]:
    if N[1] == N[2]:
        print(int(N[0] * 3))
    elif N[1]>N[2]:
        print(int(N[0] * 3))
    else:
        print(str(int(N[0]) + 1) * 3)

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

Failing test case input:
543

Expected output:
555


Actual output:
3
555


Fixed submission (verdict: Accepted):
N = input()
if N[0]>N[1]:
    print(int(N[0]*3))

elif N[0] == N[1]:
    if N[1] == N[2]:
        print(int(N[0] * 3))
    elif N[1]>N[2]:
        print(int(N[0] * 3))
    else:
        print(str(int(N[0]) + 1) * 3)

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

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
for i in range(int(input()), 999):
  if(str(i)[0] == str(i)[1] and str(i)[1] == str(i)[2]):
    print(i)
    break


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
for i in range(int(input()), 1000):
  if(str(i)[0] == str(i)[1] and str(i)[1] == str(i)[2]):
    print(i)
    break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = str(input())

if int(n[0]) < int(n[1]):
	out = n[0]*3
elif int(n[1]) == int(n[2]):
  if int(n[1]) <= int(n[2]):
    out = n[0]*3
  else:
    out = str(int(n[0])+1)*3
else:
  out = str(int(n[0])+1)*3
    
print(out)

Failing test case input:
752

Expected output:
777


Actual output:
888


Fixed submission (verdict: Accepted):
n = str(input())

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

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
for i in range(1,9):
 if n <= (100*i + 10*i + i):
    print(100*i + 10*i + i)
    break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
for i in range(1,10):
 if n <= (100*i + 10*i + i):
    print(100*i + 10*i + i)
    break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
for i in range(int(input()), 100):
  if(str(i)[0] == str(i)[1] and str(i)[1] == str(i)[2]):
    print(i)
    break

Failing test case input:
625

Expected output:
666


Actual output:

Fixed submission (verdict: Accepted):
for i in range(int(input()), 1000):
  if(str(i)[0] == str(i)[1] and str(i)[1] == str(i)[2]):
    print(i)
    break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()

def check(n):
    for s in n:
        if s is not n[0]:
            return False
    return True

for i in range(int(N),999):
    if check(str(i)):
        print(i)
        exit()

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = input()

def check(n):
    for s in n:
        if s is not n[0]:
            return False
    return True

for i in range(int(N),1000):
    if check(str(i)):
        print(i)
        exit()
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
N_list = [int(i) for i in N]
top_num = N_list[0]
length = len(N_list)
for i in range(length-1):
  if N_list[i]>=N_list[i+1]:
    flag = True
  else:
    flag = False
    break

if flag:
  print(str(top_num)*length)
else:
  print(str(top_num+1)*length)

Failing test case input:
625

Expected output:
666


Actual output:
777


Fixed submission (verdict: Accepted):
N = input()
N_list = [int(i) for i in N]
top_num = N_list[0]
length = len(N_list)
flag = True
for i in range(length-1):
  if top_num == 9:
    flag = True
    break
  if N_list[i]>N_list[i+1]:
    flag = True
    break
  elif N_list[i]==N_list[i+1]:
    flag = True
  else:
    flag = False
    break

if flag:
  print(str(top_num)*length)
else:
  print(str(top_num+1)*length)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
list=[111,222,333,444,555,666,777,888,999,1111]
for i in list:
  if i<=n:
    print(i)
    exit()

Failing test case input:
752

Expected output:
777


Actual output:
111


Fixed submission (verdict: Accepted):
n=int(input())
list=[111,222,333,444,555,666,777,888,999,1111]
for i in list:
  if n<=i:
    print(i)
    exit()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
_max = max([int(i) for i in str(N)])
if str(N) == str(_max) * (len(str(N))):
  print(N)
else:
  print(str(_max) * (len(str(N))))

Failing test case input:
528

Expected output:
555


Actual output:
888


Fixed submission (verdict: Accepted):
N = int(input())
len_N = len(str(N))
num = int(str(N)[0])
if int(str(num) * len_N) < N:
  print(str(num + 1) * len_N)
else:
  print(str(num) * (len(str(N))))

Problem: p03243
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n_list=list(input())

n=[int(i) for i in n_list]

ans=str(n[0]+1)*3

if n[0]>=n[1]:
    if n[1]>=n[2]:
        ans=str(n[0])*3
        
print(ans)

Failing test case input:
528

Expected output:
555


Actual output:
666


Fixed submission (verdict: Accepted):
n_list=list(input())

n=[int(i) for i in n_list]

ans=str(n[0]+1)*3

if n[0]>n[1]:
    ans=str(n[0])*3

elif n[0]==n[1]:
    if n[1]>=n[2]:
        ans=str(n[0])*3
        
print(ans)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = list(map(int, list(str(input()))))
if not (a == b and b == c):
    if b >= a or (b == a and c >= a):
        a += 1
    b = a; c = a

ans = list(map(str, [a,b,c]))
print("".join(ans))

Failing test case input:
662

Expected output:
666


Actual output:
777


Fixed submission (verdict: Accepted):
a,b,c = list(map(int, list(str(input()))))
if not (b <= a and c <= a):
    if (b > a) or (b == a and c > a):
        a += 1
b = a; c = a

ans = list(map(str, [a,b,c]))
print("".join(ans))
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ans = ["111", "111", "222", "333", "444", "555", "666", "777", "888", "999"]
print(ans[int(N/111)])


Failing test case input:
528

Expected output:
555


Actual output:
444


Fixed submission (verdict: Accepted):
N = int(input())
ans = ["111", "222", "333", "444", "555", "666", "777", "888", "999"]
if not(N % 111):
    print(ans[int(N/111) - 1])
else:
    print(ans[int(N/111)])

Problem: p03243
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int()
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)
else:
    print(1111)


Failing test case input:
543

Expected output:
555


Actual output:
111


Fixed submission (verdict: Accepted):
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)
else:
    print(1111)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
b=[]
for i in range(1,10):
  if a<=111*i:
    b.append(a)
print(min(b))

Failing test case input:
662

Expected output:
666


Actual output:
662


Fixed submission (verdict: Accepted):
a=int(input())
b=[0]
for i in range(10):
  if a>111*i:
    b.append(111*(i+1))
print(max(b))

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = list(a)
c = b[0] + b[0] + b[0]

if int(a) >= int(c):
  print(c)
else:
  print(int(c)+111)

Failing test case input:
846

Expected output:
888


Actual output:
999


Fixed submission (verdict: Accepted):
a = input()
b = list(a)
c = b[0] + b[0] + b[0]

if int(a) > int(c):
  print(int(c)+111)
else:
  print(int(c))

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
one = list(n)[0]
base = int(one) * 111
if int(n) > base:
  print(int(n)+111)
else:
  print(int(n))

Failing test case input:
846

Expected output:
888


Actual output:
846


Fixed submission (verdict: Accepted):
n = input()
one = list(n)[0]
base = int(one) * 111
if int(n) > base:
  print(base+111)
else:
  print(base)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
a = N[0]
b = N[1]
c = N[2]
if a > b:
    print(3 * a)
if a < b:
    print(3 * str((int(a) + 1)))
else:
    if b >= c:
        print(3*b)
    else:
        print(3* str(int(a) + 1))


Failing test case input:
437

Expected output:
444


Actual output:
444
555


Fixed submission (verdict: Accepted):
N = input()
stra = N[0]
strb = N[1]
strc = N[2]
a = int(stra)
b = int(strb)
c = int(strc)
if a > b:
    print(3 * stra)
elif a < b:
    print(3 * str((a + 1)))
else:
    if b >= c:
        print(3*strb)
    else:
        print(3* str(a + 1))
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A = list(input())
x = int(A[0])
y = int(A[1])
z = int(A[2])

ans = ''
a = 0
if x >= y:
    if y >= z:
        a = str(x)
        ans = a + a + a
    else:
        a = str(x + 1)
        ans = a + a + a
else:
    a = str(x + 1)
    ans = a + a + a

print(ans)

Failing test case input:
437

Expected output:
444


Actual output:
555


Fixed submission (verdict: Accepted):
A = list(input())
x = int(A[0])
y = int(A[1])
z = int(A[2])

ans = ''
a = 0
if x > y:
    a = str(x)
    ans = a + a + a
elif x == y:
    if y >= z:
        a = str(x)
        ans = a + a + a
    else:
        a = str(x + 1)
        ans = a + a + a
else:
    a = str(x + 1)
    ans = a + a + a

print(ans)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

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

Failing test case input:
985

Expected output:
999


Actual output:
111


Fixed submission (verdict: Accepted):
N = int(input())

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

Problem: p03243
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
N = int(input())

sum_N = sum(map(int,str(N)))

for i in range(1,9):
    comp = 3*(i)
    if sum_N <= comp:
        print(str(i)*3)
        sys.exit()

Failing test case input:
846

Expected output:
888


Actual output:
666


Fixed submission (verdict: Accepted):
import sys
N = int(input())

for i in range(1,10):
    if N <= int(str(i)*3):
        print(str(i)*3)
        sys.exit()

Problem: p03243
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
for i in range(9):
  if n<=i*111:
    print((i)*111)
    break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n=int(input())
for i in range(9):
  if n<=i*111:
    print((i)*111)
    break
else:
  print(999)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
N=int(stdin.readline().rstrip())
ans=0
tmp=1000
for i in range(1,10):
    for j in range(3,5):
        num=int(str(i)*j)
        if N-num >= 0 and tmp > N-num:
            tmp = N-num
            ans=num
print(ans)

Failing test case input:
985

Expected output:
999


Actual output:
888


Fixed submission (verdict: Accepted):
from sys import stdin
N=int(stdin.readline().rstrip())
ans=0
tmp=1000
for i in range(1,10):
    for j in range(3,5):
        num=int(str(i)*j)
        if num-N >= 0 and tmp > num-N:
            tmp = num-N
            ans=num
print(ans)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
for i in range(8):
    if 111 * i < N and N <= 111 * (i + 1):
        print(111 * (i + 1))

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
for i in range(9):
    if 111 * i < N and N <= 111 * (i + 1):
        print(111 * (i + 1))
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
for i in range(1,8):
    tmp = 111*i
    if N < tmp:
        print(tmp)
        exit()

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
for i in range(1,10):
    tmp = 111*i
    if N <= tmp:
        print(tmp)
        exit()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
m=111
for i in range(1,10):
    if 111*i>=n:
        m=min(m,111*i)
print(m)
    


Failing test case input:
985

Expected output:
999


Actual output:
111


Fixed submission (verdict: Accepted):
n=int(input())
m=999
for i in range(1,10):
    if 111*i>=n:
        m=min(m,111*i)
print(m)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())

if 100<=n<=111:
            print(111)
a=0
for a in range(8):
            if 1+111*a<=n<=111*(a+1):
                        print(111*(a+1))


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n=int(input())

if 100<=n<=111:
            print(111)
a=0
for a in range(1,9):
            if 1+111*a<=n<=111*(a+1):
                        
                        print(111*(a+1))

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
for i in range(1,9):
  I=i*100+i*10+i
  if N<=I:
    print(I)
    break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N=int(input())
for i in range(1,10):
  I=i*100+i*10+i
  if N<=I:
    print(I)
    break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=input()
if n[0]>=n[1]>=n[2]:
    print(n[0]+n[0]+n[0])
else:
    m=str(int(n[0])+1)
    print(m+m+m)

Failing test case input:
846

Expected output:
888


Actual output:
999


Fixed submission (verdict: Accepted):
n=input()
if n[0]==n[1]>=n[2] or n[0]>n[1]:
    print(n[0]+n[0]+n[0])
else:
    m=str(int(n[0])+1)
    print(m+m+m)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
a = list(str(n))
if a[0]>a[1]:
    print(int(a[0])*111)
if a[0]==a[1]:
    if a[1]>=a[2]:
        print(n)
    else:
        print((1+int(a[0]))*111)
if a[0]<a[1]:
    print((1+int(a[0]))*111)

          

Failing test case input:
662

Expected output:
666


Actual output:
662


Fixed submission (verdict: Accepted):
n = input()
a = list(str(n))
if a[0]>a[1]:
    print(int(a[0])*111)
if a[0]==a[1]:
    if a[1]>=a[2]:
        print(int(a[0])*111)
    else:
        print((1+int(a[0]))*111)
if a[0]<a[1]:
    print((1+int(a[0]))*111)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

res = 0
for i in range(9):
    tmp = i * 111
    if tmp >= N:
        res = tmp
        break
print(res)

Failing test case input:
985

Expected output:
999


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())

res = 0
for i in range(11):
    if i == 10:
        tmp = 1111
    else:
        tmp = i * 111
    if tmp >= N:
        res = tmp
        break
print(res)
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()

for i in range(1, 9):
    if 100*i + 10*i + i >= n:
        print(100*i + 10*i + i)
        break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()

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

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = [111,222,333,444,555,666,777,888,999]
for i in a:
  if i >= n:
    print(i)


Failing test case input:
662

Expected output:
666


Actual output:
666
777
888
999


Fixed submission (verdict: Accepted):
n = int(input())
a = [111,222,333,444,555,666,777,888,999]
b = 0
for i in a:
  if i >= n:
    b = i
    break
print(b)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
import copy
import sys

def zorome(num):
    return int(111*num)

inputa = input().split()



a = int(inputa[0])























listNum = list(str(a))

if int(a) >= zorome(int(listNum[0])):
    print(zorome(int(listNum[0])))
else:
    print(zorome(int(listNum[0])+1))





Failing test case input:
625

Expected output:
666


Actual output:
777


Fixed submission (verdict: Accepted):
import math
import copy
import sys

def zorome(num):
    return int(111*num)

inputa = input().split()



a = int(inputa[0])























listNum = list(str(a))

if int(a) <= zorome(int(listNum[0])):
    print(zorome(int(listNum[0])))
else:
    print(zorome(int(listNum[0])+1))

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

ans = N
for i in range(200):
  if str(ans)[0] == str(ans)[1] and str(ans)[1] == str(ans)[2]:
    print(ans)
    break
  else:
    ans += i


Failing test case input:
543

Expected output:
555


Actual output:
9996


Fixed submission (verdict: Accepted):
N = int(input())

ans = N
for i in range(200):
  if str(ans)[0] == str(ans)[1] and str(ans)[0] == str(ans)[2]:
    print(ans)
    break
  else:
    ans += 1

Problem: p03243
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
for i in range(0,112):
  N = N+i
  n = list(str(N))
  if n[0] == n[1] == n[2]:
    print(N)


Failing test case input:
846

Expected output:
888


Actual output:
999
2224
3331


Fixed submission (verdict: Accepted):
import sys
N = int(input())
for i in range(0,112):
  n = list(str(N+i))
  if n[0] == n[1] == n[2]:
    print(N+i)
    sys.exit()
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
x = 111

for i in range(8):
    if x >= n:
        print(x)
        break
    else:
        x += 111





Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
x = 111

for i in range(9):
    if x >= n:
        print(x)
        break
    else:
        x += 111

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

for i in range(N, 999):
    if i % 111 == 0:
        print(i)
        exit()


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())

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

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
N=int(stdin.readline().rstrip())
ans=0
tmp=1000
for i in range(1,10):
    for j in range(3,5):
        num=int(str(i)*j)
        if N-num >= 0 and tmp < N-num:
            tmp = N-num
            ans=num
print(ans)

Failing test case input:
543

Expected output:
555


Actual output:
0


Fixed submission (verdict: Accepted):
from sys import stdin
N=int(stdin.readline().rstrip())
ans=0
tmp=1000
for i in range(1,10):
    for j in range(3,5):
        num=int(str(i)*j)
        if num-N >= 0 and tmp > num-N:
            tmp = num-N
            ans=num
print(ans)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=str(N)
a=int(S[0]+S[0]+S[0])
print(a if N>=a else a+111)

Failing test case input:
543

Expected output:
555


Actual output:
666


Fixed submission (verdict: Accepted):
N=int(input())
S=str(N)
a=int(S[0]+S[0]+S[0])
print(a if N<=a else a+111)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=input()
ans=0
if N[0]=='9':
    ans = '1'*(len(N)+1)
elif int(N)>int(N[0]*len(N)):
    ans = str(int(N[0])+1)*len(N)
else:
    ans = N[0]*len(N)
print(ans)

Failing test case input:
985

Expected output:
999


Actual output:
1111


Fixed submission (verdict: Accepted):
N=input()
ans=0
if int(N)<=int(N[0]*len(N)):
    ans=N[0]*len(N)
elif N[0]=='9':
    ans='1'*(len(N)+1)
else:
    ans=str(int(N[0])+1)*len(N)
print(ans)

Problem: p03243
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
a=[111,222,333,444,555,666,777,888,999,1111]
for x in a:
  if N>=x:
    print(x)
    break

Failing test case input:
543

Expected output:
555


Actual output:
111


Fixed submission (verdict: Accepted):
N=int(input())
a=[111,222,333,444,555,666,777,888,999,1111]
for x in a:
  if N<=x:
    print(x)
    break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
x = 111
for i in range(2,10):
    if n <= x:
        print(x)
        exit()
    x = 111*i

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
x = 111
for i in range(2,10):
    if n <= x:
        print(x)
        exit()
    x = 111*i
print(x)
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
c=111
while True:
    if n<=c:
        print(c)
        break
    c=c<<1

Failing test case input:
528

Expected output:
555


Actual output:
888


Fixed submission (verdict: Accepted):
n=int(input())
c=111
while True:
    if n<=c:
        print(c)
        break
    c+=111

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = 111
N = int(input())
for i in range(1, 9):
    if (i - 1) * a < N <= i * a:
        print(i * a)
        break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
a = 111
N = int(input())
for i in range(1, 10):
    if (i - 1) * a < N <= i * a:
        print(i * a)
        break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = 999

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

Failing test case input:
662

Expected output:
666


Actual output:
999


Fixed submission (verdict: Accepted):
n = int(input())

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

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())

list = [111,222,333,444,555,666,777,888,999]
ans = 0
for l in list:
  if N <= l:
    ans = l
  else:
    break

print(ans)

Failing test case input:
625

Expected output:
666


Actual output:
0


Fixed submission (verdict: Accepted):

N = int(input())

list = [111,222,333,444,555,666,777,888,999, 1000000]
ans = 0
for l in list:
  if N > l:
    continue
  else:
    ans =l
    break

print(ans)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
for i in range(1,8):
    tmp = 111*i
    if N <= tmp:
        print(tmp)
        exit()


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
for i in range(1,10):
    tmp = 111*i
    if N <= tmp:
        print(tmp)
        exit()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())+100
o = int((n-(n%100))/100*111)
if n < o:
	print(o)
else:
	print(o+111)

Failing test case input:
437

Expected output:
444


Actual output:
555


Fixed submission (verdict: Accepted):
n = int(input())
o = int((n-(n%100))/100)
if n<=o*111:
    print(o*111)
else:
    print(o*111+111)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())

for i in range(N,1000):
  a=N
  c=N%10
  b=N-(100*a + c)
  if a==b==c:
    print(i)
    break

Failing test case input:
437

Expected output:
444


Actual output:

Fixed submission (verdict: Accepted):
N=int(input())

for i in range(N,1000):
  a=str(i)[0]
  b=str(i)[1]
  c=str(i)[2]
  if a==b and b==c:
    print(i)
    break
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
top = s[0]
ng = False
for i in s:
    if top != i:
        ng = True
        break

if not (ng):
    print(s)
else:
    if int(top * len(s)) < int(s):
        print(str(int(top) + 1) * len(s))
    else:
        print(s)

Failing test case input:
985

Expected output:
999


Actual output:
985


Fixed submission (verdict: Accepted):
s = input()
top = s[0]
ng = False
for i in s:
    if top != i:
        ng = True
        break

if not (ng):
    print(s)
else:
    if int(top * len(s)) < int(s):
        print(str(int(top) + 1) * len(s))
    else:
        print(int(top * len(s)))

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()

for i in range(int(n), 999):
    if str(i)[0] == str(i)[1] == str(i)[2]:
        print(i)
        break


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n = input()

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

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [111,222,333,444,555,666,777,888,999]
for i in range(8) :
    if A[i] - N >= 0 :
        print(A[i])
        break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
X = [111,222,333,444,555,666,777,888,999]
for i in X :
    if i - N >= 0 :
        print(i)
        break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
i=1
while n<111*i:
    i+=1
print(111*i)

Failing test case input:
543

Expected output:
555


Actual output:
111


Fixed submission (verdict: Accepted):
n=int(input())
i=1
while n>111*i:
    i+=1
print(111*i)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
result = ''
if int(N) % 111 == 0:
    print(N)
else:
    if len(N) == 2:
        result = '111'
    else:
        for i in range(len(N)):
            result += str(int(N[0])+1)
    print(result)


Failing test case input:
752

Expected output:
777


Actual output:
888


Fixed submission (verdict: Accepted):
import math
N = input()
temp = 0
result = ''
if int(N) % 111 == 0:
    print(N)
else:
    temp = math.ceil((int(N) / 111))
    for i in range(len(N)):
        result += str(temp)
    print(result)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
a,b,c = [int(n[i]) for i in range(len(n))]
print(a)
if a > b:
  print(a*111)
elif a == b:
  if b >= c:
    print(a*111)
  else:
    print((a+1)*111)
else:
  print((a+1)*111)
  

Failing test case input:
752

Expected output:
777


Actual output:
7
777


Fixed submission (verdict: Accepted):
n = input()
a,b,c = [int(n[i]) for i in range(len(n))]

if a > b:
  print(a*111)
elif a == b:
  if b >= c:
    print(a*111)
  else:
    print((a+1)*111)
else:
  print((a+1)*111)
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
result = ''
if int(N) % 111 == 0:
    print(N)
else:
    for i in range(len(N)):
        result += str(int(N[0])+1)
    print(result)


Failing test case input:
437

Expected output:
444


Actual output:
555


Fixed submission (verdict: Accepted):
import math
N = input()
temp = 0
result = ''
if int(N) % 111 == 0:
    print(N)
else:
    temp = math.ceil((int(N) / 111))
    for i in range(len(N)):
        result += str(temp)
    print(result)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
if n%111:
	print(n/111*111)
else:
	print((n/111+1)*111)

Failing test case input:
528

Expected output:
555


Actual output:
528.0


Fixed submission (verdict: Accepted):
n=int(input())
if n%111==0:
	print(int(n/111)*111)
else:
	print((n

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())

if 100<=n<=111:
            print(111)
a=0
for a in range(1,8):
            if 1+111*a<=n<=111*(a+1):
                        print(111*(a+1))


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n=int(input())

if 100<=n<=111:
            print(111)
a=0
for a in range(1,9):
            if 1+111*a<=n<=111*(a+1):
                        
                        print(111*(a+1))

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())

for i in range(N,1000):
  a=N
  c=N%10
  b=(N-100*a)
  if a==b==c:
    print(i)
    break

Failing test case input:
752

Expected output:
777


Actual output:

Fixed submission (verdict: Accepted):
N=int(input())

for i in range(N,1000):
  a=str(i)[0]
  b=str(i)[1]
  c=str(i)[2]
  if a==b and b==c:
    print(i)
    break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print(input())	

Failing test case input:
846

Expected output:
888


Actual output:
846


Fixed submission (verdict: Accepted):
print(-(-int(input())

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

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


Failing test case input:
543

Expected output:
555


Actual output:
700.41


Fixed submission (verdict: Accepted):
n = int(input())
if n % 111 > 0:
    n = int((n - int(n / 100) * 11 + 100) / 100) * 111
print(n)

Problem: p03243
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
N = int(input())

for i in range(1,9):
    if N <= int(str(i)*3):
        print(str(i)*3)
        sys.exit()

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
import sys
N = int(input())

for i in range(1,10):
    if N <= int(str(i)*3):
        print(str(i)*3)
        sys.exit()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
while n % 111 == 0:
  n += 1
print(n)

Failing test case input:
846

Expected output:
888


Actual output:
846


Fixed submission (verdict: Accepted):
n = int(input())
while n % 111 != 0:
  n += 1
print(n)
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()

for i in range(9):
    if int(str(i)*3) >= int(n):
        print(str(i)*3)
        exit()

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n = input()

for i in range(10):
    if int(str(i)*3) >= int(n):
        print(str(i)*3)
        exit()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline

N = int(input())
out = []
for i in range(1,10):
    out.append(i*100 + i*10 + i)
print(out)
for i in range(len(out)):
    if out[i] >= N:
        print(out[i])
        exit()

Failing test case input:
662

Expected output:
666


Actual output:
[111, 222, 333, 444, 555, 666, 777, 888, 999]
666


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

N = int(input())
out = []
for i in range(1,10):
    out.append(i*100 + i*10 + i)
for i in range(len(out)):
    if out[i] >= N:
        print(out[i])
        exit()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = list(input())
ori = ''.join(map(str, n))
n = set(n)

if len(n) == 1:
    n = list(n)
    print(str(n[0] * 3))
else:
    n = list(n)
    for num in n:
        result = num * 3
        if ori < result:
            print(result)


Failing test case input:
528

Expected output:
555


Actual output:
555
888


Fixed submission (verdict: Accepted):
n = list(input())
ori = ''.join(map(str, n))
n = set(n)

if len(n) == 1:
    n = list(n)
    print(str(n[0] * 3))
else:
    print()
    if int(str(int(ori[0])) * 3) > int(ori):
        print(str(int(ori[0])) * 3)
    else:
        print(str((int(ori[0])+1)) * 3)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
ans=ju=0
for i in range(0,999,111):
  if(i>N):
    print(i)
    break
  elif(i==N):
    print(i)
    break
    
  

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N=int(input())
ans=ju=0
for i in range(0,1000,111):
  if(i>N):
    print(i)
    break
  elif(i==N):
    print(i)
    break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
sam = [j*100+j*10+j for j in range(1,10)]

for k in range(len(sam)):
  if x>sam[k] and x<sam[k+1]:
    print(sam[k+1])
    break
  elif x==sam[k]:
    print(sam[k])
    break
  else:
    print(sam[0])
    break
    
    

Failing test case input:
543

Expected output:
555


Actual output:
111


Fixed submission (verdict: Accepted):
x = int(input())
sam = [j*100+j*10+j for j in range(1,10)]

for k in range(len(sam)):
  if x>sam[k] and x<sam[k+1]:
    print(sam[k+1])
    break
  elif x==sam[k]:
    print(sam[k])
    break
  elif x<sam[0]:
    print(sam[0])
    break
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()

if n[0] == n[1] and n[1] == n[2] and n[0] == n[2]:
    print(n)
elif n[0] == n[1] and n[0] < n[2]:
    print(n[0]*3)
elif n[0] < n[1]:
    print(str(int(n[0])+1) * 3)
elif n[0] > n[1]:
    print(n[0]*3)

Failing test case input:
662

Expected output:
666


Actual output:

Fixed submission (verdict: Accepted):
n = input()

if n[0] == n[1] and n[1] == n[2] and n[0] == n[2]:
    print(n)
elif n[0] == '9':
    print('999')
elif n[0] == n[1] and n[0] > n[2]:
    print(n[0]*3)
elif n[0] == n[1] and n[0] < n[2]:
    print(str(int(n[0])+1) * 3)
elif n[0] < n[1]:
    print(str(int(n[0])+1) * 3)
elif n[0] > n[1]:
    print(n[0]*3)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())

for i in range(N,999):
    n=str(i)
    if all(x==n[0] for x in n):
        print(n)
        break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N=int(input())

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

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

ans = N
for i in range(200):
  if str(ans)[0] == str(ans)[1] and str(ans)[1] == str(ans)[2]:
    print(ans)
    break
  else:
    ans += i
    pass

Failing test case input:
410

Expected output:
444


Actual output:
1113


Fixed submission (verdict: Accepted):
N = int(input())

ans = N
for i in range(200):
  if str(ans)[0] == str(ans)[1] and str(ans)[0] == str(ans)[2]:
    print(ans)
    break
  else:
    ans += 1

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=input()
a=int(n[0])
b=int(n[1])
c=int(n[2])
if a>b:
  print(a*111)
elif a<b:
  print((a+1)*111)
else:
  if b>=c:
    print(n)
  else:
    print((a+1)*111)

Failing test case input:
662

Expected output:
666


Actual output:
662


Fixed submission (verdict: Accepted):
n=input()
a=int(n[0])
b=int(n[1])
c=int(n[2])
if a>b:
  print(a*111)
elif a<b:
  print((a+1)*111)
else:
  if b>=c:
    print(a*111)
  else:
    print((a+1)*111)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
h = int(N[0])
t = int(N[1])
o = int(N[2])

if h == t and t == o:
    print(N)
else:
    h += 1
    print(h*111)

Failing test case input:
985

Expected output:
999


Actual output:
1110


Fixed submission (verdict: Accepted):
N = input()
n = int(N)
h = int(N[0])

if h == 9:
    print(999)
else:
    if n > h * 111:
        h += 1
    print(h*111)
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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(888)
elif N <= 999:
    print(999)

Failing test case input:
846

Expected output:
888


Actual output:
999


Fixed submission (verdict: Accepted):
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)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
b=[]
for i in range(1,10):
  if a<=111*i:
    b.append(a)
print(max(b))

Failing test case input:
410

Expected output:
444


Actual output:
410


Fixed submission (verdict: Accepted):
a=int(input())
b=[0]
for i in range(10):
  if a>111*i:
    b.append(111*(i+1))
print(max(b))

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
N_list = [int(i) for i in N]
top_num = N_list[0]
length = len(N_list)
flag = True
for i in range(length-1):
  if N_list[i]>=N_list[i+1]:
    flag = True
  else:
    flag = False
    break

if flag:
  print(str(top_num)*length)
else:
  print(str(top_num+1)*length)

Failing test case input:
528

Expected output:
555


Actual output:
666


Fixed submission (verdict: Accepted):
N = input()
N_list = [int(i) for i in N]
top_num = N_list[0]
length = len(N_list)
flag = True
for i in range(length-1):
  if top_num == 9:
    flag = True
    break
  if N_list[i]>N_list[i+1]:
    flag = True
    break
  elif N_list[i]==N_list[i+1]:
    flag = True
  else:
    flag = False
    break

if flag:
  print(str(top_num)*length)
else:
  print(str(top_num+1)*length)

Problem: p03243
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = 111
for _ in range(8):
    if n <= a:
        print(a)
        exit()
    a += 111

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
a = 111
for _ in range(9):
    if n <= a:
        print(a)
        exit()
    a += 111

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

res = 0
for i in range(1,9):
    tmp = i * 111
    if tmp >= N:
        res = tmp
        break
print(res)


Failing test case input:
985

Expected output:
999


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())

res = 0
for i in range(11):
    if i == 10:
        tmp = 1111
    else:
        tmp = i * 111
    if tmp >= N:
        res = tmp
        break
print(res)
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys


def solve(N: int):
    ret = ''
    for i in range(N, 999):
        s = str(i)
        if s[0] == s[1] and s[1] == s[2]:
            ret = s
            break
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):

import sys


def solve(N: int):
    ret = ''
    for i in range(N, 1000):
        s = str(i)
        if s[0] == s[1] and s[1] == s[2]:
            ret = s
            break
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
s = ''
def ans(N):
    for ctr in range(N,999):
        s = str(ctr)
        if s[0]==s[1] and s[1]==s[2]:
            return(ctr)
print(ans(N))

Failing test case input:
985

Expected output:
999


Actual output:
None


Fixed submission (verdict: Accepted):
N = int(input())
s = ''
def ans(N):
    for ctr in range(N,1000):
        s = str(ctr)
        if s[0]==s[1] and s[1]==s[2]:
            return(ctr)
print(ans(N))

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = input()

ans = N[0]
for i in range(2):
    if N[i] != N[i+1]:
        if N[i] < N[i+1]:
            ans = str(int(N[i]) + 1)

for i in range(3):
    print(ans, end="")
print()

Failing test case input:
625

Expected output:
666


Actual output:
333


Fixed submission (verdict: Accepted):

N = input()

ans = N[0]
for i in range(2):
    if N[i] != N[i+1]:
        if int(N[i]) < int(N[i+1]):
            ans = str(int(N[i]) + 1)
        break

for i in range(3):
    print(ans, end="")
print()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
x = 111
for i in range(1,9):
    a = 111 *i
    if N <= a:
        x = a
        print (x)
        break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
x = 111
for i in range(1,10):
    a = 111 *i
    if N <= a:
        x = a
        print (x)
        break

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
for i in range (1,9):
    if N <= i*111:
        print(i*111)
        break
    else:
        i=1+1

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
N=int(input())
for i in range (1,10):
    if N <= i*111:
        print(i*111)
        break
    else:
        i=1+1