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:
x=input()
n=[x[i] for i in range(len(x))]
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:
if __name__ == "__main__":
    n = input()

    t = ''
    for c in n:
        if c == '1':
            t += '9'
        elif c == '9':
            t += '1'

    print(t)

Submission status: Accepted

Solution code:
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

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

print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n =input()

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

Submission status: Accepted

Solution code:
from sys import stdin
N=(stdin.readline().rstrip())
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' 
  elif i=='9':
    ans += '1'
  else:
    ans +=i
print(ans)

Submission status: Accepted

Solution code:
N=input()
a="1" if N[0]=="9" else "9"
b="1" if N[1]=="9" else "9"
c="1" if N[2]=="9" else "9"
print(a+b+c)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in range(3):
    if str(n)[i] == "1":
        ans += 9 * pow(10, 2 - i)
    elif str(n)[i] == "9":
        ans += 1 * pow(10, 2 - i)
    else:
        ans += int(str(n)[i]) * pow(10, 2 - i)

print(ans)
print()

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc111/tasks/abc111_a
n = input()
print(1, end="") if n[0] == "9" else print(9, end="")
print(1, end="") if n[1] == "9" else print(9, end="")
print(1) if n[2] == "9" else print(9)

Submission status: Accepted

Solution code:
num=input()
num_str=list(num)
lengh=len(num_str)
tmp=num_str
for i in range(lengh):
    if num_str[i]=="1":
        tmp[i]="9"
    elif num_str[i]=="9":
        tmp[i]="1"
ans="".join(tmp)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8


n = input()
result = ''

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 s in n:
    if s == '1':
        S += '9'
    else:
        S += '1'
print(S)

Submission status: Accepted

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

S = input()

nS = ['1' if s == '9' else '9' for s in S]

print(''.join(nS))

Submission status: Accepted

Solution code:
def solve(string):
    return string.replace("1", "a").replace("9", "1").replace("a", "9")


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

Solution code:

# coding: utf-8

# In[1]:


n = str(input())


# In[11]:


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


# In[19]:


print(int("".join(ans)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = str(input())
l = list(N)
a_l = []
for i in range(len(N)):
    a_l.append(10 - int(l[i]))
ans = "".join([str(i) for i in a_l])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=str(input())
l=list(n)
a_l=[]
for i in range(len(n)):
    a_l.append(10-int(l[i]))
ans=''.join([str(i) for i in a_l])
print(ans)

Submission status: Accepted

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

n = input()
rtn = ""
for ni in n:
  if ni == "1":
    rtn += "9"
  elif ni == "9":
    rtn += "1"

print(rtn)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#cording: utf-8

n = int(input())

List = list(str(n))

num = ' '
for i in range(len(List)):
    if List[i] == '1':
        num += '9'
    if List[i] == '9':
        num += '1'
print(int(num))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = list(input())
result = ""
for i in range(len(num)):
    if num[i] == '1':
        result += '9'
    if num[i] == '9':
        result += '1'
print(result)

Submission status: Accepted

Solution code:
from sys import stdin

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

Submission status: Accepted

Solution code:
snk = input()

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

Submission status: Accepted

Solution code:
n = str(input())
L = list(n)
new =[]

for i in n:
    if i =='1':
        new.append('9')
    else:
        new.append('1')

ans = ''.join(new)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(int(s))

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

string = ""
for s in n:
	if s  == "9":
		string += "1"
	if s == "1":
		string += "9"

print(string)

Submission status: Accepted

Solution code:
li = list(map(int,input()))
p = ''
for a in li:
    a = 10 - a
    p += str(a)
print(p)

Submission status: Accepted

Solution code:
ans=0
N=int(input())
if N//100==1:
  N=N-100
  ans=ans+900
else:
  N=N-900
  ans=ans+100
if N//10==1:
  N=N-10
  ans=ans+90
else:
  N=N-90
  ans=ans+10
if N//1==1:
  ans=ans+9
else:
  ans=ans+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**7) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())



a = str(input())
ans=''
for c in a:
    if c=='1':
        ans = ans + '9'
    elif c=='9':
        ans = ans + '1'
    else:
        ans = ans + c

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
l = [int(x) for x in list(str(n))]
for item in l:
    if item == 1:
        print(9,end='')
    else:
        print(1,end='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import math
import sys
import heapq
from operator import itemgetter
import itertools
input = sys.stdin.readline

# a = int(input().rstrip())
# a, b = map(int, input().rstrip().split())
# D = list(map(int, input().rstrip().split()))
# H = [int(input().rstrip()) for _ in range(L)]
# DD = [[0 for j in range(100)] for i in range(200)]
# dict = {} ## dictionary

# a = sorted(a, key=lambda x: x[1]))
# if __name__ == '__main__':

n = str(input().rstrip())

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

Submission status: Accepted

Solution code:
print 1110-input()

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)
else:
    print(111)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

def change(d):
  if d == '1':
    return '9'
  elif d == '9':
    return '1'
  else:
    return d

print(''.join([change(d) for d in n]))

Submission status: Accepted

Solution code:
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()
print(''.join(['9' if n[i] == '1' else '1' for i in range(len(n))]))

Submission status: Accepted

Solution code:
n = input()

print("".join([str(10 - int(i)) for i in 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(*n, sep='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
n = input().strip()

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

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:
a = list(input())
b = ''
for i in a:
  if i == '1':
    b += '9'
  else:
    b += '1'
print(str(b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
narray = list(input())

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

Submission status: Accepted

Solution code:
narray = list(input())

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
# A
s = str(input())
result = ''

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

Submission status: Accepted

Solution code:
def main() -> None:
    n = input()
    out = ""
    for v in n:
        if v == '9':
            out += "1"
        elif v == '1':
            out += "9"
    print(out)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=input()
num=[]
for i in range(len(n)):
    num.append(n[i])
for j in range(len(n)):
    if num[j]=="1":
        num[j]="9"
    elif num[j]=="9":
        num[j]="1"
result=""
for k in range(len(n)):
    result+=num[k]
print(result)

Submission status: Accepted

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

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(n[i],end="")

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  n = str(input())
  m = ''
  for i in range(len(n)):
    if n[i] == '1':
      m += '9'
    elif n[i] == '9':
      m += '1'
    else:
      m += n[i]
  print(int(m))

if __name__ == '__main__':
  main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	x,y = map(int,input().split())	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

def inpl(): return list(map(int, input().split()))

#### START
S = input()

new_S = ""
for s in S:
  if s == "9":
    new_S = new_S + "1"
  elif s == "1":
    new_S = new_S + "9"
  else:
    new_S = new_S + s

print(new_S)

Submission status: Accepted

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

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

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:
str = ''
for i in input():
    if i == '9':
        str += '1'
    elif i == '1':
        str += '9'
    else:
        str += i
print(str)

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:
print(111 + 999 - int(input()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

S = input()
T = ''
for ch in S:
    if ch == '1':
        T += '9'
    else:
        T += '1'
print(T)

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

Submission status: Accepted

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

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_list = []
for i in range (len(n)):
    if n[i]=='1':
        ans_list.append('9')
    elif n[i]=='9':
        ans_list.append('1')
    else:
        ans_list.append(n[i])

print(''.join(ans_list))

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

Submission status: Accepted

Solution code:
n=int(input())
change_1_9=[]
a=n//100
b=(n-100*a)//10
c=n-100*a-10*b


if (a==9):
  change_1_9.append(1)
else:
  change_1_9.append(9)
if (b==9):
  change_1_9.append(1)
else:
  change_1_9.append(9)
if (c==9):
  change_1_9.append(1)
else:
  change_1_9.append(9)
print(''.join(map(str,change_1_9)))

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:
#!/usr/bin/env python3

def main():
    n = int(input())

    print(1110 - n)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
string = list(input())

answer = ''

for i, s in enumerate(string):
  if s == '1':
    string[i] = '9'
  if s == '9':
    string[i] = '1'
  answer += string[i]

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
""" AtCoder """

import sys
input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()

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

Submission status: Accepted

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

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input());
print( 1110 - n )

Submission status: Accepted

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

a= list(10 - x for x in n)

print('{0[0]}{0[1]}{0[2]}'.format(a))

Submission status: Accepted

Solution code:
n = input()
a = []
for i in n:
    a.append(10 - int(i))
for i in a:
    print(i, end = '')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
n = n.replace('9','q').replace('1','9').replace('q','1')
print(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())

lst = []
res = []

while n > 0:
    lst.append(n%10)
    n //= 10
    
lst.reverse()


for i in lst:
    if i == 1:
        res.append(9)
    elif i == 9:
        res.append(1)
    else:
        res.append(i)


S = ""

for j in res:
    S += str(j)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
lst = ""
a = input()
if a[0] == "9":
    lst += "1"
else:
    lst += "9"

if a[1] == "9":
    lst += "1"
else:
    lst += "9"

if a[2] == "9":
    lst += "1"
else:
    lst += "9"

print(lst)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())

n = n.replace("1", "&")
n = n.replace("9", "1")
n = n.replace("&", "9")
print(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:
S = input()

s = ""
for c in S:
    if c == "9":
        s = s + "1"
    elif c == "1":
        s = s + "9"
    else:
        s = s + c

print(s)

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-


def main():
    n = input()
    ans = ''

    for ni in n:
        if ni == '1':
            ans += '9'
        elif ni == '9':
            ans += '1'

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from functools import reduce

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

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

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

print(new_N)

Submission status: 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()
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:
print("".join({"1":"9", "9":"1"}[i] for i in input()))

Submission status: Accepted

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

Submission status: Accepted

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

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:
def main():
    n = input()
    for c in n:
        if c == '1':
            print('9', end='')
        elif c == '9':
            print('1', end='')
        else:
            print(c, end='')
    print()


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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 ==911:
  print(199)
elif n == 199:
  print(911)
elif n == 919:
  print(191)
elif n ==991:
  print(119)
elif n ==999:
  print(111)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
r = [10 - int(n[i]) for i in range(3)]
print("".join(map(str, r)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input() #199
n = n.replace("1", "_") #_99
n = n.replace("9", "1") #_11
n = n.replace("_", "9") #911
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
ans=''

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
N=0
i=0
while n>0:
    if n%10==1:
        N+=9*10**i
    else:
        N+=1*10**i
    n//=10
    i+=1
print(N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
table=str.maketrans({
	'1':'9',
	'9':'1',
})
#文字列Wの要素を変換する
#'変換前':'変換後'
print(n.translate(table))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=input()

str_output=""

for i in range(3):
    if(N[i]=="1"):
        str_output+="9"
    elif(N[i]=="9"):
        str_output+="1"
        
print(int(str_output))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
n_s = str(n)
digit = 100
for i in range(len(n_s)):
  n = n+8*digit if n_s[i] == '1' else n-8*digit
  digit = digit/10
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:
n = str(input())
print(n.replace('1', '0').replace('9', '1').replace('0', '9'))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding utf-8 -*-
n = str(input())
S = n.replace("1","8")
T = S.replace("9","1")
U = T.replace("8","9")
print(U)

Submission status: Accepted

Solution code:
n = input()
result = []
for i in n:
    if i == "1":  i = "9"
    else:       i = "1"
    result.append(i)

print(int("".join(result)))