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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
if len(set(str(n)))==1:
    print(n)
else:

    while True:
        n+=1
        if len(set(str(n)))==1:
            print(n)
            break

Submission status: Wrong Answer

Solution code:
N=int(input())
Y=[111,222,333,444,555,666,777,888,999]
for i in range(9):
  if N<=Y[i]:
    print(Y[i])
    break

Submission status: Wrong Answer

Solution code:
n = input()
num = int(n)
ans = 0
for digit in range(1,10):
    if int(num/digit) == 111:
        ans = num
        break
    elif int(num/digit) < 111:
        ans = digit*100+digit*10+digit
        break
print(str(ans))

Submission status: Wrong Answer

Solution code:
n = input()
num = int(n)
ans = 0
for digit in range(1,10):
    if int(num/digit) == 111:
        ans = num
        break
    elif int(num/digit) < 111:
        ans = digit*100+digit*10+digit
        break
print(ans)

Submission status: Wrong Answer

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

print(n)

Submission status: Wrong Answer

Solution code:
N = input()
print(N)
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

print(n)

Submission status: Wrong Answer

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

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
s = int((N - 1) / 111)

x = (s + 1) * 111
print(x)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(str(n))
m = int(a[0])*100 + int(a[0])*10 + int(a[0]) 
o = (int(a[0])+1)*100 + (int(a[0])+1)*10 + (int(a[0])+1)
if m < n: 
 print(o)
else:
 print(m)

Submission status: Wrong Answer

Solution code:
n = raw_input()
print ("N is "+n)
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 ("Result is "+str(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
for i in range(int(input()), 1000):
  if(str(i)[0] == str(i)[1] and str(i)[1] == str(i)[2]):
    print(i)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ans=[]
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:
        print(9,end="")
    else:
        print(1,end="")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = list(input())

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

print(''.join(N))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
def solve():
    #n = input()
    n = '999'
    n = n.replace('1', '.')
    n = n.replace('9', '1')
    n = n.replace('.', '9')
    res = n
    return str(res)

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

Submission status: Wrong Answer

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC111
# A AtCoder Beginner Contest999
n = list(input())
for i in range(len(n)):
    if n[i] == "1":
        n.pop(i)
        n.insert(i, "9")
    elif n[i] == "9":
        n.pop(i)
        n.insert(i,"1")
print(int("".join(n)))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
if (n-n%100)/100==1:
    n+=800
else:
    n-=800

if (n%100-(n%100)%10)/10==1:
    n+=80
else:
    n-=80

if n%10==1:
    n+=8
else:
    n-=8
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

print(int(n))

Submission status: Accepted

Solution code:

url = "https://atcoder.jp//contests/abc111/tasks/abc111_a"

def main():
    s = input()
    print(s.translate(str.maketrans({'1': '9', '9': '1'})))
    
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(''.join(map(str, new_list)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
i=0
a=n[i].replace('1', '9') if n[i]=='1' else n[i].replace('9', '1')
i=1
b=n[i].replace('1', '9') if n[i]=='1' else n[i].replace('9', '1')
i=2
c=n[i].replace('1', '9') if n[i]=='1' else n[i].replace('9', '1')
print(a+b+c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
l1 = []
l2 = []
for i in range(len(a)):
  l1.append(a[i:i+1])
for i in range(len(a)):
  l2.append(str(abs(int(l1[i]) - 10)))
print("".join(l2))

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

Submission status: Accepted

Solution code:
s = list(input())

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

t = ''
for i in range(3):
  t += s[i]
  
print(t)

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

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:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# 約数生成
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

inf = 10 ** 18
mod = 10 ** 9 + 7

n = ir()
print(1110-n)

Submission status: Accepted

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

Submission status: Accepted

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

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:
moji = str(input())
ans = ""
for i in range(len(moji)):
    ans += ("1","9")[moji[i]=="1"]
print(ans)

Submission status: Accepted

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

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:
def main():
    n = input()
    print("".join("9" if s=="1" else "1" for s in n))


main()

Submission status: Accepted

Solution code:
def main():
    # n = int(input())
    # h, w, k = map(int, input().split())
    # a = list(map(int, input().split()))
    s = input()
    ans = ""
    for i in s:
        if i == "1":
            ans += "9"
        else:
            ans += "1"
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input())

for i in range (0, len(a)):
    if a[i] == "1":
        a[i] = "9"
    elif a[i] == "9":
        a[i] = "1"
    print(a[i], end = "")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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(int(''.join(n)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for w in n:
    if w == '1':
        ans += '9'
    else:
        ans += '1'

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n = S()
    ans = ''
    for c in n:
        if c == '1':
            ans += '9'
        elif c == '9':
            ans += '1'
        else:
            ans += c
    print(ans)


main()

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"
    
S=""

for j in range(3):
  S+=n[j]
print(S)

Submission status: Accepted

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
n01 = n.replace('1', 'x')
n02 = n01.replace('9', 'y')
n03 = n02.replace('x', '9')
n04 = n03.replace('y', '1')
print(n04)

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = input()

    res = ""
    for x in n:
        res += "9" if x == "1" else "1"

    print(res)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
s = list(input())
def slv(i):
    if i == 1 or i == 9:
        return 10-i
    else:
        return i
print(str(slv(int(s[0])))+str(slv(int(s[1])))+str(slv(int(s[2]))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
import numpy as np
import math


sList = list(str(input()))
for i in range(3):
	if sList[i] == "1":
		sList[i] = "9"
	else:
		sList[i] = "1"

print("".join(sList))

Submission status: Accepted

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

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

Submission status: Accepted

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


def main():
    N = input()

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()

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

print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = ""
for s in S:
    if s == "1":
        ans += "9"
    if s == "9":
        ans += "1"
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

m = ""

for x in n:
    if x == "1":
        m += "9"
    elif x == "9":
        m += "1"
    else:
        m += x

print(int(m))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input())

for i in range(3):
  if a[i] == "9":
    a[i] = "1"
  else:
    a[i] = "9"
    
print(a[0]+a[1]+a[2])

Submission status: Accepted

Solution code:
dict={"1":"9","9":"1"}
s=input()
print(dict[s[0]]+dict[s[1]]+dict[s[2]])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    n = readline().strip()
    print(n.translate(n.maketrans('19', '91')))

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [input() for _ in range(n)]


n = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def switch(n):
    if n == '1':
        return '9'
    elif n == '9':
        return '1'
    else:
        return n


def main():
    N = ns()
    ans = ''
    for n in N:
        ans += switch(n)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def main():
    n = input()
    result = []
    for i in n:
        if i == '1':
            result.append('9')
        elif i == '9':
            result.append('1')
        else:
            result.append(i)
    print(result[0] + result[1] + result[2])


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

print(''.join(l))

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','a').replace('9','1').replace('a','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 = input()
ans = ""
for i in n:
  if i =="1":
    ans += "9"
  else:
    ans += "1"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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