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:
num=input()
num_list=list(num)

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




num_changed="".join(num_list)

print(int(num_changed))

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(ans)

main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
n = int(input())

n100 = (int)(n / 100)
if n100 == 1:
    n100 = 9
else:
    n100 = 1

n10 = (int)(n / 10) % 10
if n10== 1:
    n10 = 9
else:
    n10 = 1
    
n1 = n % 10
if n1 == 1:
    n1 = 9
else:
    n1 = 1
    
result = n100 * 100 + n10 * 10 + n1
print(result)

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 = list(input())
i = 0
while i < len(N):
    if N[i] == '1':
        N[i] = '9'
    else:
        N[i] = '1'
    i += 1
N = ''.join(N)
print(N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word1 = list(input())
word2 = ""
for c in word1:
    if c == "9":
        word2 += "1"
    elif c == "1":
        word2 += "9"
    else:
        word2 += c
print(word2)

Submission status: Accepted

Solution code:
n = input()
chars = list(n)
result = ""
for digit in chars:
    if digit == '9':
        result = result + '1'
    elif digit == '1':
        result = result + '9'
    else:
        result = result + digit

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=input()


A=N.replace('1','A').replace('9','B')
B=A.replace('A','9').replace('B','1')

print(B)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(add_stock)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
input_line = input()
print_text = ""

for c in input_line:
    if c == "1":
        c = "9"
    elif c == "9":
        c = "1"
    print_text += c

print(print_text)

Submission status: Accepted

Solution code:
n = input()
l = [int(x) for x in list(str(n))]
ans = [0,0,0]
for cnt in range(3):
	if l[cnt] == 1:
		ans[cnt] = 9
	elif l[cnt] == 9:
		ans[cnt] = 1
	else:
		ans[cnt] = l[cnt]
ansn =  ans[0] * 100 + ans[1] * 10 + ans[2]
print(ansn)

Submission status: Accepted

Solution code:
n = int(input())

a = 1110 - n
print(a)

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def is_all_same(S):
    pre_s = S[0]
    for s in (S):
        if s != pre_s:
            return False
    return True

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    N = int(input_raw[0])
    S = str(N)
    new_S = ""
    for s in S:
        if s == "9":
            new_S += "1"
        elif s == "1":
            new_S += "9"
        else:
            new_S = s
    print int(new_S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = input()

l = [int(x) for x in list(str(n))]

for num in l:
    if num == 1:
        print('9', end='')
    elif num == 9:
        print('1', end='')
    else:
        print('0', end='')

Submission status: Accepted

Solution code:

#
n = int(input())

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

        nn = n1 *100 + n2*10 + n3

        print(nn)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

number = list(n)

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

ansewer = "".join(number)
        
print(ansewer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def change(fig):
    sum = 0
    a = 100
    for keta in fig:
        if keta == 1:
            keta = 9
        elif keta == 9:
            keta = 1
        sum += keta * a
        a /= 10
    return sum
        
if __name__ == "__main__":
    n = input()
    fig = list(map(int, list(n)))
    sum = change(fig)
    print(int(sum))

Submission status: Accepted

Solution code:
n = input()
num = [n[i] for i in range(len(n)) ]
#print(num)
for i in range(len(num)):
    s = num[i]
    if s == "1":
        num[i] = "9"
    elif s == "9":
        num[i] = "1"
#print(num)
n2 = "".join(num)
print(int(n2))

Submission status: Accepted

Solution code:
A=[]
A=list(input())
B=[]
for i in range(3):
    if A[i]=='1':
        B.append('9')
    else:
        B.append('1')
C=B[0]+B[1]+B[2]
print(C)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

m = ''
for n in N:
    if n == '9':
        m += '1'
    else:
        m += '9'
print(m)

Submission status: Accepted

Solution code:
A = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())
s = list(s)
result=''
for i in enumerate(s):
    if i[1]== '9':
        s[i[0]] = '1'
    if i[1] == '1':
        s[i[0]] = '9'
for k in s:
    result += k
print(result,end='')

Submission status: Accepted

Solution code:
n=int(input())

if n%10==1:
    n=n-1+9
elif n%10==9:
    n=n-9+1
    

if int((n%100)/10)==1:
    n=n-10+90
elif int((n%100)/10)==9:
    n=n-90+10


if int(n/100)==1:
    n=n-100+900
elif int(n/100)==9:
    n=n-900+100

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
if n >= 900:
    a = 100
    n -= 900
else:
    a = 900
    n -= 100
if n >= 90:
    a += 10
    n -= 90
else:
    a += 90
    n -= 10
if n == 9:
    a += 1
else:
    a += 9

print(a)

Submission status: Accepted

Solution code:
n = input()
n = n.replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1")
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 = int(input())
if (n == 999):
   print("111")
elif (n == 991):
    print("119")
elif (n == 911):
    print("199")
elif (n == 919):
    print("191")
elif (n == 199):
    print("911")
elif (n == 191):
    print("919")
elif (n == 199):
    print("911")
elif (n == 119):
    print("991")
elif (n == 111):
    print("999")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num=list(input())
ans=[]
for i in num:
    if i=="1":
        ans.append("9")
    else:
        ans.append("1")

mojiretu = ' '
for x in ans:
    mojiretu += x

print(mojiretu)

Submission status: Accepted

Solution code:
# coding: utf-8
s=input()
l=list(s)
i=0
while(i<3):
  if(l[i]=="1"):
    l[i]="9"
  elif(l[i]=="9"):
    l[i]="1"
  i+=1
a="".join(l)
print(a)

Submission status: Accepted

Solution code:
n = input()

n = n.replace("1","ichi")
n = n.replace("9","kyu")

n = n.replace("ichi","9")
n = n.replace("kyu","1")

print(n)

Submission status: Accepted

Solution code:
n = input().strip()

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

Submission status: Accepted

Solution code:
N = input()
n=0
if N == "111":
    n = 999
elif N == "119":
    n = 991
elif N == "199":
    n= 911
elif N == "999":
    n = 111
elif N == "911":
    n = 199
elif N == "991":
    n = 119
elif N == "191":
    n = 919
elif N == "919":
    n = 191

print(n)

Submission status: Accepted

Solution code:
n = str(input())
newchar = ''

for char in n:
    if (char == '1'):
        newchar += '9'
    else:
        newchar += '1'

print(newchar)

Submission status: Accepted

Solution code:
n_str = input()
res = 0
for i in range(3):
  s = (10 - int(n_str[i])) * 10**(2-i)
  res = res + s


print(res)

Submission status: Accepted

Solution code:
def main():
    string = raw_input()
    A = string[0]
    B = string[1]
    C = string[2]
    if A == '1':
        A = '9'
    else:
        A = '1'
    if B == '1':
        B = '9'
    else:
        B = '1'
    if C == '1':
        C = '9'
    else:
        C = '1'        
    print(A+B+C)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

input = sys.stdin.readline
a = input().split()
ans = []

a = ','.join(a)
for i in range(3):
    if a[i] == '1':
        ans.append(9)
    else:
        ans.append(1)

print(str(ans[0]) + str(ans[1]) + str(ans[2]))

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:
num = input()
num = num.replace('1','0')
num = num.replace('9', '1')
num = num.replace('0', '9')
print(num)

Submission status: Accepted

Solution code:
n = input()
for i in n:
    print(10-int(i),end="")

Submission status: Accepted

Solution code:
inums = input()
# [int(i)for i in input().split()]
nums = []
for i in inums:
    nums.append(int(i))
o = []
for n in nums:
    if n == 1:
        o.append("9")
    elif n==9:
        o.append("1")
    else:
        o.append(str(n))
print("".join(o))

Submission status: Accepted

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

C=len(n)
N=0
for i in range(C):
  if n[i]=='1':
    N+=10**(C-1-i)*9
  else:
    N+=10**(C-1-i)

print(N)

Submission status: Accepted

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

if a == 1:
    a = 9
elif a == 9:
    a = 1

if b == 1:
    b = 9
elif b == 9:
    b = 1

if c == 1:
    c = 9
elif c == 9:
    c = 1

abc = str(a)+str(b)+str(c)
print(abc)

Submission status: Accepted

Solution code:
a = input()
b = []
for i in a:
    if i == '9':
        b.append('1')
    else:
        b.append('9')
for j in b:
    print(j, end="")

Submission status: Accepted

Solution code:
n = input()

result = ""

for char in n:
 if char is '1':
  result += '9'
 elif char is '9':
    result += '1'

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = raw_input()
result = []
for i in range(0, len(n)):
	if(n[i] == '1'):
		result.append('9')
	elif(n[i] == '9'):
		result.append('1')
	else:
		result.append(n[i])
ans = ''.join(result)
print (ans)

Submission status: Accepted

Solution code:
n = int(input().strip())

def s19(s):
    if s is '9':
        return '1'
    elif s is '1':
        return '9'
    else:
        return s

ns = ''.join(list(map(s19, str(n))))
print(ns)

Submission status: Accepted

Solution code:
n = input()

s = list(n)
if n[0] == '1':
    s[0] = '9'
elif n[0] == '9':
    s[0] = '1'
if n[1] == '1':
    s[1] = '9'
elif n[1] == '9':
    s[1] = '1'
if n[2] == '1':
    s[2] = '9'
elif n[2] == '9':
    s[2] = '1'
str_changed = "".join(s)
print(str_changed)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
num = list(n)
for i in range(len(num)):
    if num[i] == "1":
        num[i] = "9"
        continue
    if num[i] == "9":
        num[i] ="1"
        continue

num = ''.join(num)
print(int(num))

Submission status: Accepted

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

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

print("".join(list(map(str, 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"
ans = int("".join(n))
print(ans)

Submission status: Accepted

Solution code:
# coding:utf-8

n = str(input())
m = str()

for c in n:
    if c == '1':
        m += '9'
    else:
        m += '1'

print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
if(n[0]=='9'):
    m=100
else:
    m=900

if(n[1]=='9'):
    m=m+10
else:
    m=m+90

if(n[-1]=='9'):
    m=m+1
else:
    m=m+9
    
print(m)

Submission status: Accepted

Solution code:
orig = input()
output = ""
for i in orig:
    if i == "1":
        output += "9"
    elif i == "9":
        output += "1"
print(output)

Submission status: Accepted

Solution code:
n = list(input())

output = []
for i in n:
    if i == '1':
        output.append('9')
    else:
        output.append('1')

print(''.join(output))

Submission status: Accepted

Solution code:
n = input()

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

print(n)

Submission status: Accepted

Solution code:
l = list(input())
for i in range(len(l)) :
    if l[i] == '1':
        l[i] = '9'
    elif l[i] == '9':
        l[i] = '1'
print(''.join(map(str, l)))

Submission status: Accepted

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

Submission status: Accepted

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

print(k)

Submission status: Accepted

Solution code:
n = int(input())
num =[]
for i in range(3):
  num.append(int(n%10))
  n /= 10
if(num[0] == 1):
  num[0] = 9
elif(num[0] == 9):
  num[0] = 1
if(num[1] == 1):
  num[1] = 9
elif(num[1] == 9):
  num[1] = 1
if(num[2] == 1):
  num[2] = 9
elif(num[2] == 9):
  num[2] = 1
print(num[0]+num[1]*10+num[2]*100)

Submission status: Accepted

Solution code:
s = int(input())

print(1110 - s)

Submission status: Accepted

Solution code:
s=list(input())


a = 0
while a < 3:
  if s[a] == "1":
    s[a] = "9"
  elif s[a] == "9":
    s[a] = "1"
  a += 1

s = ''.join(s)


print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = 1110 - n
print(x)

Submission status: Accepted

Solution code:
import numpy as np

x = input()
x = str(x)
y = 0
z = len(x)
for i in range(z):
  if x[i] == '1':
    y = y + 9 * (10 ** (z - i - 1))
  else:
    y = y + 1 * (10 ** (z - i - 1))
print(y)

Submission status: Accepted

Solution code:
n = int(input())
N = str(n)
array = list(map(int, list(N)))
for i in range(0, len(array)):
    if array[i] == 1:
        array[i] = 9
    elif array[i] == 9:
        array[i] = 1
print(array[0], end = '')
print(array[1], end = '')
print(array[2])

Submission status: Accepted

Solution code:
n = list(input())

ans = ''

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())

ans = 0

if n % 10 == 9:
    ans += 1
else:
    ans += 9
n = int(n/10)


if n % 10 == 9:
    ans += 10
else:
    ans += 90
n = int(n/10)
if n % 10 == 9:
    ans += 100
else:
    ans += 900


print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
numList=list(input())

ansList=[]
for i in numList:
  if(i=="1"):
    ansList.append("9")
  else:
    ansList.append("1")

ans=""
for j in ansList:
  ans+=j

print(int(ans))

Submission status: Accepted

Solution code:
import sys

n = input()
ans = ""

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

    else :
        ans+='9'

print(ans)

Submission status: Accepted

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

for i in range(len(a)):
    print(a[i] ,end="")

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

input = raw_input()

result = ""
for i in range(0, 3):
    if input[i] == "1":
        result += "9"
    elif input[i] == "9":
        result += "1"
    else:
        result += input[i]

print int(result)

Submission status: Accepted

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

s = s.replace("9","1")

s = s.replace("2","9")

print(s)

Submission status: Accepted

Solution code:
s = raw_input().strip()
t = ''
for c in s:
    if c == '1': t += '9'
    elif c == '9': t += '1'
    else: t += c
print t

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
a = ""
for i in n:
    if i=="1":
        a += i.replace("1","9")
    elif i=="9":
        a += i.replace("9","1")
    else:
        a += i
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print("".join(list(map(lambda x: "9" if x=="1" else "1", input()))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

ans = ""

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

print(ans)

Submission status: Accepted

Solution code:
import sys 

n = str(input())
ans = ''
for num in n:
  if num == '1':
    ans += '9'
  elif num == '9':
    ans += '1'
print(ans)

Submission status: Accepted

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

n = input()
n = n.replace("1","*")
n = n.replace("9","1")
n = n.replace("*","9")
print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
if n % 10 == 1:
    m = 9
else:
    m = 1
n //= 10
if n % 10 == 1:
    m += 90
else:
    m += 10
n //= 10
if n % 10 == 1:
    m += 900
else:
    m += 100
print(int(m))

Submission status: Accepted

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


def main():
    n = input()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
ans=[]
ans2=[]
n=int(input())
a=n//100
b=(n-a*100)//10
c=n-a*100-b*10
ans.append(a)
ans.append(b)
ans.append(c)
for i in ans:
    if i==1:
        ans2.append(str(9))
    else:
        ans2.append(str(1))
print(''.join(ans2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
m = ''
a = str(10 - int(n[0]))
b = str(10 - int(n[1]))
c = str(10 - int(n[2]))
print(a+b+c)

Submission status: Accepted

Solution code:
n = [i for i in input()]

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:
# AtCoder Beginner Contest 111 20180929
# Question:A
 
def main(nums):
 
	ref = '1'*len(nums)+'0'
 
 
	return int(ref)-int(nums)
 
 
 
 
nums = input()
print(main(nums))

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'
s = ''.join(n)
print(s)

Submission status: Accepted

Solution code:
n = input()

l = []

n=str(n)

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

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

Submission status: Accepted

Solution code:
S = input()
R = ''

for s in S:
    if s == '1':
        R += '9'
    elif s == '9':
        R += '1'
    else:
        R += s

print(R)

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:
num = input()
x = [int(i) for i in num]
for i in range(len(x)):
    if x[i] == 1:
        x[i] = "9"
    else:
        x[i] = "1"
mojiretu = ''.join(x)
print(int(mojiretu))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(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(ans)

Submission status: Accepted

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

Submission status: Accepted

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

N = input()
# A = list(map(int, input().split()))

for s in N:
	if s == "1":
		print("9", end="")
	else:
		print("1", end="")

Submission status: Accepted

Solution code:
n = input()

result = ''

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

Submission status: Accepted

Solution code:
n = input()
res = str()

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

Submission status: Accepted

Solution code:
#encoding utf-8

n = list(str(input()))

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

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

print("".join(n))

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    s = input()
    mod = ''

    for i in range(3):
        if s[i] == '1':
            mod += '9'
        elif s[i] == '9':
            mod += '1'

    print(mod)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
l = [int(x) for x in list(str(a))]
s = ""
for i in l:
  if i == 1:
    s += "9"
  elif i == 9:
    s += "1"
print(int(s))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 一つの数字の入力
a = int(input())

print(1110 - a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(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()
a=[]
for i in range(3):
    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:
def main():
    N = input()
    out = ""
    for i in range(3):
        n = N[i]
        if n == "1":
            out += "9"
        elif n == "9":
            out += "1"
        else:
            out += n
    return out

if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
n = input()
m = []
for i in range(len(n)):
    if n[i] == '1':
        m.append('9')
    elif n[i] == '9':
        m.append('1')
    else:
        m.append(n[i])

print(''.join(m))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
m =n.replace("1","a")
o =m.replace("9","b")
p =o.replace("a","9")
q =p.replace("b","1")
print(int(q))

Submission status: Accepted

Solution code:
#coding: utf-8
print(1110 - int(input()))

Submission status: Accepted

Solution code:
# vim: set fileencoding=utf-8:


def main():
    n = raw_input()
    ans = ""
    for i, alp in enumerate(n):
        if alp == "1":
            ans += "9"
        elif alp == "9":
            ans += "1"
        else:
            ans += alp

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A_list = list(input())
ans = []
for a in A_list:
    if a == '1':
        ans.append('9')
    if a == '9':
        ans.append('1')

answer = ''
for x in ans:
    answer += x
print(answer)