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.replace("1", "x")
y = m.replace("9", "1")
print(y.replace("x", "9"))

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 = str(input())
ans = ''
for i in range(3):
    if n[i] == '1':
        ans += '9'
    else:
        ans += '1'

print(ans)

Submission status: Accepted

Solution code:
# A - AtCoder Beginner Contest 999

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())

if n[0] == "9":
  ans = 100
elif n[0] == "1":
  ans = 900
  
if n[1] == "9":
  ans = ans + 10
elif n[1] == "1":
  ans = ans + 90

if n[2] == "9":
  ans = ans + 1
elif n[2] == "1":
  ans = ans + 9
  
print(ans)

Submission status: Accepted

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

print(int("".join(x)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
q="1"*n+"0"
print(int(q)-int(s))

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

    res = ''

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in n:
	if i == "1":
		output.append("9")
	elif i =="9":
		output.append("1")
	else:
		output.append(i)
		
print("{}{}{}".format(output[0],output[1],output[2]))

Submission status: Accepted

Solution code:
n = int(input())

ans = 1110 - n
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: <encoding name> -*-

n = input()
x = n.replace('1', 'm')
y = x.replace('9', '1')
z = y.replace('m', '9')
print(z)

Submission status: Accepted

Solution code:
n=input()

N=[]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
import copy

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

Submission status: Accepted

Solution code:
n=list(str(input()))
for i in n:
    if i=='1':
        print(9,end='')
    else:
        print(1,end='')
print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18
# ----------------------------------------------------------- #

n = S()
ans = []
for c in n:
    if c == '1':
        ans.append('9')
    else:
        ans.append('1')
print("".join(ans))

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = S()
ans = list()
for c in N:
    if c == '1':
        ans.append('9')
    else:
        ans.append('1')
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if s[0] == '1':
  s = '9' + s[1:]
elif s[0] == '9':
  s = '1' + s[1:]
  
if s[1] == '1':
  s = s[0] + '9' + s[2]
elif s[1] == '9':
  s = s[0] + '1' + s[2]

if s[2] == '1':
  s = s[:2] + '9'
elif s[2] == '9':
  s = s[:2] + '1'
print(s)

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()

t = ""

for i in range(3):
  if s[i] == "1":
    t += "9"
  else:
    t += "1"
    
print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    s = list(input())
    for i in range(len(s)):
        if s[i] == '1':
            s[i] = '9'
        elif s[i] == '9':
            s[i] = '1'
    print(''.join(s))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
table = {
    '1': '9',
    '9': '1',
}

S = input()

for c in S:
    print(table[c], end='')
print('')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inf = 10**15
mod = 10**9+7

n = input()
ans = ''
for c in n:
    if c == '1':
        ans = ''.join([ans, '9'])
    else:
        ans = ''.join([ans, '1'])
print(ans)

Submission status: Accepted

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

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = input()
    n = n.replace('1', '#').replace('9', '1').replace('#', '9')
    print(n)



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=input()
a=n[0]
b=n[1]
c=n[2]
print(abs(int(a)-10)*100+abs(int(b)-10)*10+abs(int(c)-10))

Submission status: Accepted

Solution code:
def ABC_111_A():
    n = input()
    n = list(n)

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

    n = ''.join(n)
    print(n)

    

if __name__ == '__main__':

    ABC_111_A()

Submission status: Accepted

Solution code:
N=int(input())
ans=0
for i in range(3):
  n=N%10
  N=N//10
  ans+=10**i*((n+8)%16)
print(ans)

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
n = input()
ans = []

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

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
print(999 + 111 -n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
s=[]
for i in range(3):
    if n[i] == "1":
        s.append(9)
    elif n[i] == "9":
        s.append(1)
    else:
        s.append(n[i])
print(*s,sep="")

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(int(n[0]+n[1]+n[2]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ans=0
a=n//100
b=n//10-(a*10)
c=n%10
if a==1:
    ans+=900
else:
    ans+=100
if b==1:
    ans+=90
else:
    ans+=10
if c==1:
    ans+=9
else:
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
NN = []
for i in range(len(N)):
    if N[i] == '9':
        NN.append('1')
    elif N[i] == '1':
        NN.append('9')
print(''.join(NN))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

for i in n:
    if i == '9':
        print('1', end="")
    else:
        print('9', end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
n = list(input())
for i,v in enumerate(n):
  if v == '1':
    n[i] = '9'
  elif v == '9':
    n[i] = '1'
print("".join(n))

Submission status: Accepted

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

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

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

print(n[0] + n[1] + n[2])

Submission status: Accepted

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

n = input()
ans = ""

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

print(ans)

Submission status: Accepted

Solution code:
n = input()
number = ''
for i in n:
    # print(f"i = {i}")
    if i == '1':
        i = '9'
    elif i == '9':
        i = '1'
    number += i
print(int(number))

Submission status: Accepted

Solution code:

n = input()
a = []
for i in range(len(n)):
  if n[i] == "1":
    a.append("9")
  elif n[i] == "9":
    a.append("1")
  else:
    a.append(n[i])
print("".join(a))

Submission status: Accepted

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

Submission status: Accepted

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


def solve(n: int):
    sn = str(n)
    print(sn.translate({ord("1"): "9", ord("9"): "1"}))


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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:
#!/usr/bin/env python3
s = input()
ans = ""
for i in range(3):
    if s[i] == "1":
        ans += "9"
    else:
        ans += "1"
print(ans)

Submission status: Accepted

Solution code:
n=input()
ans=100*(10-int(n[0]))+10*(10-int(n[1]))+(10-int(n[2]))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())

apple = []



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

count = 0
m = 0
for i in apple:
    i = int(i)
    if count == 0:
        i *= 100
        m += i
        count += 1
    elif count == 1:
        i *= 10
        m += i
        count += 1
    elif count == 2:
        m += i

print(m)

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('1', 'a').replace('9','1').replace('a', '9'))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = input()

n1 = 10 - int(num[0])
n2 = 10 - int(num[1])
n3 = 10 - int(num[2])

print(n1,n2,n3,sep='')

Submission status: Accepted

Solution code:
n=input()
print(n.replace("1","x").replace("9","1").replace("x","9"))
#順に処理されていくことに留意

Submission status: Accepted

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

Submission status: Accepted

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

print(moji)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = list(sr())
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:
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()
str = ''
for i in n:
  if i == '1':
    str += '9'
  elif i == '9':
    str += '1'
print(str)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#copy

n = int(input())
print(1110 - n)

#あたまいいすごい

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    n=input()
    n_1=n.replace('1','a')
    n_2=n_1.replace('9','1')
    n_3=n_2.replace('a','9')
    print(n_3)
resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

print("")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
List = list(input())
for i in range(len(List)):
    if int(List[i]) == 1:
        List[i] = str('9')
    else:
        List[i] = str('1')

print(''.join(List))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = 1110 - a
print(b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

print(1110-n)

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
n = input()
ans = []
for i in range(len(n)):
    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:
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=str(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()
a=""
for i in range(3):
    if s[i]=="1":
        a+="9"
    else:
        a+="1"
print(a)

Submission status: Accepted

Solution code:
n = input()
ans = ""
for i in range(len(n)):
  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()

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

print(n)

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(ans)

Submission status: Accepted

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

for i in range(n):
  print(s[i],end='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

print(n.translate(str.maketrans({"1":"9","9":"1"})))

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
S = input()
S = S.replace('1','x')
S = S.replace('9','1')
S = S.replace('x','9')
print(S)

Submission status: Accepted

Solution code:
INF = 10 ** 9
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from  collections import deque

def main():
    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))
if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

str = input()
ans = ""

for i in range(len(str)):
    if(str[i]=="1"):
        ans += "9"
    elif (str[i]=="9"):
        ans += "1"
    else:
        ans += str[i]

print(ans)

Submission status: Accepted

Solution code:
num=list(map(int,input()))
for i in range(len(num)):
    if num[i]==9:
        num[i]=1
    elif num[i]==1:
        num[i]=9 
    print(num[i],end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
res = ""

for n in N:
  if n == "1":
    res = res +"9"
  elif n == "9":
    res = res + "1"
  else:
    res = res + n
print(res)

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
n = input()
ans = []
for nn in n:
    if nn == '1':
        print(9, end='')
    elif nn == '9':
        print(1, end='')
    else:
        print(nn, end='')

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"))

Submission status: Accepted

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("".join(n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def solve():

    n = list(map(int, input()))
    for i in n:
        if i == 9:
            print(1, end="")
        else:
            print(9, end="")

    print()


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

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

n = "".join(n)
print(n)

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 = input()
ans = ''

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
icase=0
if icase==0:
    k=int(input())
    print(1110-k)