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: Accepted

Solution code:
n = input()
m = n.translate(str.maketrans({"1": "9", "9": "1"}))
print(m)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
	
	N = input()
	
	s = ""
	for i in N:
		if i == "1":
			s += "9"
		elif i == "9":
			s += "1"
	
	print(s)

Submission status: Accepted

Solution code:
a=list(input())
for i in range(3):
  if int(a[i])==1:
    a[i]='9'
  elif int(a[i])==9:
    a[i]='1'
print(''.join(a))

Submission status: Accepted

Solution code:
n = input()
ans = ""

for i in n:
  if i == "1":
    ans += "9"
  else:
    ans += "1"

print(int(ans))

Submission status: Accepted

Solution code:
n=input()
s=''

for i in n:
  if i=="1":
    s+='9'
    
  else:
    s+='1'
    
print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
l = []

for i in n:
  if i == "1":
    l.append("9")
  elif i == "9":
    l.append("1")
  else:
    l.append(i)

print("".join(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(''.join('1'if X=='9'else'9'for X in input()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# abc111_a.py
# https://atcoder.jp/contests/abc111/tasks/abc111_a

# A - AtCoder Beginner Contest 999 /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# 猫のすぬけは文字を書く練習をしています。 
# すぬけは今日、数字の 1 と 9 を書く練習をしていたのですが、 間違えて 1 と 9 をあべこべに書いてしまいました。
# すぬけが書いた 3桁の整数 n が与えられます。 
# nに含まれる 1 という桁をそれぞれ 9 に、 9 という桁をそれぞれ 1 に置き換えて得られる整数を出力してください。

# 制約
#     111≤n≤999
#     nは各桁が 1 か 9 である整数

# 入力
# 入力は以下の形式で標準入力から与えられる。
# n

# 出力
# nの各桁の 1 と 9を入れ替えた整数を出力してください。

# 入力例 1
# 119

# 出力例 1
# 991

# 一の位の 9 を 1 に、十の位の 1 を 9 に、百の位の 1 を 9 に書き換えた 991 が答えとなります．

# 入力例 2
# 999

# 出力例 2
# 111


def calculation(lines):
    # N = int(lines[0])
    # X, Y = list(map(int, lines[0].split()))
    n = lines[0]

    return [n.replace('9', 'a').replace('1', '9').replace('a', '1')]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['119']
        lines_export = ['991']
    if pattern == 2:
        lines_input = ['999']
        lines_export = ['111']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = readline().decode().rstrip()

n = n.replace('1', 't').replace('9', '1').replace('t', '9')
print(int(n))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = input().rstrip()

    ans = ""
    for s in n:
        if s == "1":
            ans += "9"
        else:
            ans += "1"

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = input()

ans = ''

for i in range(3):
    if n[i] == '1':
        ans += '9'
    else:
        ans += '1'
print(ans)

Submission status: Accepted

Solution code:
# 初期入力
import sys
#input = sys.stdin.readline  #文字列では使わない
n =input().strip()
ans =""
for i in n:
    if i=="1":
        ans +="9"
    elif i=="9":
        ans +="1"
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

print(1110-n)

Submission status: Accepted

Solution code:
n = list(input())

print(int(''.join(['1' if i=='9' else '9' for i in n])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
l = []
for s in str(N):
    if s == '1':
        l.append('9')
    elif s == '9':
        l.append('1')
    else:
        l.sppend(s)
print(''.join(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
r = ""
for i in s:
  if i=='1':
    r += '9'
  elif i=='9':
    r += '1'
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
for i in range(3):
    if n[i] == '1':
        n[i] = '9'
    elif n[i] == '9':
        n[i] = '1'
print("".join(n))

Submission status: Accepted

Solution code:
s = input()
res=s.replace('1', 'X').replace('9', '1').replace('X', '9')
print(res)

Submission status: Accepted

Solution code:
n = input()
print(n.translate(str.maketrans({"1":"9","9":"1"})))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
 n = input()
 for i in range(3):
     if n[i] == '1':
         print(9,end = "")
     elif n[i] == '9':
         print(1, end = "")
     else:
         print(n[i],end = "")
 print()
main()

Submission status: Accepted

Solution code:
s = input()
l = []
for i in range(len(s)):
  if s[i] == "1":
    l.append("9")
  elif s[i] == "9":
    l.append("1")
  else:
    l.append(s[i])
for k in l:
  print(k,end="")

Submission status: Accepted

Solution code:
n = input()

ans = ""
for c in n:
    if c == '1':
        ans += '9'
    elif c == '9':
        ans += '1'
    else:
        ans += c
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def LS2(): 
    return list(sys.stdin.readline().rstrip())  #空白なし

n = LS2()

for i in range(3):
    if n[i] == '1':
        n[i] = '9'
    else:
        n[i] = '1'

print(''.join(n))

Submission status: Accepted

Solution code:
n = input()
print(n.replace('1','X').replace('9','1').replace('X','9') if "1"or'9' in n else n)

Submission status: Accepted

Solution code:
n = int(input())

n_str = list(str(n))

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

print(int("".join(n_str)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = list(input())
int_n = int(''.join(n))
if not (111 <= int_n <= 999):
    sys.exit()

result = []
for I in n:
    if I == '1':
        result.append('9')
    elif I == '9':
        result.append('1')
    else:
        result.append(I)
print(int(''.join(result)))

Submission status: Accepted

Solution code:
line = list(input())
j = 0
for i in range(3):
    if line[j] == "1":
        line[j] = "9"
    else:
        line[j] = "1"
    j +=1
print(int(line[0] + line[1] + line[2]))

Submission status: Accepted

Solution code:
n = input()
N = n.translate(str.maketrans({"1":"9","9":"1"}))
print(N)

Submission status: Accepted

Solution code:
t = input()

ans = ""

for i in range(len(t)):
    if t[i] == '1':
        ans+='9'
    elif t[i] == '9':
        ans+='1'

print(ans)

Submission status: Accepted

Solution code:
n = list(input())
ans = ""
for s in n:
    if s == "9":
        ans += "1"
        continue

    if s == "1":
        ans += "9"
        continue

    ans += s
    
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
 
if n == 111:
    print(999)
elif n == 119:
    print(991)
elif n == 191:
    print(919)
elif n == 199:
    print(911)
elif n == 911:
    print(199)
elif n == 919:
    print(191)
elif n == 991:
    print(119)
elif n == 999:
    print(111)

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

rr = lambda: sys.stdin.readline().rstrip()
print(rr().translate(str.maketrans('19', '91')))

Submission status: Accepted

Solution code:
S = list(input())
for i in range(3):
  if S[i] == '1':
  	S[i] = '9'
  elif S[i]== '9':
    S[i] = '1'
A = int(''.join(S))
print(A)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
dic = {"1":"9","9":"1"}
n = list(input())
for i in range(0,3,1):
    n[i]=dic[n[i]]
print("".join(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L=[0]*3
N=input()
for i in range(3):
  if N[i]=="1":
    L[i]=9
  else:
    L[i]=1
print((L[0]*100)+(L[1]*10)+L[2])

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
s=list(input())
for i in range(len(s)):
    if s[i]=="9":
        s[i]="1"
    elif s[i]=="1":
        s[i]="9"
print("".join(s))

Submission status: Accepted

Solution code:
def resolve():
    n = input()
    print(int(n.replace("1", "x").replace("9", "1").replace("x", "9")))

if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

for i in range(3):
    if n[i] == "1":
        n[i]="9"
    elif n[i] == "9":
        n[i]="1"

for j in n:
    print(j, end = "")

Submission status: Accepted

Solution code:
s = list(str(input()))
ans = ""
for i in range(3):
    if s[i] == "1":
        ans = ans + "9"
    else:
        ans = ans + "1"
print(ans)

Submission status: Accepted

Solution code:
n = input()

ans = ""

for i in n:
  if i == "1":
    ans += "9"
  else:
    ans += "1"
    
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

n = list(str(int(input())))

for i in range(len(n)):
    if n[i] == "9":
        n[i] = "1"
    elif n[i] == "1":
        n[i] = "9"

for i in n:
    print(i, end="")

Submission status: Accepted

Solution code:
N = list(input())
M = []
for i in N:
    if i == '1':
        M.append('9')
    else:
        M.append('1')

print(''.join(M))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())
dix = {'1':'9','9':'1'}
ans = ""
for x in n:
  if x=='1' or x=='9':
    ans += dix[x]
  else:
    ans += x
print(ans)

Submission status: Accepted

Solution code:
n=input()


ans=""

if n[0]=="1":
	ans=ans+"9"
else:
	ans=ans+"1" 

if n[1]=="1":
	ans=ans+"9"
else:
	ans=ans+"1" 

if n[2]=="1":
	ans=ans+"9"
else:
	ans=ans+"1"


print(ans)

Submission status: Accepted

Solution code:
print(input().translate(str.maketrans({'1': '9', '9': '1'})))

Submission status: Accepted

Solution code:
n = input()



if n[0] == "1":
    a = 9
elif n[0] == "9":
    a = 1

if n[1] == "1":
    b = 9
elif n[1] == "9":
    b = 1

if n[2] == "1":
    c = 9
elif n[2] == "9":
    c = 1

d = a*100 + b*10 + c


print(d)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input().rstrip()
d = {'1': '9', '9': '1'}
m = ''
for i in range(len(n)):
    m += d.get(n[i], n[i])
print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = iss()
    ret = ""
    for s in S:
        if s == '1':
            ret += '9'
        elif s == '9':
            ret += '1'
        else:
            ret += s
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = ""
ans = ""
S = input()
for i in range(3):
  if S[i] == "1":
    ans += "9"
  elif S[i] == "9":
    ans += "1"
  else:
    ans += S[i]
print(ans)

Submission status: Accepted

Solution code:
n = input()

ans = ""
for ch in n:
    if ch == "1":
        ans += "9"
    else:
        ans += "1"
print(ans)

Submission status: Accepted

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

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

n = int(input())

print(1110 - n)

Submission status: Accepted

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



if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n = input()
print(*[1 if a=='9' else 9 for a in n], sep="")

Submission status: Accepted

Solution code:
n = input()

ans = ""
for i in n:
    if i == "9":
        ans += "1"
    else:
        ans += "9"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
ans = ''

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

Submission status: Accepted

Solution code:
def replace1and9(x):
  if x == '9':
    return '1'
  if x == '1':
    return '9'

n = input()
ans = ""
for i in n:
  ans += replace1and9(i)
print(ans)

Submission status: Accepted

Solution code:
N=input()
lst=[]
for i in N:
    if i=='1':
        lst.append('9')
    else:
        lst.append('1')
print(''.join(lst))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = list(str(input()))
    ans = ''
    for i in n:
        if i == '1':
            ans = ans + '9'
        else:
            ans = ans + '1'
    print(int(ans))
main()

Submission status: Accepted

Solution code:
n = input()
ans = ''
for i in n:
    if i == '1':
        ans += '9'
    elif i == '9':
        ans += '1'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=input()
ans=[]
for i in range(len(N)):
  if N[i]=="1":
    ans.append(9)
  else:
    ans.append(1)
print(*ans,sep="")

Submission status: Accepted

Solution code:
n = input()
print(int(n.translate(str.maketrans({'1': '9', '9': '1'}))))

Submission status: Accepted

Solution code:
n=input()
a=''
for i in n:
  if i=='9':
    a=a+'1'
  elif i=='1':
    a=a+'9'
  else:
    a=a+i
print(int(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
for i in range(3):
    if n[i] == '1':
        n[i] = '9'
    elif n[i] == '9':
        n[i] = '1'
print(''.join(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
ans=[]

for i in range(3):
    if s[i]=="1":
        ans.append(9)
    else:
        ans.append(1)

print(ans[2] + ans[1]*10 + ans[0]*100)

Submission status: Accepted

Solution code:
a,b,c = input()

d = {"1":"9", "9":"1"}
print(d[a]+d[b]+d[c])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
N=list(n)
for i in range(3):
    if(N[i]=='1'):
        N[i]='9'
    elif(N[i]=='9'):
        N[i]='1'
n=''.join(N)
print(n)

Submission status: Accepted

Solution code:
n = input()
print(n.translate(str.maketrans({'1': '9', '9': '1'})))

Submission status: Accepted

Solution code:
n = input()
for c in n:
    if c == '9':
        print('1', end='')
    elif c == '1':
        print('9', end='')
    else:
        print(c, end='')
print()

Submission status: Accepted

Solution code:
n  = input()

ans =""
for i in n:
    if i == "9":
        ans += "1"
    elif i == "1":
        ans += "9"
    else:
        ans += i
        
print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
def resolve():
    N = input()
    N = N.replace("9", "0")
    N = N.replace("1", "9")
    N = N.replace("0", "1")
    print(N)


resolve()

Submission status: Accepted

Solution code:
n = list(input())

for i in range(len(n)):
    if n[i] == '1':
        n[i] = '9'
    elif n[i] == '9':
        n[i] = '1'

print(''.join(n))

Submission status: Accepted

Solution code:
n = list(input())

for i in range(3):
    #print(n[i])
    if n[i]=='1':
        n[i]='9'
    else:
        n[i]='1'

print(int(''.join(n)))

Submission status: Accepted

Solution code:
N = list(map(int, list(input())))
for i in range(3):
  N[i] = 10 - N[i]

print(N[0]*100 + N[1]*10 + N[2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
N = list(N)
res = []
for n in N:
    if n is '1':
        res.append('9')
    else:
        res.append('1')

print(''.join(res))

Submission status: Accepted

Solution code:
n = input()

for s in n:
    if s == '1':
        print('9', end='')
    elif s == '9':
        print('1', end='')
print()

Submission status: Accepted

Solution code:
n = input()

print(''.join('9' if c == '1' else '1' for c in n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m=input()
def s(x):
  if x=='1':
    return '9'
  else:
    return '1'
print(s(m[0])+s(m[1])+s(m[2]))

Submission status: Accepted

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

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


print(n)

Submission status: Accepted

Solution code:
n = list(input())

for i in range(len(n)):
    tmp = n[i]
    if (tmp == '1'):
        n[i] = '9'
    else:
        n[i] = '1'

print(''.join(n))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial#, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    n = i_input()
    
    str_n = str(n)

    for i in range(3):
        if str_n[i] == '1':
            print(9,end='')
        else:
            print(1,end='')
        
    print()

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

mapping_table = str.maketrans({'1': '9', '9': '1'})

print(n.translate(mapping_table))

Submission status: Accepted

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

Submission status: Accepted

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

print (ans)

Submission status: Accepted

Solution code:
n=input()

n_out=''

for i in range(3):
  if n[i]=='1':
    n_out+='9'
  else:
    n_out+='1'
    
print(int(n_out))

Submission status: Accepted

Solution code:
n = list(input())
i = 0

while i < 3:
    if n[i] == '1':
        n[i] = '9'
        i = i + 1
    else:
        n[i] = '1'
        i = i + 1

print(''.join(n))

Submission status: Accepted

Solution code:
n = str(input())

ans = 0
if n[0] == "1":
    ans += 900
else:
    ans += 100

if n[1] == "1":
    ans += 90
else:
    ans += 10

if n[2] == "1":
    ans += 9
else:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=list(input())

for i in range(3):
    if n[i] == "1":
        n[i] = "9"
    elif n[i]=="9":
        n[i] = "1"
print(*n,sep="")

Submission status: Accepted

Solution code:
n = input()

s = list(n)

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

print(''.join(s))

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N = input().rstrip()

ans = ""
for n in N:
    if n == "1":
        ans += "9"
    elif n == "9":
        ans += "1"
    else:
        ans += n

print(ans)

Submission status: Accepted

Solution code:
n = str(input())
ans = ''
for i in n:
    if i == '1':
        ans += '9'
    elif i == '9':
        ans += "1"
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
for i in reversed(range(3)):
    if str(n)[-1*i - 1] == '1':
        n += 8*10**i
    elif str(n)[-1*i - 1] == '9':
        n -= 8*10**i
print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
b = a.replace("1","x")
c = b.replace("9","1")
d = c.replace("x","9")
print(d)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
result=''
for i in n :
    if i=='1':
        result+='9'
    elif i=='9':
        result+='1'
    else:
        result+=i
print(result)

Submission status: Accepted

Solution code:
print(input().translate(str.maketrans("19","91")))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n=list(input())

for i in range(3):
    if n[i]=='1':
        n[i]='9'

    else:n[i]='1'

L=[str(a) for a in n]
L="".join(L)
print(L)

Submission status: Accepted

Solution code:
n = list(input())
num = ['1', '9']
[print(num[num.index(i)-1], end='') for i in n]

Submission status: Accepted

Solution code:
n = list(input())
for i in range(3):
    if n[i] == '1':
        n[i] = '9'
    else:
        n[i] = '1'
print(''.join(n))

Submission status: Accepted

Solution code:
n=input()
result=''
n=str(n)
for i in n:
    if i=='9':
        result+='1'
    elif i=='1':
        result+='9'
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
ans = ''
for i in n:
  if int(i) == 1:
    i = '9'
  elif int(i) == 9:
    i = '1'
  ans += i
print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

print(s.replace("1", "x").replace("9", "1").replace("x", "9"))

Submission status: Accepted

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

op = ""
for i in n:
    if i == "1":
        op += "9"
    else:
        op += "1"

print(op)

Submission status: Accepted

Solution code:
import sys
from functools import lru_cache
def input(): return sys.stdin.readline().strip()


def main():
    n = input()
    ans = ""
    for i in n:
        if i == '1': ans += '9'
        if i == '9': ans += '1'
    print(int(ans))



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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