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: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
*V,=map(int,input().split())
import collections import Counter

c1=Counter(V[0::2]).most_common()+[(0,0)]
c2=Counter(V[1::2]).most_common()+[(0,0)]
if c1[0][0]!=c2[0][0]:
    print(N-c1[0][1]-c2[0][1])
else:
    print(min(N-c1[0][1]-c2[1][1],N-c1[1][1]-c2[0][1]))

Submission status: Runtime Error

Solution code:
N=int(input())
*V,=map(int,input().split())
import collections

c1=collections.Counter(V[0::2]).most_common()
c2=collections.Counter(V[1::2]).most_common()
c1.append([0,0])
c2.append([0,0])
if c1[0][0]!=c2[0][0]:
    print(N-c1[0][1]-c2[0][1])
else:
    print(min(N-c1[0][1]-c2[1][1],N-c1[1][1]-c2[0][1]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#111a
print(input().replace(1,x).replace(9.1).replace(x,9))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# abc111_a.py
# https://atcoder.jp/contests/abc111/tasks/abc111_a

# A - AtCoder Beginner Contest 999 /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# 猫のすぬけは文字を書く練習をしています。 
# すぬけは今日、数字の 1 と 9 を書く練習をしていたのですが、 間違えて 1 と 9 をあべこべに書いてしまいました。
# すぬけが書いた 3桁の整数 n が与えられます。 
# nに含まれる 1 という桁をそれぞれ 9 に、 9 という桁をそれぞれ 1 に置き換えて得られる整数を出力してください。

# 制約
#     111≤n≤999
#     nは各桁が 1 か 9 である整数

# 入力
# 入力は以下の形式で標準入力から与えられる。
# n

# 出力
# nの各桁の 1 と 9を入れ替えた整数を出力してください。

# 入力例 1
# 119

# 出力例 1
# 991

# 一の位の 9 を 1 に、十の位の 1 を 9 に、百の位の 1 を 9 に書き換えた 991 が答えとなります．

# 入力例 2
# 999

# 出力例 2
# 111


def calculation(lines):
    # N = int(lines[0])
    # X, Y = list(map(int, lines[0].split()))
    n = lines[0]

    return [n.replace('9', 'a').replace('1', '9').replace('a', '1')]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['119']
        lines_export = ['991']
    if pattern == 2:
        lines_input = ['999']
        lines_export = ['111']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = list(input())
l = []
for i in range(s):
  if i == "1":
    l.append("9")
  elif i == "9":
    l.append("1")
  else:
    l.append(i)
for k in l:
  print(k,end="")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = list(input())
for n in S:
  if N == '1':
  	N = '9'
  elif N == '9':
    N = '1'
A = int(''.join(S))
print(A)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()


ans=""

if n[0]=="1":
ans=ans+"9"
else:
ans=ans+"1" 

if n[1]=="1":
ans=ans+"9"
else:
ans=ans+"1" 


if n[2]=="1":
ans=ans+"9"
else:
ans=ans+"1"


print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
import collections

n=int(input())

l=list(map(int, input().split())) 


one=[]
two=[]

for i in range(0,int(math.floor(n/2))):
    one.append(l[int(2*i)])
    two.append(l[int(2*i+1)])

c_one = collections.Counter(one)
c_two = collections.Counter(two)


if c_one.most_common()[0][0]==c_two.most_common()[0][0]:
    if c_one.most_common()[0][1]==int(math.floor(n//2)):
        print(int(math.floor(n/2)))

    else:
        if c_one.most_common()[0][1]>c_two.most_common()[0][1]:
            print(int(n-c_one.most_common()[0][1]-c_two.most_common()[0][2]))

        elif c_one.most_common()[0][1]<c_two.most_common()[0][1]:
            print(int(n-c_one.most_common()[0][2]-c_two.most_common()[0][2]))

        else:
            print(int(n-c_one.most_common()[0][2]-c_two.most_common()[0][2]))
else:
    print(int(n-c_one.most_common()[0][1]-c_two.most_common()[0][1]))

Submission status: Runtime Error

Solution code:
m=input()
def s(x):
  if x=='1':
    return '9'
  else:
    return '1'
print(s(m[0])+s(m[1])+s(m[2])

Submission status: Runtime Error

Solution code:
m=input()
def s(x):
  if x=='1':
  	return '9'
  else:
    return '1'
print(s(m[0])+s(m[1])+s(m[2])

Submission status: Runtime Error

Solution code:
m=input()
def s(x):
  if x=='1'
  	return '9'
  else:
    return '1'
print(s(m[0])+s(m[1])+s(m[2])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    n = i_input()
    
    str_n = str(n)

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

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
i = 0
for number in n:
    if number == '1':
        m[i] = '9'
        i = i + 1
    elif number == '9':
        m[i] = '1'
        i = i + 1
    else:
        m[i] = n[i]
        i = i + 1

print(n)

Submission status: Runtime Error

Solution code:
n = input()
i = 0
for number in n:
    if number == '1':
        n[i] = '9'
        i = i + 1
    elif number == '9':
        n[i] = '1'
        i = i + 1
    else:
        i = i + 1

print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
v=list(map(int,input().split()))
odd=[[0,0] for i in range(10**5+1)]
even=[[0,0] for i in range(10**5+1)]
for i in range(1,10**5+1):
    odd[i][1]=i
    even[i][1]=i
for i in range(n):
    if (i+1)%2==1:
        odd[v[i]][0]+=1
    else:
        even[v[i]][0]+=1
odd=sorted(odd,reverse=True)
even=sorted(even,reverse=True)
ans=0
if(odd[0][0]+even[0][0]==n): #odd[0][0]=n//2
    if(odd[0][1]==even[0][1]):
        ans=n//2
    else:
        ans=0

else:
    # odd 19,1 even 20,19のときに、(1+20)=21よりも(19+19)=38のほうがいいい。
    if(odd[0][1]==even[0][1]):
        if(odd[0][0]+even[1][0]<=odd[1][0]+even[0][0]):
            ans=(n//2-odd[1][0])+(n//2-even[0][0])
        else:
            ans=(n//2-odd[0][0])+(n//2-even[1][0])

    else:
        ans=(n//2-odd[0][0])+(n//2-even[0][0])
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collections import*
n, *v = map(int, open(0).read().split())
a, b = [Counter(v[i::2]).most_common() + [(0,0)] for i in (0,1)]
s, x = a[0]
t, y = b[0]
print(n - [x+y, max(x+b[1][1], y+a[1][1])][s==t])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()

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

Submission status: Runtime Error

Solution code:
n = input()

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

Submission status: Runtime Error

Solution code:
n = input()

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

Submission status: Runtime Error

Solution code:
n = input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=str(input())
if S[0]=='1':s[0]='9'
if S[0]=='9':s[0]='1'
if S[1]=='1':s[1]='9'
if S[1]=="9":s[1]="1"
if S[2]=='1':s[2]='9'
if S[2]=='9':s[2]='1'
print(s)

Submission status: Runtime Error

Solution code:
S=str(input())
if S[0]=='1':S[0]='9'
if S[0]=='9':S[0]='1'
if S[1]=='1':S[1]='9'
if S[1]=='9':S[1]='1'
if S[2]=='1':S[2]='9'
if S[2]=='9':S[2]='1'
print(S)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

n = input()
ans = ""

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

Submission status: Runtime Error

Solution code:
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def split_even_or_odd(vv, n, start):
    res = {}
    for i in range(start,n,2):
        v = vv[i]
        if not v in res.keys(): res[v] = 1
        else: res[v] += 1
    return res

def find_fs(target):
    maxk1 = maxv1 = 0
    for k, v in target.items():
        if maxv1 < v:
            maxk1, maxv1 = k, v
    maxk2 = maxv2 = 0
    for k, v in target.items():
        if maxv2 < v and maxk1 != k:
            maxk2, maxv2 = k, v
    return (maxk1, maxv1), (maxk2, maxv2)

def main():
    n = II()
    vv = MII()
    ee = split_even_or_odd(vv, n, 0)
    oo = split_even_or_odd(vv, n, 1)

    e1kv, e2kv = find_fs(ee)
    o1kv, o2kv = find_fs(oo)

    minv = 10**5
    if e1kv[0] != o1kv[0]:
        minv = min(minv, n - (e1kv[1] + o1kv[1]))
    else:
        minv = min(minv, n - (e1kv[1] + o2kv[1]))
        minv = min(minv, n - (e2kv[1] + o1kv[1]))
    print(minv)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
A = []
A.append(N//100)
A.append(N//10-A)
A.append(N-A-B)
for i in range(3):
    if A[i]==1:
        A[i]=9
    if A[i]==9:
        A[i]=1
print(A[0]*100+A[1]*10+A[2])

Submission status: Runtime Error

Solution code:
from collections import Counter
n = int(input())
v = list(map(int, input().split()))
kisu = []
gusu = []
flag = True
for el in v:
    if flag:
        kisu.append(el)
    else:
        gusu.append(el)
    flag = not flag
a = Counter(kisu)
b = Counter(gusu)
a_max = list(a.values())[0]
b_max = list(b.values())[0]
if list(a.keys())[0] == list(b.keys())[0]:
    if a_max > b_max:
        b_max = list(b.values())[1]
    elif a_max < b_max:
        a_max = list(a.values())[1]
    else:
        if len(a) == 1 and len(b) == 1:
            a_max = 0
        else:
            a_max2 = list(a.values())[1]
            b_max2 = list(b.values())[1]
            if a_max2 < b_max2:
                b_max = b_max2
            else:
                a_max = a_max2
print(len(v)-a_max-b_max)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
if s[0] == '1':
  s[0] = '9'
else:
  s[0] = '1'
if s[1] == '1':
  s[1] = '9'
else:
  s[1] = '1'
if s[2] == '1':
  s[2] = '9'
else:
  s[2] = '1'
print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
V = [int(i) for i in input().split()]

Vodd = V[1::2]
Veven = V[::2]

from collections import Counter

Vodd = sorted(Counter(Vodd).items(), key=lambda x:x[1])
Veven = sorted(Counter(Veven).items(), key=lambda x:x[1])

if Vodd[-1][0] == Veven[-1][0]:
    if len(Vodd) == len(Veven) == 1:
        ans = N - Vodd[-1][1]
    elif len(Vodd) == 1:
        ans = N - Vodd[-1][1] - Veven[-2][1]
    elif len(Veven) == 1:
        ans = N - Vodd[-2][1] - Veven[-1][1]
    elif Vodd[-2][1] >= Veven[-2][1]:
        ans = N - Vodd[-2][1] - Veven[-1][1]
    else:
        ans = N - Vodd[-1][1] - Veven[-2][1]
else:
    ans = N - Vodd[-1][1] - Veven[-1][1]


print(ans)

Submission status: Runtime Error

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

N=list(input())

for i in range(10):
    if 111*i<N<=111*(i+1):
        print(111*(i+1))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x=raw_input()
print 1110-x

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = list(input())
for i in 3:
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
for j in 3:
    print(j, end = "")

Submission status: Runtime Error

Solution code:
n = list(input())
for i in 3:
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
for j in 3:
    print(n[j], end = "")

Submission status: Runtime Error

Solution code:
n =int(input)
lst = []
while n > 0:
    lst.append(n% 10)
    n //= 10
lst.reverse()
for i in 3:
    if lst[i] == "1":
        lst[i] == "9"
    elif lst[i] == "9":
        lst[i] == "1" 
print(lst)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input().split()
r = 0
if s[0] == '1':
  r += 900
else:
  r += 100
if s[1] == '1':
  r += 90
else:
  r += 10 
if s[2] == '1':
  r += 9
else:
  r += 1 

print(r)

Submission status: Runtime Error

Solution code:
text = list(input())

def swap(char, a, b):
    if char == a:
        return(b)
    if char == b:
        return(a)

res = list(map(lambda x: swap(x, "1", "9"), text))
print("".join(res))
~

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(s)

Submission status: Runtime Error

Solution code:
##### 解けた #####

n=list(map(int,list(input())))
no=[] # 出力

for ni in n:
    no.append(10-ni)

print("".join(no))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A=int(input().split())
for i in range(3):
  if A[i]==1:
    A[i]=9
  else if A[i]==9:
    A[i]=1
print(A)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(s)

Submission status: Runtime Error

Solution code:
 n = input()
 dict = {"1" : "9", "9" : "1"}
 ans = ""
for i in range(len(n)) :
    ans += dict[n[i]]
print(ans)

Submission status: Runtime Error

Solution code:
n = str(input())
for i, s in enumerate(n):
  if s == "1":
    n[i] = "9"
  elif s == "9":
    n[i] = "1"

print(int(n))

Submission status: Runtime Error

Solution code:
from sys import stdin
from itertools import groupby

n = int(stdin.readline().rstrip())

li = list(map(int,stdin.readline().rstrip().split()))

li1 = []
li2 = []

for i in range(n):
    if i % 2 == 0:
        li1.append(li[i])
    else:
        li2.append(li[i])

li1.sort()
li2.sort()

lin = []
lin2 = []

for key, value in groupby(li1):
    lin.append((key,len(list(value))))
for key, value in groupby(li2):
    lin2.append((key,len(list(value))))

lin.sort(key=lambda x:(x[1]))
lin2.sort(key=lambda x:(x[1]))

point = 0

if lin[-1][0] == lin2[-1][0] and lin[-1][1] == lin2[-1][1]:
    if len(lin) == 1:
        print(n//2)
    else:
        if lin[-2][1] >= lin2[-2][1]:
            print(n-lin[-2][1]-lin2[-1][1])
        else:
            print(n-lin[-1][1]-lin2[-2][1])

elif lin[-1][0] == lin2[-1][0]:
    if len(lin) == 1:
        print(n//2-lin2[-2][1])
    elif len(lin2) == 1:
        print(n//2-lin[-2][1])
    else:
        if lin[-2][1] >= lin2[-2][1]:
            print(n-lin[-1][1]-lin2[-2][1])
        else:
            print(n-lin[-2][1]-lin2[-1][1])
else:
    print(n-lin[-1][1]-lin2[-1][1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
V=list(map(int,input().split()))
A=[0]*(10**5+1)
B=[0]*(10**5+1)
for i in range(N):
  if(i%2==0):
    A[V[i]]+=1
  else:
    B[V[i]]+=1
MA=0
NA=A[0]
MB=0
NB=B[0]
for i in range(10**5+1):
  if(A[i]>=NA):
    NA=A[i]
    MA=i
  if(B[i]>=NB):
    NB=B[i]
    MB=i
A.sort(reverse=True)
B.sort(reverse=True)
if(MA!=MB):
  print(N-NA-NB)
else:
  print(min(N-A[0]-B[1],N-A[1]-B[0]))

Submission status: Runtime Error

Solution code:
n=input()

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

Submission status: Runtime Error

Solution code:
n=input()
l=[1,9]
for i in n:
    print(l[l.index(i)-1],end='')
print()
    n=input()
l=['1','9']
for i in n:
    print(l[l.index(i)-1], end = '')
print()

Submission status: Runtime Error

Solution code:
n=input()
l=[1,9]
for i in n:
    print(l[l.index(i)-1],end='')
print()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, c =input().split()
a.replace("1","9")
b.replace("1","9")
c.replace("1","9")
print(a+b+c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = str(input())

for n in N:
    n = str(eval(10 - n))
    
print(int(n))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=list(input())
for i in n:
  if n[i] == '1':
    n[i] = '9'
  elif n[i] == '9':
    n[i] = '1'

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