ZhenlongDai/ACPR huggingface dataset:
Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    N = int(input())
    alpha = "abcdefghijklmnopqrstuvwxyz"

    digi = list()
    for i in range(1, 20):
        if N == 0:
            break
        r, m = divmod(N, 26)
        digi.append(m)
        N = r

    ans = ""
    digi.reverse()

    for d in digi:
        ans += alpha[d - 1]

    print(ans)

if __name__ == "__main__":
    main()

Failing test case input:
4285476

Expected output:
iiukz


Actual output:
iiulz


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    alpha = "abcdefghijklmnopqrstuvwxyz"

    l = 0
    for i in range(1, 12):
        if N - 26 ** i > 0:
            N -= 26 ** i
            l = i
        else:
            break

    l += 1
    N -= 1

    if N == -1:
        N = 26**l - 1

    digi = list()
    for i in range(1, l + 1):
        r, m = divmod(N, 26)
        digi.append(m)
        N = r

    ans = ""
    for d in digi:
        ans += alpha[d]

    print(ans[::-1])

if __name__ == "__main__":
    main()

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
string = "abcdefghijklmnopqrstuvwxyz"

num = int(input())
ans = ""
while num != 0:
    num, m = divmod(num, 26)
    
    if m:
        ans = string[m-1] + ans

print(ans)

Failing test case input:
1388428

Expected output:
bzywb


Actual output:
cywb


Fixed submission (verdict: Accepted):
string = 'abcdefghijklmnopqrstuvwxyz'

num = int(input())
ans = ""
while num != 0:
    num, m = divmod(num, 26)
    if m == 0:
        ans = string[m-1] + ans
        num = num - 1
    else:
        ans = string[m-1] + ans

print(ans)

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
NAME = 'abcdefghijklmnopqrstuvwxyz'
D = 26
name = ''

while N > 0:
  i = N % 26
  name = NAME[i-1] + name
  N = int((N - i) / D)
  
print(name)

Failing test case input:
4285476

Expected output:
iiukz


Actual output:
iiulz


Fixed submission (verdict: Accepted):
N = int(input())
NAME = 'abcdefghijklmnopqrstuvwxyz'
D = 26
name = ''

while N > 0:
  i = N % D
  name = NAME[i-1] + name
  N = int((N - i) / D)
  if i == 0:
    N -= 1
  
print(name)

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
result = ""
while True:
    alpha = int(n % 26)
    if alpha == 0:
        result += "z"
    else:
        result += chr(alpha + 96)
    if n/26 <= 1:
        break
    n /= 26

rslt = result[::-1]
print(rslt)

Failing test case input:
1930001

Expected output:
detzu


Actual output:
deuzu


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

while True:
    alpha = int(n % 26)
    if alpha == 0:
     result += "z"
     n -= 1
    else:
     result += chr(alpha + 96)
    if n/26 < 1:
        break
    n /= 26
rslt = result[::-1]
print(rslt)
Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ans = list()
while n>0:
    ans.append(n % 26)
    n =int(n / 26)

str_ans = ""
for x in ans[::-1]:
    str_ans += chr(x+96)

print(str_ans)

Failing test case input:
2054

Expected output:
bzz


Actual output:
ca`


Fixed submission (verdict: Accepted):
n = int(input())
ans = list()
while n>0:
    x = n % 26
    if x == 0:
        x = 26
        n=n-1
    ans.append(x)
    n = int(n / 26)


str_ans = ""
for x in ans[::-1]:
    str_ans += chr(x+96)

print(str_ans)

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
 
b = int(input())
b -= 1
r = ''
while b > 0:
  c = b % len(a)
  r = a[c] + r
  b = int(b / len(a) - 1)
print(r)

Failing test case input:
805087

Expected output:
astxw


Actual output:
stxw


Fixed submission (verdict: Accepted):
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
 
b = int(input())
r = ''
while b > 0:
  b -= 1
  c = b % len(a)
  r = a[c] + r
  b = int(b / len(a))
print(r)

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
l = []

while(n > 0):
    l.append((n - 1) % 26)
    n = int((n - 1) / 26)

print(l)
l.reverse()

ans = []
for i in l:
    ans.append(chr(i + ord('a')))
    
print(''.join(ans))

Failing test case input:
2328

Expected output:
ckn


Actual output:
[13, 10, 2]
ckn


Fixed submission (verdict: Accepted):
n = int(input())
l = []

while(n > 0):
    l.append((n - 1) % 26)
    n = int((n - 1) / 26)

l.reverse()

ans = []
for i in l:
    ans.append(chr(i + ord('a')))
    
print(''.join(ans))

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
string = "abcdefghijklmnopqrstuvwxyz"

num = int(input())
ans = ""
while num != 0:
    num, m = divmod(num, 26)
    ans = string[m-1] + ans

print(ans)

Failing test case input:
1388428

Expected output:
bzywb


Actual output:
czywb


Fixed submission (verdict: Accepted):
string = 'abcdefghijklmnopqrstuvwxyz'

num = int(input())
ans = ""
while num != 0:
    num, m = divmod(num, 26)
    if m == 0:
        ans = string[m-1] + ans
        num = num - 1
    else:
        ans = string[m-1] + ans

print(ans)

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
alp = [chr(i) for i in range(97, 97+26)]
N = int(input())
q = N
s = ""
while True:
  q,m = divmod(q,26)
  s = alp[m - 1] + s
  if q == 0:
    break
print(s)
  

Failing test case input:
3462807

Expected output:
gnzlw


Actual output:
gozlw


Fixed submission (verdict: Accepted):
alp = [chr(i) for i in range(97, 97+26)]
N = int(input())
q = N
s = ""
while True:
  q,m = divmod(q,26)
  if m == 0:
    m = 26
    q -= 1
  s = alp[m - 1] + s
  if q == 0:
    break
print(s)
Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):



n = int(input())
_ = 96


ans = ''
while True:
  a, b = divmod(n, 26)
  
  if b == 0:
    b = 26
  ans += str(chr(b + _))
  if a == 0:
    break
  n = a
  
print(ans[::-1])

Failing test case input:
2054

Expected output:
bzz


Actual output:
caz


Fixed submission (verdict: Accepted):



n = int(input())
_ = 96


ans = ''
while True:
  a, b = divmod(n, 26)
  
  if b == 0:
    b = 26
    a -= 1
  ans += str(chr(b + _))
  if a == 0:
    break
  n = a
  
print(ans[::-1])

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
s = ""
words = "abcdefghijklmnopqrstuvwxyz"
N = N-1
while N > 0:
    amari = N%26
    if N > 26:
        N = (N-N%26)/26-1
    else:
        N = N-26
    s = words[int(amari)]+s
print(s)

Failing test case input:
805087

Expected output:
astxw


Actual output:
stxw


Fixed submission (verdict: Accepted):
N = int(input())
s = ""
words = "abcdefghijklmnopqrstuvwxyz"
while N > 0:
    if N%26 == 0:
        amari = 26
    else:
        amari = N%26
    if N > 26:
        N = (N-amari)/26
    else:
        N = N-26
    s = words[int(amari-1)]+s
print(s)

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def int2char(i):
    return chr(ord("a") + i - 1)

N = int(input())
n = N

ans = ""
while (1):
    n_next = int(n/26)
    ans = int2char(n - n_next*26) + ans
    n = n_next
    if n_next == 0:
        break

print(ans)


Failing test case input:
71095103

Expected output:
eynzga


Actual output:
eyo`ga


Fixed submission (verdict: Accepted):
def int2char(i):
    return chr(ord("a") + i - 1)

N = int(input())

ans = ""
while (True):
    N_lsb_int = ((N - 1) % 26) + 1
    N_next = int((N - N_lsb_int)/26)
    ans = int2char(N_lsb_int) + ans
    if N_next == 0:
        break
    N = N_next

print(ans)

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
num = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while num > 26:
    num, rest = divmod(num, 26)
    ans += s[rest - 1]
    if rest == 0:
        num -= 1
    
    print(ans, num, rest)
    
ans += s[num - 1]
print(ans[::-1])

Failing test case input:
310924

Expected output:
qqxp


Actual output:
p 11958 16
px 459 24
pxq 17 17
qqxp


Fixed submission (verdict: Accepted):
num = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while num > 26:
    num, rest = divmod(num, 26)
    ans += s[rest - 1]
    if rest == 0:
        num -= 1
    
    
    
ans += s[num - 1]
print(ans[::-1])

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

t = n
ans = ''
while t > 26:
    num = t % 26
    ans += chr(t % 26 + 96)
    t = int(t / 26)

ans += chr(t + 96)
print(ans[::-1])

Failing test case input:
12558

Expected output:
rnz


Actual output:
ro`


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

t = n
ans = ''
while t > 26:
    if t % 26 != 0:
        ans += chr(t % 26 + 96)
        t = int(t / 26)
    else:
        ans += 'z'
        t = int(t / 26) - 1

ans += chr(t + 96)
print(ans[::-1])
Problem: p02629
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
name = []
S = ''
num = 26
for i in range(20):
    amari = int(N % num)
    if amari == 0:
        amari = 122
    else:    
        amari += 96
    N = int(N / num)
    amari = chr(amari)    
    name.insert(0, amari)
    if amari == 'z':
        N = int(N / num)
    if N == 0:
        break

for l in name:
    S = S + l
print(str(S))

Failing test case input:
3543607

Expected output:
gsozo


Actual output:
gszo


Fixed submission (verdict: Accepted):
N = int(input())
name = []
S = ''
num = 26
for i in range(20):
    amari = int(N % num)
    if amari == 0:
        amari = 122
        N=int(N/num)-1
    else:
        amari += 96
        N = int(N / num)
    amari = chr(amari)    
    name.insert(0, amari)
    if N / num == 0:
        break

for l in name:
    S = S + l
print(str(S))

Problem: p02629
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def resolve():
    n=int(input())
    abcd = 'abcdefghijklmnopqrstuvwxyz'
    s=""
    while n<=26:
        s=abcd[(n%26)-1]+s
        n=n
        if n<=26:
            break
    print(s)
resolve()

Failing test case input:
2795337

Expected output:
fcaby


Actual output:

Fixed submission (verdict: Accepted):
def resolve():
    n=int(input())
    abcd = 'abcdefghijklmnopqrstuvwxyz'
    s=""
    while True:
        a=n%26
        if a==0:
            a=26
        s=abcd[a-1]+s
        n=int((n-a)/26)
        if n==0:
            break
    print(s)
resolve()

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
base = ord('a') - 1

N = int(input())

data = []

while N:
    next, mod = divmod(N, 26)
    data.append(mod)
    N = next

data.reverse()

for i in data:
    print(chr(base + i), end="")

Failing test case input:
5042770

Expected output:
jzwrr


Actual output:
k`wrr

Fixed submission (verdict: Accepted):
base = ord('a')

N = int(input())

data = []

while N:
    next, mod = divmod(N - 1, 26)
    data.append(mod)
    N = next

data.reverse()

for i in data:
    print(chr(base + i), end="")

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

abc = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while n:
    n, m = divmod(n, 26)
    ans = abc[m-1] + ans
print(ans)

Failing test case input:
3462807

Expected output:
gnzlw


Actual output:
gozlw


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

abc = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
while n:
    n -= 1
    n, m = divmod(n, 26)
    ans = abc[m] + ans
print(ans)

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

ans = ''

while True:
    n = int(N / 26)
    r = N % 26

    ans = chr(96 + r) + ans
    if n == 0:
        break
    else:
        N = n

print(ans)

Failing test case input:
71095103

Expected output:
eynzga


Actual output:
eyo`ga


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

ans = ''

while True:
    n = int(N / 26)
    r = N % 26

    if r == 0:
        r = 26
        n -= 1

    ans = chr(96 + r) + ans
    if n == 0:
        break
    else:
        N = n

print(ans)
Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
number   = int(input())
alphabet = [chr(i) for i in range(97, 97+26)]
name_tag = []

while number != 0:
  number, a = divmod(number, 26)
  name_tag.append(a)
  
reverse_name_tag = reversed(name_tag)
for i in reverse_name_tag:
  print(alphabet[i-1], end="")

Failing test case input:
1388428

Expected output:
bzywb


Actual output:
czywb

Fixed submission (verdict: Accepted):
import string
number   = int(input())
name_tag = []

while number > 0:
  q, a = divmod(number-1, 26)
  name_tag.append(a)
  number = q
  
reverse_name_tag = reversed(name_tag)
for i in reverse_name_tag:
  print(string.ascii_lowercase[i], end="")

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

a=[]
for i in range(9):
    s=int(N%26)
    N=int(N/26)
    a.append(s)
    if N<1:
        break

a=a[::-1]
for i in range(len(a)):
    a[i]=chr(a[i]+96)

print("".join(a))

Failing test case input:
5042770

Expected output:
jzwrr


Actual output:
k`wrr


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

a=[]
for i in range(20):
    if N%26==0:
        s=26
        N=int(N/26)-1
    else:
        s=int(N%26)
        N=int(N/26)
    
    a.append(s)
    if N<1:
        break

a=a[::-1]
for i in range(len(a)):
    a[i]=chr(a[i]+96)

print("".join(a))

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
m=1
a=[]
while n>26:
  n,mod=divmod(n,26)
  a.append(mod)
  m+=1
a.append(n)
s="abcdefghijklmnopqrstuvwxyz"
ans=""
for i in range(m-1,-1,-1):
  ans+=s[a[i]-1]
print(ans)

Failing test case input:
2054

Expected output:
bzz


Actual output:
caz


Fixed submission (verdict: Accepted):
n=int(input())
m=1
a=[]
while n>26:
  n,mod=divmod(n,26)
  if mod==0:
    mod==26
    n-=1
  a.append(mod)
  m+=1
a.append(n)
s="abcdefghijklmnopqrstuvwxyz"
ans=""
for i in range(m-1,-1,-1):
  ans+=s[a[i]-1]
print(ans)

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
if __name__ == "__main__":
    n = int(input().strip())

    chars = "abcdefghijklmnopqrstuvwxyz"
    ans = []

    while True:
        if n < 27:
            ans.append(chars[n - 1])
            break

        else:
            tmp = int(n % 26)
            ans.append(chars[tmp - 1])
            n = int(n / 26)

        
    print("".join(ans[::-1]))

Failing test case input:
3462807

Expected output:
gnzlw


Actual output:
gozlw


Fixed submission (verdict: Accepted):
if __name__ == "__main__":
    n = int(input().strip())
 
    chars = "abcdefghijklmnopqrstuvwxyz"
    ans = []
 
    while True:
        if n < 27:
            ans.append(chars[n - 1])
            break
 
        else:
            remainder = int(n % 26)
            n = int(n / 26)
            if remainder > 0:
                ans.append(chars[remainder - 1])
            else:
                ans.append(chars[-1])
                n -= 1
 
        
    print("".join(ans[::-1]))
Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def c_one_quadrillion_and_one_dalmatians():
    N = int(input())

    ans = []
    while N != 0:
        q, r = divmod(N, 26)
        ans.append(r)
        N = q
    ans = [chr(ord('a') + a - 1) for a in ans]
    return ''.join(reversed(ans))

print(c_one_quadrillion_and_one_dalmatians())

Failing test case input:
1930001

Expected output:
detzu


Actual output:
deu`u


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

    ans = []
    while N != 0:
        q, r = divmod(N, 26)
        if r == 0:
            ans.append(26)
            q -= 1
        else:
            ans.append(r)
        N = q
    ans = [chr(ord('a') + a - 1) for a in ans]
    return ''.join(reversed(ans))

print(c_one_quadrillion_and_one_dalmatians())

Problem: p02629
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N, = map(int, input().split())
al = "zabcdefghijklmnopqrstuvwxy"
rs = []
while N:
    N, m = divmod(N, 26)
    rs.append(al[m])
print("".join(rs[::-1]))


Failing test case input:
3543607

Expected output:
gsozo


Actual output:
gspzo


Fixed submission (verdict: Accepted):
N, = map(int, input().split())
al = "zabcdefghijklmnopqrstuvwxy"
rs = []
while N:
    m = N%26
    N = -(-N
    rs.append(al[m])
print("".join(rs[::-1]))

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    N = int(input())
    alpha = "abcdefghijklmnopqrstuvwxyz"

    digi = list()
    for i in range(1, 13):
        if N == 0:
            break
        r, m = divmod(N, 26)
        digi.append(m)
        N = r

    ans = ""
    digi.reverse()

    for d in digi:
        ans += alpha[d - 1]

    print(ans)

if __name__ == "__main__":
    main()

Failing test case input:
3667940

Expected output:
gzqxp


Actual output:
hzqxp


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    alpha = "abcdefghijklmnopqrstuvwxyz"

    l = 0
    for i in range(1, 12):
        if N - 26 ** i > 0:
            N -= 26 ** i
            l = i
        else:
            break

    l += 1
    N -= 1

    if N == -1:
        N = 26**l - 1

    digi = list()
    for i in range(1, l + 1):
        r, m = divmod(N, 26)
        digi.append(m)
        N = r

    ans = ""
    for d in digi:
        ans += alpha[d]

    print(ans[::-1])

if __name__ == "__main__":
    main()

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    N = int(input())

    aord = ord('a')
    ans = ''
    
    while N:
        N, Nmod = divmod(N, 26)
        if Nmod:
            ans = chr(aord + Nmod - 1) + ans

    print(ans)


if __name__ == '__main__':
	main()

exit()


Failing test case input:
3667940

Expected output:
gzqxp


Actual output:
hqxp


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

    aord = ord('a')
    ans = ''
    
    while N:
        N, Nmod = divmod(N, 26)
        if Nmod:
            ans = chr(aord + Nmod - 1) + ans
        else:
            ans = chr(aord + 25) + ans
            N -= 1

    print(ans)


if __name__ == '__main__':
	main()

exit()
Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
res = ''
while n > 0:
    n, t = divmod(n, 26)
    if t == 0:
        t = 26
    res += chr(96+t)
print(res[::-1])

Failing test case input:
71095103

Expected output:
eynzga


Actual output:
eyozga


Fixed submission (verdict: Accepted):
n = int(input())
res = ''
while n > 0:
    n, t = divmod(n, 26)
    if t == 0:
        t = 26
        n -= 1
    res += chr(96+t)
print(res[::-1])

Problem: p02629
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
def change(x):
    return chr(ord('a')+int(x)-1)
def helper(N,x):
    if (int(N/x)):
        return helper(int(N/x),x)+change(N%x)
    return change(N%x)
print(helper(N,26))

Failing test case input:
72618

Expected output:
dcjz


Actual output:
dck`


Fixed submission (verdict: Accepted):
N = int(input())
def change(x):
    if x==0: x=26
    return chr(ord('a')+int(x)-1)
def helper(N,x):
    if N<=26: return change(N)
    if (int(N/x)):
        if N%x !=0:
            return helper(int(N/x),x)+change(N%x)
        else:
            return helper(int(N/x)-1,x)+change(N%x)
print(helper(N,26))

Problem: p02629
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def resolve():
    n=int(input())
    abcd = 'abcdefghijklmnopqrstuvwxyz'
    s=""
    while True:
        a=n%26
        s=abcd[a-1]+s
        n=int((n-a)/26)
        if n==0:
            break
    print(s)
resolve()

Failing test case input:
12558

Expected output:
rnz


Actual output:
roz


Fixed submission (verdict: Accepted):
def resolve():
    n=int(input())
    abcd = 'abcdefghijklmnopqrstuvwxyz'
    s=""
    while True:
        a=n%26
        if a==0:
            a=26
        s=abcd[a-1]+s
        n=int((n-a)/26)
        if n==0:
            break
    print(s)
resolve()

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())-1
mod = [N%26]
while N>=26:
    N = int(N/26)
    mod.append(N%26-1)
    
mod.reverse()
ans = [chr(i+ord('a')) for i in mod]
print(''.join(ans))

Failing test case input:
2088844

Expected output:
dnuzd


Actual output:
dnv`d


Fixed submission (verdict: Accepted):
N = int(input())
ans = ['']

while N>0:
    N = N - 1
    ans.append(chr(int(N%26+1)+ord('a')-1))
    N = int(N/26)
    
ans.reverse()
print(''.join(ans))

Problem: p02629
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
OFFSET = 97
def main():
    n = int(input()) - 1
    if n==0:
        print('a')
        return 
    ans = []
    while n!=0:
        n,mod = divmod(n,26)
        ans.append(chr(mod+OFFSET))
    print(''.join(ans)[::-1])
    return

if __name__ == '__main__':
    main()

Failing test case input:
5237268

Expected output:
kkykj


Actual output:
llzlj


Fixed submission (verdict: Accepted):
OFFSET = 97
def main():
    n = int(input())

    ans = []
    while True:
        n -= 1
        n,mod = divmod(n,26)
        ans.append(chr(mod+OFFSET))
        if n==0:
            break
    print(''.join(ans)[::-1])
    return

if __name__ == '__main__':
    main()
Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = ""
while n > 0:
  n, r = divmod(n, 26)
  if r == 0:
    r = 26
  a += chr(r-1 + ord('a'))
print(a)

Failing test case input:
3298746

Expected output:
geqtv


Actual output:
vtqeg


Fixed submission (verdict: Accepted):
n = int(input())
a = ""
while n > 0:
  n, r = divmod(n, 26)
  if r == 0:
    r = 26
    n -= 1
  a += chr(r-1 + ord('a'))
print(a[::-1])

Problem: p02629
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import string
N = int(input())
ANS =[]
while N>1:
    M=int(N%26)
    N=N-M
    ANS.insert(0,string.ascii_lowercase[M-1])
    N=N-M
    N=N/26
    
map = map(str,ANS)
print(''.join(map))

Failing test case input:
121050

Expected output:
fwat


Actual output:
ewzt


Fixed submission (verdict: Accepted):
import string
N = int(input())
ANS =[]
while N>0:
    M=int(N%26)
    if M==0:
        M=26
    ANS.insert(0,string.ascii_lowercase[M-1])
    N=N-M
    N=N/26
    
map = map(str,ANS)
print(''.join(map))

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
l=[]
while(n>0):
    l.append(chr(96+(n%26)))
    n=int(n/26)
l=l[::-1]
print("".join(l))

Failing test case input:
3667940

Expected output:
gzqxp


Actual output:
h`qxp


Fixed submission (verdict: Accepted):
n=int(input())
l=[]
while(n!=0):
    n=n-1
    l.append(chr(ord('a')+(n%26)))
    n=int(n/26)
l=l[::-1]
print("".join(l))

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

while  N  > 0:
    name = []
    N, mod = divmod(N, 26)
    name.insert(0,chr(96+mod))
name=' '.join(name)
print(name)

Failing test case input:
3604887

Expected output:
gwbqm


Actual output:
g


Fixed submission (verdict: Accepted):
name = []
N = int(input())

while  N  > 0:
    N, mod = divmod((N-1), 26)
    name.insert(0,chr(97+mod))
name=''.join(name)
print(name)

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

alphbet = lambda c: chr(c+64)

def Base_10_to_n(X, n):
    X_dumy = X
    out = []
    while X_dumy>0:
        out.append(X_dumy%n)
        X_dumy = int(X_dumy/n)
    return out
out = Base_10_to_n(x, 26)[::-1]
print( "".join(alphbet(i) for i in out).lower() )

Failing test case input:
2088844

Expected output:
dnuzd


Actual output:
dnv@d


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

alphbet = lambda c: chr(c+64)

def Base_10_to_n(X, n):
    X_dumy = X
    out = []
    while X_dumy > 0:
      if X_dumy % n == 0:
        out.append( 26 )
        X_dumy = int(X_dumy / n - 1)
      else:
        out.append( X_dumy % n )
        X_dumy = int(X_dumy / n)
    return out
if 1 <= x <= 1000000000000001:
    out = Base_10_to_n(x, 26)[::-1]
    print( "".join(alphbet(i) for i in out).lower())
Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def resolve():
    
    from collections import deque
    S = "abcdefghijklmnopqrstuvwxyz"
    N = int(input())
    tmp = N
    A = deque()
    while True:
        N, a = divmod(N, 26)
        A.append(a)
        if N == 0:
            break
    if tmp % 26 == 0:
        A.pop()
    for a in reversed(A):
        print(S[a - 1], end="")
    print()


resolve()


Failing test case input:
2054

Expected output:
bzz


Actual output:
az


Fixed submission (verdict: Accepted):
def resolve():
    from collections import deque
    S = "abcdefghijklmnopqrstuvwxyz"
    N = int(input())
    A = deque()
    while True:
        N -= 1
        N, a = divmod(N, 26)
        A.appendleft(a)
        if N == 0:
            break
    for a in A:
        print(S[a], end="")
    print()


resolve()

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    N = int(input())
    alpha = "abcdefghijklmnopqrstuvwxyz"

    digi = list()
    for i in range(1, 100):
        if N == 0:
            break
        r, m = divmod(N, 26)
        digi.append(m)
        N = r

    ans = ""
    digi.reverse()

    for d in digi:
        ans += alpha[d - 1]

    print(ans)

if __name__ == "__main__":
    main()

Failing test case input:
1930001

Expected output:
detzu


Actual output:
deuzu


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    alpha = "abcdefghijklmnopqrstuvwxyz"

    l = 0
    for i in range(1, 12):
        if N - 26 ** i > 0:
            N -= 26 ** i
            l = i
        else:
            break

    l += 1
    N -= 1

    if N == -1:
        N = 26**l - 1

    digi = list()
    for i in range(1, l + 1):
        r, m = divmod(N, 26)
        digi.append(m)
        N = r

    ans = ""
    for d in digi:
        ans += alpha[d]

    print(ans[::-1])

if __name__ == "__main__":
    main()

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
x=26
i=0
l=["a","b","c","d","e","f","g","h","i","j","k","l","m","o","p","q","r","s","t","u","v","w","x","y","z"]
r=[]
while n > 0:
    y=n%x-1
    r.append(l[y])
    n=int((n-1)/x)
r=r[::-1]
print("".join(r))


Failing test case input:
56744729

Expected output:
dtdmwo


Actual output:
dudmxp


Fixed submission (verdict: Accepted):
n=int(input())
x=26
l=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
r=[]
while n > 0:
    r.append(l[n%x-1])
    n=int((n-1)/x)
r=r[::-1]
print("".join(r))

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
s=''
while n!=0:
    n,v=divmod(n,26)
    s+=chr(96+v)
print(s[::-1])

Failing test case input:
1388428

Expected output:
bzywb


Actual output:
c`ywb


Fixed submission (verdict: Accepted):
n=int(input())
s=''
while n!=0:
    n,v=divmod(n,26) if n%26 else (n
    s+=chr(96+v)
    
print(s[::-1])
Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())

a=[]
for i in range(20):
    s=int(N%26)
    N=int(N/26)
    a.append(s)
    if N<1:
        break

a=a[::-1]
for i in range(len(a)):
    a[i]=chr(a[i]+96)

print("".join(a))

Failing test case input:
3667940

Expected output:
gzqxp


Actual output:
h`qxp


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

a=[]
for i in range(20):
    if N%26==0:
        s=26
        N=int(N/26)-1
    else:
        s=int(N%26)
        N=int(N/26)
    
    a.append(s)
    if N<1:
        break

a=a[::-1]
for i in range(len(a)):
    a[i]=chr(a[i]+96)

print("".join(a))

Problem: p02629
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
tmp_n = N
ans = []
while True:
    s, r = divmod(tmp_n, 26)
    if r == 0:
        r = 26
    ans.append(chr(r+96))
    tmp_n = s
    if s == 0:
        break
print("".join(ans[::-1]))


Failing test case input:
2088844

Expected output:
dnuzd


Actual output:
dnvzd


Fixed submission (verdict: Accepted):
N = int(input())
ans = []
tmp_n = N
while True:
    s, r = divmod(tmp_n, 26)
    if r == 0:
        r = 26
        s -= 1
    ans.append(chr(r+96))
    tmp_n = s
    if s <= 0:
        break
print("".join(ans[::-1]))

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



def main():
    N = int(input().strip())
    ans = ""
    while N > 0:
        N, m = divmod(N, 26)
        ans = chr(0x60 + m) + ans

    return ans


if __name__ == "__main__":
    print(main())

Failing test case input:
71095103

Expected output:
eynzga


Actual output:
eyo`ga


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



def main():
    N = int(input().strip())
    ans = ""

    while N > 0:
        N, m = divmod(N, 26)
        if m == 0:
            N -= 1
            ans = chr(0x7A) + ans
        else:
            ans = chr(0x60 + m) + ans

    return ans


if __name__ == "__main__":
    print(main())

Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n = int(input())
    n -= 1
    res = ''
    while n > 0:
        n, m = divmod(n, 26)
        res += chr(97 + m)
        n -= 1

    print(res[::-1])


if __name__ == '__main__':
    main()


Failing test case input:
1336

Expected output:
ayj


Actual output:
yj


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    n -= 1
    res = ''
    while n >= 0:
        n, m = divmod(n, 26)
        res += chr(97 + m)
        n -= 1

    print(res[::-1])


if __name__ == '__main__':
    main()
Problem: p02629
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
string = 'abcdefghijklmnopqrstuvwxyz'

num = int(input())
ans = ""
while num != 0:
    num, m = divmod(num, 26)
    if num == 1 and m == 0:
        ans = string[m-1] + ans
        num = 0
    else:
        ans = string[m-1] + ans

print(ans)

Failing test case input:
2088844

Expected output:
dnuzd


Actual output:
dnvzd


Fixed submission (verdict: Accepted):
string = 'abcdefghijklmnopqrstuvwxyz'

num = int(input())
ans = ""
while num != 0:
    num, m = divmod(num, 26)
    if m == 0:
        ans = string[m-1] + ans
        num = num - 1
    else:
        ans = string[m-1] + ans

print(ans)
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def Atcoder111(n):

    ans = ""

    if int(n[0]) >= int(n[1]) >= int(n[2]):
        ans = n[0]*3
    else:
        ans = int(n[0]*3)
        ans += 111

    return ans

def main():
    n = str(input())
    print(Atcoder111(n))

if __name__ == '__main__':
    main()

Failing test case input:
846

Expected output:
888


Actual output:
999


Fixed submission (verdict: Accepted):
def Atcoder111(n):

    ans = ""

    if int(n[0]) > int(n[1]) or int(n[0]) == int(n[1]) >= int(n[2]):
        ans = n[0]*3
    else:
        ans = int(n[0]*3)
        ans += 111

    return ans

def main():
    n = str(input())
    print(Atcoder111(n))

if __name__ == '__main__':
    main()

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
str_input = input()
num_list = list(str_input)
next_stage = 0

num1 = int(num_list[0])
num2 = int(num_list[1])
num3 = int(num_list[2])

def change_nums( num ):
    return num*100+num*10+num


if num1 > num2:
    next_stage = change_nums( num1 )
elif num1==num2==num3:
    next_stage = change_nums( num1 )
else:
    next_stage = change_nums( num1+1 )

print(next_stage)

Failing test case input:
662

Expected output:
666


Actual output:
777


Fixed submission (verdict: Accepted):
str_input = input()
num_list = list(str_input)
next_stage = 0

num1 = int(num_list[0])
num2 = int(num_list[1])
num3 = int(num_list[2])

def change_nums( num ):
    return num*100+num*10+num


if num1 > num2:
    next_stage = change_nums( num1 )
elif num1==num2==num3:
    next_stage = change_nums( num1 )
elif num1==num2 and num1 > num3:
    next_stage = change_nums( num1 )
else:
    next_stage = change_nums( num1+1 )

print(next_stage)

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

def main():
  input = sys.stdin.readline
  N = str(input())
  L = len(N)
  f = N[0]
  a = f * L
  b = str(int(f) + 1) * L
  
  if int(a) >= int(N):
    print(int(a))
  else:
    print(int(b))


if __name__ == '__main__':
  main()

Failing test case input:
662

Expected output:
666


Actual output:
6666


Fixed submission (verdict: Accepted):
import sys

def main():
  input = sys.stdin.readline
  N = str(input().strip())
  L = len(N)
  f = N[0]
  a = f * L
  b = str(int(f) + 1) * L
  
  if int(a) >= int(N):
    print(int(a))
  else:
    print(int(b))


if __name__ == '__main__':
  main()

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

Failing test case input:
528

Expected output:
555


Actual output:
528


Fixed submission (verdict: Accepted):
n=int(input())
while n%111!=0:
    n = n+1
print(n)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inp = int(input())
ret = 0
for i in range(1, 9):
    ret = i*111
    if ret >= inp:
        break
print(ret)

Failing test case input:
985

Expected output:
999


Actual output:
888


Fixed submission (verdict: Accepted):
inp = int(input())
ret = 0
for i in range(1, 10):
    ret = i*111
    if ret >= inp:
        break
print(ret)
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
if int(N[0]) > int(N[1]) or (int(N[0]) == int(N[1]) >= int(N[2])):
    print(N[0]+N[1]+N[2])
else:
    print(str(int(N[0])+1)+str(int(N[0])+1)+str(int(N[0])+1))


Failing test case input:
437

Expected output:
444


Actual output:
437


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

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

t = 0
    
while t*111 < n < (t+1)*111:
    t += 1
    
print(t*111)

Failing test case input:
528

Expected output:
555


Actual output:
0


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

t = 0
    
while t*111 < n  and n > (t+1)*111:
    t += 1
    
print((t+1)*111)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
ans=N
while(True):
  if len(set(str(ans).split()))==1:
    print(ans)
    break
  else:
    ans+=1

Failing test case input:
985

Expected output:
999


Actual output:
985


Fixed submission (verdict: Accepted):
N=int(input())
ans=N
while(True):
  if len(set(list(str(ans))))==1:
    print(ans)
    break
  else:
    ans+=1

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
for m in range(0,11):
 if 2+110*m<=n<=111+110*m:
  print(111*m+111)

Failing test case input:
662

Expected output:
666


Actual output:
777


Fixed submission (verdict: Accepted):
n=int(input())
for m in range(0,11):
 if 1+111*m<=n<=111+111*m:
  print(111*m+111)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
for i in range(9):
    if 111 * i >= n:
        print(111*i)
        exit(0)

Failing test case input:
985

Expected output:
999


Actual output:

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

Problem: p03243
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def main():
    N = input()
    
    ans = 0
    for n in N:
        if ans < int(n):
            ans = int(n)

    print(str(ans)*3)



main()

Failing test case input:
528

Expected output:
555


Actual output:
888


Fixed submission (verdict: Accepted):
def main():
    N = input()
    
    if int(N) <= int(N[0]*3):
        print(N[0]*3)
    else:
        print(str(int(N[0]) + 1) * 3)



main()

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 and b==c:
    print(i)
    break

Failing test case input:
662

Expected output:
666


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):
n=int(input())

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

Failing test case input:
985

Expected output:
999


Actual output:

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

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

Problem: p03243
Buggy submission (Python (3.8.2), 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())

answer = 0

for i in range(N, 999):
  string = list(str(i))
  flag = 0
  for s in string:
    if s != string[0]:
      flag = 1
  if flag == 0:
    answer = i
    break

print(answer)

Failing test case input:
985

Expected output:
999


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
 
for i in range(N, 1000):
  string = list(str(i))
  flag = 0
  for s in string:
    if s != string[0]:
      flag = 1
  if flag == 0:
    answer = i
    break
 
print(answer)

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

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

Problem: p03243
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = 0
for i in range(N,999):
  if i == 111 or i == 222 or i == 333 or i ==444 or i ==555 or i == 666 or i ==777 or i ==888 or i == 999:
    a = i
    break
print(a)

Failing test case input:
985

Expected output:
999


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
a = 0
for i in range(N,1000):
  if i == 111 or i == 222 or i == 333 or i ==444 or i ==555 or i == 666 or i ==777 or i ==888 or i == 999:
    a = i
    break
print(a)

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

Failing test case input:
662

Expected output:
666


Actual output:
777


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

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



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

Failing test case input:
528

Expected output:
555


Actual output:
888


Fixed submission (verdict: Accepted):



N = 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)
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(8):
        if (i+1)*111-N>0:
            print((i+1)*111)
            break
        else:
            continue


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(9):
        if (i+1)*111-N>0:
            print((i+1)*111)
            break
        else:
            continue

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print((int(input()) + 110) / 111 * 111)

Failing test case input:
543

Expected output:
555


Actual output:
653.0


Fixed submission (verdict: Accepted):
print(((int(input()) + 110)

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
nx = input('n?\n')
n=int(nx)
x=111
for i in range (111,n,111):
    x+=111
print(x)


Failing test case input:
752

Expected output:
777


Actual output:
n?
777


Fixed submission (verdict: Accepted):
nx = input()
n=int(nx)
x=111
for i in range (111,n,111):
    x+=111
print(x)

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

Failing test case input:
543

Expected output:
555


Actual output:
666


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.4.3), verdict: Wrong Answer):
n = int(input())

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

Failing test case input:
985

Expected output:
999


Actual output:
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.4.3), verdict: Wrong Answer):
n = input()
a = n[0]
if n[1] < a and n[2] < a:
  print(a+a+a)
elif n[1] == a and n[2] == a:
  print(n)
else:
  b = str(int(a) + 1)
  print(b+b+b)

Failing test case input:
437

Expected output:
444


Actual output:
555


Fixed submission (verdict: Accepted):
n = input()
a = n[0]
if (n[1] <= a and n[2] < a) or (n[1] < a):
  print(a+a+a)
elif n[1] == a and n[2] == a:
  print(n)
else:
  b = str(int(a) + 1)
  print(b+b+b)

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

Failing test case input:
543

Expected output:
555


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
i = int(N/111)
if N % 111 != 0:
  i = i + 1
else:
  i = i
print(i*111)
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=list(input())

if int(n[0])>=int(n[1])>=int(n[2]):
    ans = [n[0]]*3
else:
    ans = [int(n[0])+1]*3
print(*ans,sep="")

Failing test case input:
846

Expected output:
888


Actual output:
999


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

if int(n[0])>int(n[1]):
    ans = [n[0]]*3
elif int(n[0])==int(n[1]) and int(n[1])>=int(n[2]):
    ans = [n[0]]*3
else:
    ans = [int(n[0])+1]*3
print(*ans,sep="")
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
while True:
  if len(set(str(N))):
    print(N)
    break
  N += 1

Failing test case input:
437

Expected output:
444


Actual output:
437


Fixed submission (verdict: Accepted):
N = int(input())
while True:
  if len(set(str(N))) == 1:
    print(N)
    break
  N += 1

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
if 100<=n>=111: print(111)
elif 112<=n>=222:print(222)
elif 223<=n>=333:print(333)
elif 334<=n>=444:print(444)
elif 445<=n>=555:print(555)
elif 556<=n>=666:print(666)
elif 667<=n>=777:print(777)
elif 778<=n>=888:print(888)
else:print(999)

Failing test case input:
543

Expected output:
555


Actual output:
111


Fixed submission (verdict: Accepted):
n=int(input())
if 100<=n<=111: print(111)
elif 112<=n<=222:print(222)
elif 223<=n<=333:print(333)
elif 334<=n<=444:print(444)
elif 445<=n<=555:print(555)
elif 556<=n<=666:print(666)
elif 667<=n<=777:print(777)
elif 778<=n<=888:print(888)
else:print(999)

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

Failing test case input:
662

Expected output:
666


Actual output:

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.8.2), verdict: Wrong Answer):
N=int(input())
for i in range(1,10):
  if 111*i<=N:
    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 111*i>=N:
    print(111*i)
    break

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


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
while n <= 999 :
  if list(str(n)[0]) == list(str(n)[1]) == list(str(n)[2]):
    print(n)
    exit()
  else:
    n += 1

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)
elif h == 9:
    print(999)
else:
    h += 1
    print(h*111)

Failing test case input:
662

Expected output:
666


Actual output:
777


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())
query =[]
for i in range(1,9):
  query.append(int(111*i))
for j in query:
  if j >= n:
   print(j)
   break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
query =[]
for i in range(1,10):
  query.append(int(111*i))
for j in query:
  if j >= n:
   print(j)
   break
Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
for i in range(999-n):
      if n%111==0:
            print(n)
            break
      else:
            n+=1


Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n=int(input())
for i in range(999):
      if n%111==0:
            print(n)
            break
      else:
            n+=1

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

input = sys.stdin.readline


def main():
    n = input().strip()
    if len(set(n)) == 1:
        print(n)
    else:
        print(str(int(n[0]) + 1) * 3)


if __name__ == "__main__":
    main()


Failing test case input:
543

Expected output:
555


Actual output:
666


Fixed submission (verdict: Accepted):
import sys

input = sys.stdin.readline


def main():
    n = input().strip()
    if len(set(n)) == 1:
        print(n)
    elif int(n) < int(n[0] * 3):
        print(int(n[0] * 3))
    else:
        print(str(int(n[0]) + 1) * 3)


if __name__ == "__main__":
    main()

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

for n in range(N, 999):
    str_n = str(n)
    if str_n[0] == str_n[1] and str_n[1] == str_n[2]:
        print(n)
        break
    else:
        pass


Failing test case input:
985

Expected output:
999


Actual output:

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

for n in range(N, 1000):
    str_n = str(n)
    if str_n[0] == str_n[1] and str_n[1] == str_n[2]:
        print(n)
        break
    else:
        pass

Problem: p03243
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=[99,111,222,333,444,555,666,777,888,999]
for i in range(len(a)-2):
    if n==a[i]:
        print(n)
        break
    if a[i]<n<a[i+1]:
        print(a[i+1])
        break

Failing test case input:
985

Expected output:
999


Actual output:

Fixed submission (verdict: Accepted):
n=int(input())
a=[99,111,222,333,444,555,666,777,888,999,1000]
for i in range(len(a)-1):
    if n==a[i]:
        print(n)
        break
    if a[i]<n<a[i+1]:
        print(a[i+1])
        break

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

base = int(x)

xs = [x for x in [int(c*3) for c in set(x) ] if x >= base ]
print(sorted(xs).pop())

Failing test case input:
528

Expected output:
555


Actual output:
888


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

base = int(x)

xs = [x for x in [int(c*3) for c in set('123456789') ] if x >= base ]
print(sorted(xs).pop(0))

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


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+1) >= n:
        print(111*(i+1))
        break