Problem:


Score : 100 points

Problem Statement

Cat Snuke is learning to write characters.
Today, he practiced writing digits 1 and 9, but he did it the other way around.

You are given a three-digit integer n written by Snuke.
Print the integer obtained by replacing each digit 1 with 9 and each digit 9 with 1 in n.

Constraints

111 \leq n \leq 999

n is an integer consisting of digits 1 and 9.

Input

Input is given from Standard Input in the following format:

n

Output

Print the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n.

Sample Input 1

119

Sample Output 1

991

Replace the 9 in the ones place with 1, the 1 in the tens place with 9 and the 1 in the hundreds place with 9. The answer is 991.

Sample Input 2

999

Sample Output 2

111



Sample input:
119


Sample output:
991

Submission status: Wrong Answer

Solution code:
n=str(input())
print(n.replace("1","9").replace("9","1").replace("1","a").replace("9","a"))

Submission status: Wrong Answer

Solution code:
n=input()
print(n.replace("1","9").replace("9","1"))

Submission status: Wrong Answer

Solution code:
n = input()
ans = ''
for s in range(3):
    if s == '9':
        ans += '1'
    else:
        ans += '9'
print(ans)

Submission status: Wrong Answer

Solution code:
n = input()

n.replace('1', 'w')
n.replace('9', '1')
n.replace('w', '9')

print(n)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[111,222,333,444,555,666,777,888,999]
ans=[]
for i in range(9):
    if l[i]-n>=0:
        ans.append(i)
        
print(l[ans[0]])

Submission status: Wrong Answer

Solution code:
a=input()
if int(a) <= int(a[0])*111:
  print(int(a[0])*111)
else:
  print((int(a[0])+1)*111)

Submission status: Wrong Answer

Solution code:

n =  input()

true_num = []
if '1' in n or '9' in n:
    for i in range(3):
        if n[i] == '1' :
            true_num.append('9')
        elif n[i] == "9":
            true_num.append('1')
        else:
            true_num.append(n[i])
    print(true_num)
else:
    print(n)

Submission status: Wrong Answer

Solution code:
n=input()
ans=[]
for i in n:
    if i==1:
        ans.append(9)
    elif i==9:
        ans.append(1)
    else:
        ans.append(i)
print("".join(x for x in ans))

Submission status: Wrong Answer

Solution code:
n=input()
ans=[]
for i in n:
    if i==1:
        ans.append(9)
    elif i==9:
        ans.append(1)
    else:
        ans.append(i)
print(str(ans[0])+str(ans[1])+str(ans[2]))

Submission status: Wrong Answer

Solution code:
n = input()

print(n.replace("1","9"))

Submission status: Wrong Answer

Solution code:
n = input()
n.replace('1', 'a').replace('9', 'b').replace('a', '9').replace('b', '1')
print(n)

Submission status: Wrong Answer

Solution code:
n = input()
n = list(n)
if n[0] == "1":
    print(9, end='')
if n[1] == str(1):
    print(9, end="")
if n[2] == str(1):
    print(9)
if n[0] == str(9):
    print(1, end="")
if n[1] == str(9):
    print(1, end="")
if n[2] == str(9):
    print(1)

Submission status: Wrong Answer

Solution code:
n = input()
n = list(n)
if n[0] == "1":
    print(9, end='')
if n[1] == str(1):
    print(9, end="")
if n[2] == str(1):
    print(9)
if n[0] == str(9):
    print(1, end="")
if n[1] == str(9):
    print(1, end="")
if n[2] == str(9):
    print(1)

Submission status: Wrong Answer

Solution code:
n = input()
n = list(n)
if n[0] == "1":
    print(9, end='')
if n[1] == str(1):
    print(9, end="")
if n[2] == str(1):
    print(9, end="")
if n[0] == str(9):
    print(1, end="")
if n[1] == str(9):
    print(1, end="")
if n[2] == str(9):
    print(1, end="")

Submission status: Wrong Answer

Solution code:
input().replace("1", "@").replace("9", "1").replace("@", "9")

Submission status: Wrong Answer

Solution code:
n = str(input())
print(n.replace('1', 'a').replace('9', '1').replace('a', '1'))

Submission status: Wrong Answer

Solution code:
n = input()
print(n.replace('1', 'a').replace('9', '1').replace('a', '1'))

Submission status: Wrong Answer

Solution code:
s = input()
changer = {"1":"9", "9":"1"}
answer = ""
for chr in s:
  answer = changer[chr] + answer
print(int(answer))

Submission status: Wrong Answer

Solution code:
N = str(input())

print(N.replace('1', '9').replace('9', '1'))

Submission status: Wrong Answer

Solution code:
S = input()
ans = ""
for s in S:
    if s == 9:
        ans += "1"
    elif s == 1:
        ans += "9"
    else:
        ans += s
print(int(ans))

Submission status: Wrong Answer

Solution code:
S = input()
ans = ""
for s in S:
    if s == 9:
        ans += "1"
    elif s == 1:
        ans += "9"
    else:
        ans += s
print(ans)

Submission status: Wrong Answer

Solution code:
print(((int(input())-1)//111+1)*111)

Submission status: Wrong Answer

Solution code:
input_int = input()
if input_int[0] > input_int[1]:
  print(input_int[0] * 3)
elif input_int[0] == input_int[1] and  input_int[1] < input_int[2]:
  print(str(int(input_int[0]) + 1) * 3)
else:
  print(input_int[0] * 3)

Submission status: Wrong Answer

Solution code:
def henkan(str):
    for s in str:
        print('1' if s == '9' else '9',end='')
        print('')
henkan(input())

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=111
while a>ans:
  ans+=111
print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=0
while a>=ans:
  ans+=111
print(ans)

Submission status: Wrong Answer

Solution code:
for i in input():
  print(9 if i == "1" else 1)
print()

Submission status: Wrong Answer

Solution code:
for i in input():
  print(9 if i == "1" else 1, end = "")
  print()

Submission status: Wrong Answer

Solution code:
n = input()
print(n.replace('9','1').replace('1','9'))

Submission status: Wrong Answer

Solution code:
# coding : UTF-8

from sys import stdin

N = stdin.readline().rstrip()

def main():
    if int(N) <= int(N[0]*len(N)):
        print(N[0]*len(N))
    else:
        print((str(int(N[0])+1))*len(N))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=input()
ans=''
for i in range(len(n)):
    if n[i]==1:
        ans+='9'
    else:
        ans+='1'
print(ans)

Submission status: Wrong Answer

Solution code:
n = input()
print(n.replace('9', '1').replace('1', '9'))

Submission status: Wrong Answer

Solution code:
n = input()
print(n.replace('1','9').replace('9','1'))

Submission status: Wrong Answer

Solution code:
n = int(input())
K = 0
for i in range(3):
  l = n//(10**i)
  if(l == 1):
    K+=9*(10**i)
  else:
    K+=1*(10**i)
print(K)

Submission status: Wrong Answer

Solution code:
a =input()
aa =a.replace('9','1').replace('1','9')
print(aa)

Submission status: Wrong Answer

Solution code:
a =list(input())
for v in a:
  if v =='9':
    v=='1'
  elif v =='1':
    v =='9'
print(str(a))

Submission status: Wrong Answer

Solution code:
a =list(input())
for v in a:
  if v =='9':
    v=='1'
  elif v =='1':
    v =='9'
print(a)

Submission status: Wrong Answer

Solution code:
S = input()
c = ''
for i in range(len(S)):
  if S[i] == '9':
    c += '1'
  elif S[i] == '1':
    c += '9'
  else:
    c += S[i]
print(S)

Submission status: Wrong Answer

Solution code:
print(1100 - int(input()))

Submission status: Wrong Answer

Solution code:
a = int(input())
 
print(1000-a)

Submission status: Wrong Answer

Solution code:
n = list(input())
for i in range(len(n)):
  if n[i] == 1:
    print(9, end="")
  else:
    print(1, end="")

Submission status: Wrong Answer

Solution code:
n = int(input())
print(1100-n)

Submission status: Wrong Answer

Solution code:
n = input()
print(n.replace('1', '9').replace('9', '1'))

Submission status: Wrong Answer

Solution code:
n = int(input())

print(1000-n)

Submission status: Wrong Answer

Solution code:
N = input()
 
if int(N) <= int(N[0] * 3):
    print(int(N[0] * 3))
else:
    print(int(str((int(N[0]) + 1)) * 3))

Submission status: Wrong Answer

Solution code:
a=list(input())
for i in range(len(a)):
  if a[i]=="1":
    a[i]="9"
  else:
    a[i]="1"
print(*a)

Submission status: Wrong Answer

Solution code:
S=input()
A=""
for i in range(len(S)):
  if S[i]=="1":
    A+="9"
  else:
    A+="1"
print(int(S))

Submission status: Wrong Answer

Solution code:
i=list(input())
for j in i:
  if j=="9":
    j=1
  else:
    j=9
print("".join(i))

Submission status: Wrong Answer

Solution code:
n = [int(s) for s in input().split()]
len = len(n)
i = 0
while i < len:
  if n[i] == 1:
    n[i] = 9
  elif n[i] == 9:
    n[i] = 1
  else:
    None
  i += 1
print(n)

Submission status: Wrong Answer

Solution code:
n = input()

n.replace("1", "9")
n.replace("9", "1")

print(n)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = input()
n = n.replace('9', '1')
print(n.replace('1', '9'))

Submission status: Wrong Answer

Solution code:
n=input()
swap=""
for i in n:
    if i=="1":
        swap+="9"
    elif i=="9":
        swap+="1"
    else:
        swap+=i
print(swap[-1::-1])

Submission status: Wrong Answer

Solution code:
input = str(input())
input.replace('9', '_').replace('1', '9').replace('_', '1')
print(input)

Submission status: Wrong Answer

Solution code:
n=input()

n.replace("9", "a")
n.replace("1", "b")
n.replace("a", "1")
n.replace("b", "9")

print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

for i in str(n):
  if i=='1':
    i=9
  elif i=='9':
    i=1
  else:
    pass

Submission status: Wrong Answer

Solution code:
data = input()

sc = 0
ans = []
if (data[0] == data[1]) & (data[0] == data[2]):
    data = int(data)
    print(data)
elif int(data[0]) >= int(data[1]):
    sc = int(data[0])
    ans = 100 * sc + 10 * sc + sc
    print(ans)
else:
    sc = int(data[0]) + 1
    ans = 100* sc + 10 * sc + sc
    print(ans)

Submission status: Wrong Answer

Solution code:
data = input()

sc = 0
ans = []
if (data[0] == data[1]) & (data[0] == data[2]):
    data = int(data)
    print(data)
elif int(data[0]) > int(data[1]):
    sc = int(data[0])
    ans = 100 * sc + 10 * sc + sc
    print(ans)
else:
    sc = int(data[0]) + 1
    ans = 100* sc + 10 * sc + sc
    print(ans)

Submission status: Wrong Answer

Solution code:
str = list(input())
print(int(str[2])*100+int(str[1])*10+int(str[0]))

Submission status: Wrong Answer

Solution code:
import scipy.sparse.csgraph

Submission status: Wrong Answer

Solution code:
N=input()
answer=""
if N[0]==1:
  answer+="9"
else:
  answer+="1"
if N[1]==1:
  answer+="9"
else:
  answer+="1"
if N[1]==1:
  answer+="9"
else:
  answer+="1"
print(answer)

Submission status: Wrong Answer

Solution code:
l=input();x=l[0];print(x*3 if int(l) <= int(x*3) else str(int(x)+1)*3)

Submission status: Wrong Answer

Solution code:
a=input()
a.replace("1","2")
a.replace("9","1")
a.replace("2","9")
print(a)

Submission status: Wrong Answer

Solution code:
n = str(input())
s = ''
for i in range(2):
  if n[i] == '1':
    s += '9'
  elif n[i] == '9':
    s += '1'
  else:
    s += n[i]
print(s)

Submission status: Wrong Answer

Solution code:
n = str(input())

if int(n[0]) > int(n[1]):
	out = n[0]*3
elif n[0] == 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)

Submission status: Wrong Answer

Solution code:
n = str(input())

if int(n[0]) < int(n[1]):
	out = str(int(n[0])+1)*3
elif n[0] == 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)

Submission status: Wrong Answer

Solution code:
n = str(input())
one_idx = []
nine_idx = []
print(n)
for idx in range(len(n)):
	if n[idx]=='1':
		one_idx.append(idx)
	if n[idx]=='9':
		nine_idx.append(idx)

out = ''
for idx in range(len(n)):
	if idx in one_idx:
		out += '9'
	if idx in nine_idx:
		out += '1'
          
print(out)

Submission status: Wrong Answer

Solution code:
A = input()
for a in A:
  if a == 1:
    print("9", end="")
  else:
    print("1", end="")
print("")

Submission status: Wrong Answer

Solution code:
n=input()
print(int("".join(["1" if n[i]==9 else "9" if n[i]==1 else n[i] for i in range(len(n))])))

Submission status: Wrong Answer

Solution code:
x=input()
n=[x[i] for i in range(len(x))]
for i in range(len(n)):
  if n[i]=="1"or"9":
    if n[i]=="1":
      n[i]="9"
    else:
      n[i]=="1"
print(int("".join(n)))

Submission status: Wrong Answer

Solution code:
y = int(input())
for i in range(1, 10):
  x = i + i * 10 + i * 100
  if x >= y:
    print(x)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8


n = input()

print(n.replace('1','9').replace('9','1'))

Submission status: Wrong Answer

Solution code:
s = input()
res = ''
for c in s:
  if(c=='1'):
    res +='9'
  elif(c=='9'):
    res +='1'
  else:
    res += c

Submission status: Wrong Answer

Solution code:
print(input().replace('9','1').replace('1','9'))

Submission status: Wrong Answer

Solution code:
input().replace('9','1').replace('1','9')

Submission status: Wrong Answer

Solution code:
snk = input()

snk = snk.replace("1", "a").replace("9", "b")
print(int(snk.replace("a", "9").replace("b", "9")))

Submission status: Wrong Answer

Solution code:
from functools import reduce

x = input()

x = [int(x) for x in list(str(x))] #入力した数字列のリスト化・・・(1)

if x[0] == 1:
     x[0] = 9
     
elif x[0] == 9:
     x[0] = 1

if x[2] == 1:
    x[2] = 9
    
elif x[2] == 9:
    x[2] = 1
    
print(x)

x = int(reduce(lambda x, y: x + y, [str(x) for x in x])) #(1)のリストの結合

print(x)

Submission status: Wrong Answer

Solution code:
snk = input()

print(int(snk.replace("1", "9").replace("9", "1")))

Submission status: Wrong Answer

Solution code:
print(input().replace('1', 'o').replace('9', '1').replace('o', '1'))

Submission status: Wrong Answer

Solution code:
print(input().replace('1', 'o').replace('9', 'n').replace('o', '1'))

Submission status: Wrong Answer

Solution code:
print(input().replace('1', '9').replace('9', '1'))

Submission status: Wrong Answer

Solution code:
n=input()

for k in n:
  if k==1:
    ptint(9)
  if k==9:
    print(9)

Submission status: Wrong Answer

Solution code:
n=input()
d={"9":"1","1":"9"}
"".join(d[x] for x in n)

Submission status: Wrong Answer

Solution code:
narray = list(input())

suuji = ""
for i in narray:
    if i == "3":
        i = "9"
    elif i == "9":
        i = "3"
    suuji += i
print(int(suuji))

Submission status: Wrong Answer

Solution code:
narray = list(input())

suuji = ""
for i in narray:
    if i == "3":
        i = "9"
    elif i == "9":
        i = "3"
    suuji += i
print(suuji)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=str(a).replace('1','9').replace('9','1')
print(int(b))

Submission status: Wrong Answer

Solution code:
a=int(input())
print(int(str(a).replace('1','9').replace('9','1')))

Submission status: Wrong Answer

Solution code:
a=int(input())
print(str(a).replace('1','9').replace('9','1'))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=str(a)
print(b.replace('1','9').replace('9','1'))

Submission status: Wrong Answer

Solution code:
print(input().replace('1','9').replace('9','1'))

Submission status: Wrong Answer

Solution code:
""" AtCoder """

import sys
input = sys.stdin.readline

n = input()

ans = []

for i in range(len(n)):
    if n[i] == '1':
        ans.append('9')
    else:
        ans.append('1')
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
n = input()

result = ''
for x in n:
  if n == '1':
    result += '9'
  else:
    result += '1'
    
print(result)

Submission status: Wrong Answer

Solution code:
n = input()
ans = []
for i in n:
  if i == '1':
    ans += '9'
  else:
    ans += '1'

Submission status: Wrong Answer

Solution code:
a=input()
print(a.replace("1","9").replace("9","1"))

Submission status: Wrong Answer

Solution code:

print(input().replace("1","9").replace("9","1"))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from functools import reduce

N = int(input())
N_list = [int(x) for x in list(str(N))]

N_ = []
for i in N_list:
    print("i", i)
    if i == 1:
        i = 9
    elif i == 9:
        i = 1
    N_.append(i)

new_N = int(reduce(lambda x,y: x+y, [str(x) for x in N_]))

print(new_N)

Submission status: Wrong Answer

Solution code:
text = input()
str = ['1' if c == '9' else '1' for c in text]
print(''.join(str))

Submission status: Wrong Answer

Solution code:
n = input()
a = ""
for i in range(len(a)):
  if n[i]=="1":
    a +="9"
  else:
    a +="1"
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
 
list = [111*c for c in range(1,10)]
list.sort()
 
x = 0
for n in list:
    if n < N:
        continue
    else:
        x = n
        break
print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())
 
list = [int(c)+10*int(c)+100*int(c) for c in str(N)]
list.sort()
 
x = 0
for i in range(len(str(N))):
    if list[i] < N:
        continue
    else:
        x = list[i]
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0
lst=[0,0,0]
while n!=0:
    lst[cnt]=n%10
    n=n//10
    cnt+=1
if lst[2]>lst[1]:
    for i in range(cnt):
        print(lst[2],end="")
elif  lst[2]==lst[1]:
    if lst[1]>=lst[0]:
        for i in range(cnt):
            print(lst[2], end="")
    else:
        for i in range(cnt):
            print(lst[2]+1, end="")
else:
    for i in range(cnt):
        print(lst[2]+1,end="")

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0
lst=[0,0,0]
while n!=0:
    lst[cnt]=n%10
    n=n//10
    cnt+=1
if lst[2]>lst[1]:
    for i in range(cnt):
        print(lst[2],end="")
else:
    for i in range(cnt):
        print(lst[2]+1,end="")

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0
lst=[0,0,0]
while n!=0:
    lst[cnt]=n%10
    n=n//10
    cnt+=1
if lst[2]>lst[1]:
    mx=lst[2]
elif lst[1]>lst[0]:
    mx=lst[1]
else:
    mx=lst[0]
if cnt<3:
    print("111")
else:
    for i in range(cnt):
        print(mx,end="")

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0
lst=[0,0,0]
while n!=0:
    lst[cnt]=n%10
    n=n//10
    cnt+=1
if lst[2]>lst[1]:
    mx=lst[2]
elif lst[1]>lst[0]:
    mx=lst[1]
else:
    mx=lst[0]
for i in range(cnt):
    print(mx,end="")

Submission status: Wrong Answer

Solution code:
n=int(input())
max=0
cnt=0
while n!=0:
    if n%10>max:
        max=n%10
    n=n//10
    cnt+=1
if cnt<3:
    print("111") 
else:
    for i in range(cnt):
        print(max,end="")

Submission status: Wrong Answer

Solution code:
n=int(input())
max=0
cnt=0
while n!=0:
    if n%10>max:
        max=n%10
    n=n//10
    cnt+=1
for i in range(3):
    print(max,end="")

Submission status: Wrong Answer

Solution code:
n = input()
print(n.replace('1', '9').replace('9', '1'))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = str(input()) #文字列の入力
S = n.replace("1","9").replace("9","1") #複数の文字の置換
print(S)

Submission status: Wrong Answer

Solution code:
s=input()
ans=""
for i in range(len(s)):
  if s=="9":
    ans+="1"
  else:
    ans+="9"
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1,10):
    if 111 * i >= n:
        print(111*i)
        exit(0)

Submission status: Wrong Answer

Solution code:
n = str(input())

for i in range(len(n)):
  if n[i] == '1':
    n.replace('1', '9')
  else:
    n.replace('9', '1')
print(n)

Submission status: Wrong Answer

Solution code:
n = str(input())

print(n.replace('1', '9').replace('9', '1'))

Submission status: Wrong Answer

Solution code:
N = int(input())
print(1100-N)

Submission status: Wrong Answer

Solution code:
s=input()
for i in range(3):
  if(s[i]==1):
    print(9,end="")
  else:
    print(1,end="")

Submission status: Wrong Answer

Solution code:
a=input()

a=list(a)

#a=[int(i) for i in a]

for i in range(3):
    if(a[i]=='1'):
        a[i]='9'
    elif(a[i]=='9'):
        a[i]='9'
s=''.join(a)

print(s)

Submission status: Wrong Answer

Solution code:
N = int( input())
 
n = N // 100
 
if( N % 100 <= n * 10 + n):
	print(n * 100 + n * 10 + n )
  
else:
  	print( (n + 1)* 100 + (n + 1)* 10 + (n + 1))

Submission status: Wrong Answer

Solution code:
N = int( input())
 
n = N // 100
 
if( N % 100 <= n * 10 + n):
	print(n * 100 + n * 10 + n )
  
else:
  	print( n * 100 + n * 10 + n + 111)

Submission status: Wrong Answer

Solution code:
# あ
N = list(input())

out_str = ""
for i in range(len(N)) :
	if (N[i] == 1) :
		out_str += "9"
	else :
		out_str += "1"

print(out_str)

Submission status: Wrong Answer

Solution code:
print(input().replace('9','1'))

Submission status: Wrong Answer

Solution code:
n = input()
n2 = ""
for i in range(len(n)-1, -1, -1):
    n2 += n[i]

n2 = int(n2)
print(n2)

Submission status: Wrong Answer

Solution code:
n = list(input())
if n[0] == 1:
  n[0] = 9
else:
  n[0] = 1
if n[1] == 1:
  n[1] = 9
else:
  n[1] = 1
if n[2] == 1:
  n[2] = 9
else:
  n[2] = 1
  
print(n[0], n[1], n[2])

Submission status: Wrong Answer

Solution code:
N=int(input())
a=N%111
if a==0:
   print(N)
else:
  b=N//111
  c=b+1
  print(c*111)

Submission status: Wrong Answer

Solution code:
arr=[1,9]
A,B,C=map(int,input())
if A in arr and  B in arr  and  C in arr :
    A=10-A
    B=10-B
    C=10-C
    print(A,B,C)

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(1, 10):
    if((i-1)*111<N and N<=i*111):
        print(i*111)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
N = list(input())
for i in N:
  if i is '1':
    i = '9'
  else:
    i = '1'
print(N[0] + N[1] + N[2])

Submission status: Wrong Answer

Solution code:
def chg(n):
  if n==1:
    return 9
  elif n==9:
    return 1
  return n

n = int(input())
n,a1 = divmod(n,10)
n,a2 = divmod(n,10)
n,a3 = divmod(n,10)

print(a3,a2,a1)
print(100*chg(a3)+10*chg(a2)+chg(a1))

Submission status: Wrong Answer

Solution code:
print(int(int(input())/111)*111)

Submission status: Wrong Answer

Solution code:
n = int(input())

n_letters = str(n)

for i in range(len(n_letters)):
    if n_letters[i] == "1":
        n_letters[i].replace("1","9")
    elif n_letters[i] == "9":
        n_letters[i].replace("9","1")
    print(n_letters[i])

print(int(n_letters))

Submission status: Wrong Answer

Solution code:
n = input()

ret = ''
if n[0]=='1':
    ret +='9'
else:
    ret += '1'

if n[1]=='1':
    ret+='9'
else:
    ret+='0'

if n[2]=='1':
    ret+='9'
else:
    ret+='1'

print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(input().replace("1", "9").replace("9", "1"))

Submission status: Wrong Answer

Solution code:
N = input()

list_N  = list(N) 
#list_N = list(map(int,list_N))
print(list_N)
#swap_N = map(lambda i: i=1 if i == 9 else i=9, list_N)

#for i in list_N:
def swap(i):
    if i == "9":
        re = "1"
    elif i=="1":
        re = "9"
    return re

swap_N = list(map(swap, list_N))
print(int("".join(swap_N)))

Submission status: Wrong Answer

Solution code:
N = input()

list_N  = list(N) 
#list_N = list(map(int,list_N))
print(list_N)
#swap_N = map(lambda i: i=1 if i == 9 else i=9, list_N)

#for i in list_N:
def swap(i):
    if i == "9":
        re = "1"
    elif i=="1":
        re = "9"
    return re

swap_N = list(map(swap, list_N))
print("".join(swap_N))

Submission status: Wrong Answer

Solution code:
inp = int(input())
 
for x in range(1, 10):
  if inp <= x*111:
    print('{}'.format(x*111))
    break

Submission status: Wrong Answer

Solution code:
inp = int(input())

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

Submission status: Wrong Answer

Solution code:
inp = int(input())

for x in range(1, 10):
  if inp < x*111:
    print(x*111)
    break

Submission status: Wrong Answer

Solution code:
N = int(input())

S = (((N-1)//111)+1)*111

print(S)

Submission status: Wrong Answer

Solution code:
N = int(input())

S = (((N-1)//111))*111

print(S)

Submission status: Wrong Answer

Solution code:
N = int(input())

S = ((N//111)+1)*111

print(S)

Submission status: Wrong Answer

Solution code:
print(input().translate({"1": "9", "9": "1"}))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=str(input())
for string in n:
    print('1') if string == '9' else print('9')

Submission status: Wrong Answer

Solution code:
inp = int(input())
ret = 0
for i in range(1, 10):
    ret = i*111
    if ret >= inp:
        break
print(ret)

Submission status: Wrong Answer

Solution code:
inp = int(input())
ret = 0
for i in range(1, 9):
    ret = i*111
    if ret >= inp:
        break
print(ret)

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = stdin.readline().rstrip()

list = []
for i in range(3):
    list.append(n[i])

if list[0] == '1':
    list[0] = '9'
if list[1] == '1':
    list[1] = '9'
if list[2] == '1':
    list[2] = '9'

ans = ''.join(list)

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
list_ = [s[i] for i in range(3)]
list_2 = [i for i in map(int, list_)]
for i in range(len(list_2)):
    if list_2[i] == 1:
        list_2[i] = 9
    else:
        list_2[i] = 1
str_list = [i for i in map(str, list_2)]
str_ = ''
for i in str_list:
    str_ += i

Submission status: Wrong Answer

Solution code:
n=input()

answer=[]
for i in range(len(n)):
    if n[i]=='1':
        answer.append(9)
    else:
        answer.append(1)
        
final_answer=0
for i in range(len(answer)):
    final_answer+=answer[-(i+1)]*pow(10,i)
    
final_answer

Submission status: Wrong Answer

Solution code:
import sys
N=int(input())
N_str = []
for i in range(N,999):
    N+=1
    N_new = N
    while N>0:
        N_str.append(N%10)
        N//=10
    N_str.reverse()
    
    N = N_new
          
    if N_str[0]==N_str[1] and N_str[1]==N_str[2]:
        print(N)
        break

sys.exit()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 1100-n
print(a)

Submission status: Wrong Answer

Solution code:
n = str(input())
m = ""
for i in range(2):
  if n[i] == "9":
    m += "1"
  elif n[i] == "1":
    m += "9"
  else:
    m += n[i] 
print(int(m))

Submission status: Wrong Answer

Solution code:
n = list(map(int,input()))
n_length=len(n)


for i in range(n_length):
    if n[i]==1:
        n[i]=9
    elif n[i]==9:
        n[i]=1
    else:
        pass

print(str(n))

Submission status: Wrong Answer

Solution code:
i = int(input())
lst = []
while i > 0:
    
    a=i%10
    
    if a==1:
        a=9
    else:
        a=1
    
    lst.append(a)
    i //= 10
lst.reverse()
print(lst)

Submission status: Wrong Answer

Solution code:
print((1+((int(input())-1))//111)*111)

Submission status: Wrong Answer

Solution code:
n=int(input())
l1=[1,2,3,4,5,6,7,8,9]
x=111
for i in l1:
    if(i*x>=n):
        print(i*x)
        break

Submission status: Wrong Answer

Solution code:
n = [x for x in str(input())]
add_stock = ''

for i in n:
    add = i
    if i == '1':
        add = '9'
    add_stock += add

print(add_stock)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = 1110 - n
print(n)

Submission status: Wrong Answer

Solution code:
n = [x for x in str(input())]
add_stock = ''

for i in n:
    print(i)
    add = i
    if i == '1':
        add = '9'
    add_stock += add

print(add_stock)

Submission status: Wrong Answer

Solution code:
#Bad_Beast
n=int(input())
if n==111:
    print(111)
if n>111 and n<=222:
    print(222)
elif n>222 and n<=333:
    print(333)
elif n>333 and n<=444:
    print(444)
elif n>444 and n<=555:
    print(555)
elif n>555 and n<=666:
    print(666)
elif n>666 and n<=777:
    print(777)
elif n>777 and n<=888:
    print(888)
elif n>888 and n<=999:
    print(999)
#print(res)

Submission status: Wrong Answer

Solution code:

#
n = int(input())

if 111 <= n <1000:
    #main
        n1 = int (n / 100)
#        print(n1)
#        print("   ")
        
        n2 = n - (n1 *100)
        n2 = int (n2 / 10)
#       print(n2)
#       print("   ")
        
        n3 = n - n1 *100 - n2*10
#        print(n3)
#        print("   ")
        
        if n1 == 9:
            n1 = 1
        elif n1 == 1:
            n1 = 9
        if n2 == 9:
            n2 = 1
        elif n2 == 1:
            n2 = 9
        if n3 == 9:
            n3 = 1
        elif n3 == 1:
            n3 = 9

Submission status: Wrong Answer

Solution code:
N = int(input())
num = []
while N!=0:
  num.append(N%10)
  N -= N%10
  N /= 10
num.reverse()
a=num[0]
b=num[1]
c=num[2]
if a==b>=c:
  print(int(100*a+11*b))
if a==b<c or a<b:
  print(int((a+1)*111))
if a>b:
  print(int(a*111))

Submission status: Wrong Answer

Solution code:
n = input()
a = list(n)
if a[0] == a[1] ==a[2]:
    print(n)
else:
    if int(a[0])> int(a[1]):
        a[1] = a[0]
        a[2] = a[0]  
        for i in range(3):
            print(a[i] ,end="")

    elif a[0]==a[1] and int(a[0]) <int(a[2]):
         a[0] = str(int(a[0]) +1)
         a[1] =a[0]
         a[2] = a[0]

         for i in range(3):
            print(a[i] ,end="")
    elif a[0]==a[1] and int(a[0]) >int(a[2]):
         a[2] = a[0]
         for j in range(3):  
            print(a[j] ,end="")         


    else:
        a[0] = str(int(a[0]) +1)
        a[1] =a[0]
        a[2] = a[0]

        for j in range(3):  
            print(a[j] ,end="")

Submission status: Wrong Answer

Solution code:

#
n = int(input())

if 111 <= n <1000:
    #main
        n1 = int (n / 100)
#        print(n1)
#        print("   ")
        
        n2 = n - (n1 *100)
        n2 = int (n2 / 10)
#       print(n2)
#       print("   ")
        
        n3 = n - n1 *100 - n2*10
#        print(n3)
#        print("   ")
        
        if n1 == 9:
            n1 = 1
        elif n1 == 1:
            n1 = 9
        if n2 == 9:
            n2 = 1
        elif n2 == 1:
            n2 = 9
        if n3 == 9:
            n1 = 1
        elif n3 == 1:
            n3 = 9

        nn = n1 *100 + n2*10 + n3

        print(nn)

Submission status: Wrong Answer

Solution code:
#
n = int(input())

if 111 <= n <1000:
    #main
        n1 = int (n / 100)
#        print(n1)
#        print("   ")
        
        n2 = n - (n1 *100)
        n2 = int (n2 / 10)
#       print(n2)
#       print("   ")
        
        n3 = n - n1 *100 - n2*10
#        print(n3)
#        print("   ")
        
        if n1 == 9:
            n1 = 1
        if n1 == 1:
            n1 = 9
        if n2 == 9:
            n2 = 1
        if n2 == 1:
            n2 = 9
        if n3 == 9:
            n1 = 1
        if n3 == 1:
            n3 = 9

        nn = n1 *100 + n2*10 + n3

        print(nn)

Submission status: Wrong Answer

Solution code:
s = input()
print(s.replace("1","9").replace("9","1"))

Submission status: Wrong Answer

Solution code:
A = int(input())

if A == 111:
    print(999)
elif A == 119:
    print(991)
elif A == 199:
    print(911)
elif A == 999:
    print(111)
elif A == 199:
    print(911)
elif A == 119:
    print(991)
elif A == 919:
    print(191)
elif A == 191:
    print(919)