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:
s = int(input())
s = str(s).replace("1","a")
s = s.replace("9","1")
s = s.replace("a","9")

print(s)

Submission status: Accepted

Solution code:
# 文字列の入力
s = str(input())
ans = ""

for i in range(len(s)):
  if s[i]=="1":
    ans=ans+"9"
  else:
    ans=ans+"1"
    
print(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())
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(len(n)):
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
print(int("".join(n)))

Submission status: Accepted

Solution code:

n = input()
ans = [0]*3
for i,w in enumerate(n):

    if w == '9':
        ans[i] = '1'
    elif w == '1':
        ans[i] = '9'

print("".join(ans))

Submission status: Accepted

Solution code:
N=str(input())

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

print(int(A))

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

Submission status: Accepted

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

Submission status: Accepted

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

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(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=list(input())
for i in range(3):
  if a[i]=='1':
    a[i]='9'
  elif a[i]=='9':
    a[i]='1'
print(a[0]+a[1]+a[2])

Submission status: Accepted

Solution code:
n = 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:
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 = input()
for i in n:
    if i == "1":
        print(9,end = "")
    else:
        print(1,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 (ans)

Submission status: Accepted

Solution code:
def abc():
    n = input().rstrip()
    print(n.replace('1', '_').replace('9', '1').replace('_', '9'))


abc()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
def lmi(): return list(map(int, input().split()))

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 = list(map(int, list(input())))

for i in range(3):
    s[i] = 10 - s[i]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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()
output = ""
for i in range(3):
    if n[i] == "9":
        output += "1"
    elif n[i] == "1":
        output += "9"
    else:
        output += n[i]

print(output)

Submission status: Accepted

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

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()
n_list = list(n)
l = len(n_list)
for i in range(l):
    if n_list[i] == "1":
        n_list[i] = "9"
    else:
        n_list[i] = "1"

result = ""
for i in range(l):
    result = result+n_list[i]

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

ls = []

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

print("".join(ls))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

li = []
for i in n:
    if i == '1':
        i = '9'
    elif i == '9':
        i = '1'

    li.append(i)

print("".join(li))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

print(1110-N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
N = []
for v in n:
    N.append(v)
for i in range(len(N)):
    if N[i] == '1':
        N[i] = '9'
    else:
        N[i] = '1'
answer = N[0] + N[1] + N[2]
print(int(answer))

Submission status: Accepted

Solution code:
a,b,c=input()
def x(n):
  if n=="1":
    n="9"
  else:
    n="1"
  return n
print(x(a)+x(b)+x(c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = [str(c) for c in input()]

swap_dict = dict([['1','9'],['9','1']])

for i in range(len(s)):
  s[i] = swap_dict[s[i]]
  
print(''.join(s))

Submission status: Accepted

Solution code:
s = str(input())

ans = 0
unit = [100, 10, 1]

for x, u in zip(s, unit):
    if x=='1':
        ans += 9 * u
    else:
        ans += 1 * u

print(ans)

Submission status: Accepted

Solution code:
n=input()

answer=[]

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

print("".join(answer))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

lst_N = list(input())

for i in range(3):

    if lst_N[i] == '9':
        lst_N[i] = '1'
    else:
        lst_N[i] = '9'

N = ''.join(lst_N)
N = int(N)

print(N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = {"1":"9","9":"1"}
z = input()
m = ""
for i in z:
  m += a[i]

print(m)

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    for i in s:
        if i == '1':
            print(9, end = '')
        if i == '9':
            print(1, end= '')
    
    print()
    

solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(''.join([{'1':'9','9':'1'}[c] for c in list(input())]))

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 = 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())
for num in n:
    if num == '1':
        num ='9'
    elif num == '9':
        num = '1'
    print(num,end='')

Submission status: Accepted

Solution code:
from sys import stdin

n = stdin.readline().rstrip()
output = ''
for k in n:
    if k == '1':
        output += '9'
    else:
        output += '1'
print(output)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

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 n:
  if i == "1":
    ans += "9"
  elif i == "9":
    ans += "1"
  else:
    ans += i
print(ans)

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(len(n)):
    if n[i] == '1':
        n[i] = '9'
    else:
        n[i] = '1'

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

Submission status: Accepted

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


def solve(n: str):
    print(n.replace("9","t").replace("1","9").replace("t","1"))



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = next(tokens)  # type: int
    solve(n)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = list(input())
r = n.copy()
for i,k in enumerate(n) :
  if k == "1" :
    r[i] = "9"
  elif k == "9":
    r[i] = "1"
print("".join(r))

Submission status: Accepted

Solution code:
s = str(input())
ans = ""
for c in s:
  if c == "1":
    ans = ans + "9"
  else:
    ans = ans + "1"

print(ans)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input().rstrip()
ans = ''
for l in s:
  if l == '9':
    ans += '1'
  elif l == '1':
    ans += '9'
  else:
    ans += l

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
t = list(input().strip())

for v in t:
  if v =="1":
    print("9", end = "")
  else:
    print("1", end = "")
    
print()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(input().translate({49:57,57:49}))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
A - AtCoder Beginner Contest 999
https://atcoder.jp/contests/abc111/tasks/abc111_a

"""
import sys


def solve(n):
    return n.translate(str.maketrans('19', '91'))


def main(args):
    n = input()
    ans = solve(n)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
from __future__ import print_function
import numpy as np
import sys
import math,string,itertools,fractions,heapq,collections,re,array,bisect,copy,functools
# from itertools import accumulate
# from collections import deque
import random

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

l = list(input())
# print(type(l))
for i in range(len(l)):
    if l[i]=='1':
        l[i] = '9'
    else:
        l[i] = '1'
ll = "".join(l)
print(ll)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = str(input())

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

Submission status: Accepted

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

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

print(''.join(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(str(input()))

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

b = ''.join(a)
print(b)

Submission status: Accepted

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

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:
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


a = str(input())
a = a.replace("1", "-")
a = a.replace("9", "1")
a = a.replace("-", "9")
print(a)

Submission status: Accepted

Solution code:
s = input()
l = ''
for k in s:
  if k == '1':
    l += '9'
  elif k == '9':
    l += '1'
  else:
    l += k
    
print(int(l))

Submission status: Accepted

Solution code:
n=input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

num = ''
for i in n:
  if i == '1':
    num = num + '9'
  elif i == '9':
    num = num + '1'
  else:
    num = num + i

print(num)

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:
def main():
    N = input()
    ans = ''
    for i in N:
        if i == '1':
            ans +=  '9'
        elif i == '9':
            ans += '1'
    print(ans)
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = list(input())
ans_num = ""
for num in li:
    if num == "1":
        ans_num += "9"
    elif num == "9":
        ans_num += "1"

print(ans_num)

Submission status: Accepted

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

Submission status: Accepted

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

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:
a=list(str(input()))

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

Submission status: Accepted

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

print()

Submission status: Accepted

Solution code:
N = list(str(input()))

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

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

Submission status: Accepted

Solution code:
N = input()
L = list(N)

for i in range(3):
  if L[i] == "1":
    L[i] = "9"
  else:
    L[i] = "1"
print("".join(L))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
P=input()
p=[]
for i in range(3):
    if P[i]=='1':
        p.append('9')
    else:
        p.append('1')

print(''.join(p))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

print('')

Submission status: Accepted

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

Submission status: Accepted

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: 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"
ans = "".join(n)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

print(int(n))

Submission status: Accepted

Solution code:
n = input()

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

print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(''.join(list(map(lambda x:['1','9'][x=='1'],list(input())))))

Submission status: Accepted

Solution code:
lst = list(input())

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

s = str(lst[0]) + str(lst[1]) + str(lst[2])
print (s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
###############################################################################

import sys
from bisect import bisect_left as binl
from copy import copy, deepcopy

def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


###############################################################################


def main():
    n = input()

    for i in n:
        if i == '1':
            sys.stdout.write('9')
        if i == '9':
            sys.stdout.write('1')
    print()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=str(input())

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

Submission status: Accepted

Solution code:
n = input()
s = ""
for i in list(n):
    if i == "1":
        s += "9"
    elif i == "9":
        s += "1"
    else:
        s += i
print(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()
print(n.translate(str.maketrans({'1':'9', '9':'1'})))

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:
def solve():
    inp = list(raw_input())
    for i in range(len(inp)):
        if inp[i] == '1':
            inp[i] = '9'
        elif inp[i] == '9':
            inp[i] = '1'
    print ''.join(inp)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
# coding : UTF-8

from sys import stdin

n = stdin.readline().rstrip()

def main():
    ans = ""
    
    for _ in range(len(n)):
        if n[_] == '1':
            ans = ans + '9'
        else:
            ans = ans + '1'
    
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = input()
correct = ""
for x in num:
    if x == "1":
        correct += "9"
    elif x == "9":
        correct += "1"
    else:
        correct += x

print(correct)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

n = list(input())

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:
x = list(input())
for i in range(3):
  if x[i] == "9":
    print(1,end="")
  else:
    print(9,end="")
print("")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
b = []
c = []
for i in (a):
    b.append(i)
for v in (b):
    if v == '1':
        c.append('9')
    if v == '9':
        c.append('1')
ans = ''.join(c)
print(ans)

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:
a=input()
table=str.maketrans({"1":"9","9":"1",})

print(a.translate(table))

Submission status: Accepted

Solution code:
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import sys

sys.setrecursionlimit(10000)
INF = float('inf')

S = input()
print(S.replace('1', 'a').replace('9', '1').replace('a', '9'))

Submission status: Accepted

Solution code:
ns = list(input())

res = []
for n in ns:
    if n == '1':
        res.append('9')
    elif n== '9':
        res.append('1')
    else:
        res.append(n)

print(''.join(res))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(n: str):
    res = []
    for c in n:
        res.append('9' if c == '1' else '1')
    return int(''.join(res))


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
n=list(n)
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"
ans=int("".join(n))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
n=list(n)
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'
ans=int("".join(n))
print(ans)

Submission status: Accepted

Solution code:
s = input();

ans = "";

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

Submission status: Accepted

Solution code:
n = input()

ans = []
for s in n:
    if s is  '9':
        ans.append('1')
    else:
        ans.append('9')
print(''.join(ans))

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
n = int(input())

print(111 + 999 - n)