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

from collections import Counter

n = int(input())

v = []
v1 = []
v2 = []

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

for i in range(int(n/2)):
    v1.append(v[2*i])
    v2.append(v[2*i+1])

e = Counter(v1)
o = Counter(v2)

ee = e.most_common(2)
oo = o.most_common(2)

if ee[0][0] != oo[0][0]:
    print(n - (ee[0][1]+oo[0][1]))
    sys.exit()

if ee[0][0] == oo[0][0]:
    if len(ee) == 1 and len(oo) == 1:
        print(n - (ee[0][1]))
        sys.exit()

    if len(ee) == 1:
        print(n - (ee[0][1]+oo[1][1]))
        sys.exit()

    if len(oo) == 1:
        print(n - (ee[1][1]+oo[0][1]))
        sys.exit()

    if ee[0][1] == oo[0][1]:
        print(n - (ee[0][1] + min(ee[1][1],oo[1][1])))
    
    if ee[0][1] > oo[0][1]:
        print(n - (ee[0][1]+oo[1][1]))
        sys.exit()
    else:
        print(n - (ee[1][1]+oo[0][1]))
        sys.exit()

Submission status: Runtime Error

Solution code:
n=int(input())
a,b=[None]*100000,[None]*100000
for i in range(100000):
    a[i]=[None]*2
    a[i][0]=0
    a[i][1]=i
    b[i]=[None]*2
    b[i][0]=0
    b[i][1]=i
l=list(map(int,input().split()))
for i in range(n//2):
    a[l[2*i]-1][0]+=1
    b[l[2*i+1]-1][0]+=1
a.sort(reverse=True)
b.sort(reverse=True)
if a[0][1]==b[0][1]:
    print(n-max(a[0][0]+b[1][0],a[1][0]+b[0][0]))
else:
    print(n-a[0][0]-b[0][0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections

n = int(input())
u = list(map(int,input().split()))

hantei = 0

for i in range(0,n):
    if u[0] != u[i]:
        hantei = 1
        break

if hantei == 0:
    print(n // 2)
else:
   u1 = [] 
   u2 = [] 
   ans = 0
   for j in range(n):
       if j % 2 == 0:
           u2.append(u[j])
       else:
           u1.append(u[j])
   u1_list =collections.Counter(u1)
   u2_list =collections.Counter(u2)
   values1, counts1 = u1_list.most_common()[0]
   values2, counts2 = u2_list.most_common()[0]
   if values1 != values2:
       ans += n // 2 - counts1
       ans += n // 2 - counts2
   else:
       if len(u1_list) > 1 and len(u2_list) > 1:
           values3, counts3 = u1_list.most_common()[0]
           values4, counts4 = u2_list.most_common()[0]
           ans1 = n - counts1 - counts4
           ans2 = n - counts2 - counts3
           ans = min(ans1,ans2)
       elif len(u1_list) > 1 and len(u2_list) < 2:
           values3, counts3 = u1_list.most_common()[0]
           ans = n - counts2 - counts3
       elif len(u1_list) < 2 and len(u2_list) > 1:
           values3, counts3 = u2_list.most_common()[0]
           ans = n - counts1 - counts3

       ans = min(ans1,ans2)
   print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
for i in range(3):
  n[i] = 10-n[i]
print(n)

Submission status: Runtime Error

Solution code:
n=input()
for i in range(3):
  n[i] = 10-n[i]
print(n)

Submission status: Runtime Error

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

for i in 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 = map(int,input().split())

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

Submission status: Runtime Error

Solution code:
input_line = str(input())
s = []

for i in range(len(input_line)):
    if input_line[i] == '9':
        s.append('1')
    elif input_line[i] == '1':
        s.append('9')
    else:
        s.append(input_line[i])

print(s)

mojiretu = ''

for x in s:
    mojiretu += x

print(int(mojiretu)

Submission status: Runtime Error

Solution code:
input_line = str(input())
s = []

for i in range(len(input_line)):
  if input_line == '9':
    s.append('1')
  elif input_line == '1':
    s.append('9')
  else:
    s.append(input_line[i])

for x in s:
    mojiretu += x
    
print(mojiretu)

Submission status: Runtime Error

Solution code:
# C
import collections
n = int(input())
lst = list(map(int, input().split()))
lst1 = lst[::2]
lst2 = lst[1::2]
dct1 = sorted(dict(collections.Counter(lst1)).items(), key=lambda x:x[1])
dct2 = sorted(dict(collections.Counter(lst2)).items(), key=lambda x:x[1])

cnt = len(dict(collections.Counter(lst)))
if (cnt == 1):
	print(int(len(lst) / 2))
elif (len(dct1) == 1 and len(dct2) == 1):
	print(0)
elif (len(dct1) == 1 and len(dct2) > 1):
	if (dct1[0][0] == dct2[0][0]):
		print(len(dct2) - dct2[1][1])
	else:
		print(len(dct2) - dct2[0][1])
elif (len(dct2) == 1 and len(dct1) > 1):
	if (dct1[0][0] == dct2[0][0]):
		print(len(dct1) - dct1[1][1])
	else:
		print(len(dct1) - dct1[0][1])
else:
	if (dct1[0][0] == dct2[0][0]):
		print(len(lst) - max(dct1[0][1] + dct2[1][1], dct1[1][1] + dct2[0][1]))
	else:
		print(len(lst) - dct1[0][1] - dct2[0][1])

Submission status: Runtime Error

Solution code:
from corections import Counter 
n = int(input())
v = list(map(int,input().split()))
 
odd = []
even = []
for i in range(n//2):
	odd.append(v[2*i+1])
	even.append(v[2*i])
 
odd = sorted(odd)
even = sorted(even)
ac = Counter(odd).most_common(2)
bc = Counter(even).most_common(2)
def cnt(X):
	count = 0
	ans = 0
	for i in range(len(X)-1):
		if X[i+1] == X[i]:
			count += 1
			ans = max(ans,count)
		else:
			count = 0
	return ans+1
            
if ac[0][0] != bc[0][0]:
  print(len(v)-cnt(odd)-cnt(even))
elif len(ac) == 1 and len(bc) == 1:
	print(n//2)
else:
	print(n-max(ac[0][1]+bc[1][1],ac[1][1]+bc[0][1]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = str(input())
for i in 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 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'
  else:
    N[i] = '1'
 
print(N)

Submission status: Runtime Error

Solution code:
a={"1":"9","9":"1"}
t=input()
n=""
for i is range(3):
  n+=a[t[i]]
print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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 = input()
 
ss = ""
for i in s:
  if s[i] == "1":
  	ss += "9"	
  else:
    ss += "1"
    
print(ss)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()

ss = ""
for i in range(len(S)):
  if s[i] == "1"
  	ss += "9"	
  else:
    ss += "1"
    
print(ss)

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 collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(N - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = N - e[1][1] - o[0][1]
        b = N - e[0][1] - o[1][1]
        print(min(a, b))

Submission status: Runtime Error

Solution code:
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E)
o = collections.Counter(O)
e1=e.most_common()[0][1]
e2=e.most_common()[-1][1]
o1=o.most_common()[0][1]
o2=o.most_common()[-1][1]

Ans=[N-e1-o2,N-e2-o1,N-e2-o2,N-o1-e1]

if len(set(L))==1:
  print(N//2)
else:
  print(min(Ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()

if '1' in n:
  s = s.replace('1', '9')

if '9' in n:
  s = s.replace('9', '1')
  
print(s)

Submission status: Runtime Error

Solution code:
#　 　 　 　　　　　　　 　 　　　　　　　　　　　　　　　　 ,.へ
#　___ 　　　　　　　 　 　 　 　 　　　　　　　　　　　　ﾑ　　i
#　「 ﾋ_i〉　　　 　 　　　　　　 　 　　　　　　　　　　　　 ゝ　〈
#　ﾄ　ノ 　　　　　　　　　　　　　　　　　　　　　　　　　　iニ(()
#　i 　{ 　 　　　　　　　 　　　＿＿＿_ 　 　　　　　　　　| 　ヽ
#　i　　i　　　 　　　　　　　／__,　 , ‐-＼ 　 　 　 　 　　i 　　}
#　|　　 i　　　　　　 　　／（●) 　 ( ● )＼　　　　　　 {､　 λ
#　ト－┤.　　　　　　／ 　 　（__人__） 　　　＼　　　 ,ノ　￣ ,!
#　i　　　ゝ､_ 　　　　|　　　　　´￣` 　 　　　　|　,. '´ﾊ　　　,!
#.　ヽ、 　　　｀`　､,__＼ 　　 　 　　　　　 　 ／"　＼ 　ヽ／
#　　　＼ノ　ﾉ　　　ﾊ￣r/:::r―--―/::７　　 ﾉ　　　　／
#　 　　 　 ヽ.　　　　　　ヽ::〈； . '::. :' |::/　　 /　　　,. "
#　　　　　　　 `ｰ ､　　　　＼ヽ::. ;::：|/　　　　　ｒ'"
#　　　　　／￣二二二二二二二二二二二二二二二二ヽ
""" 　　　| 答 |"""print(1110-int(input())#||
#　　　　　＼＿二二二二二二二二二二二二二二二二ノ

Submission status: Runtime Error

Solution code:

#################################
#配列を二つに分ける
#引数
# values: 配列
# a,b   : 配列の格納先
#戻り値
# なし
#################################
def separate(values,a,b):
    for v in values:
        a.append(v)
        a,b = b,a


##############################
#登場回数の多い数と登場回数を返す
#引数
# values: ソートされた配列
#戻り値
# 辞書型配列
##############################
def getCount(values):
    currentNum=0
    currentCount=0
    ret={'First' :{'Num':[],'Cnt':0},
         'Second':{'Num':[],'Cnt':0}}
    for v in values:
        if v==currentNum:
            currentCount+=1
        else:
            #別の数字が表れた場合
            if ret['First']['Cnt'] < currentCount:
                #最大値より大きい場合、それが新たな最大値になる
                ret['Second']=ret['First'].copy()
                ret['First']={'Num':[currentNum],'Cnt':currentCount}
            elif ret['First']['Cnt'] == currentCount:
                #最大値タイ
                ret['First']['Num'].append(currentNum)
            elif ret['Second']['Cnt'] < currentCount:
                #2番目より大きい場合、それが新たな2番目になる。
                ret['Second']={'Num':[currentNum],'Cnt':currentCount}
            elif ret['Second']['Cnt'] == currentCount:
                #2位タイ
                ret['Second']['Num'].append(currentNum)

            currentNum=v
            currentCount=1

    #配列の最後まで来た場合
    if ret['First']['Cnt'] < currentCount:
        ret['Second']=ret['First'].copy()
        ret['First']={'Num':[currentNum],'Cnt':currentCount}
    elif ret['First']['Cnt'] == currentCount:
        ret['First']['Num'].append(currentNum)
    elif ret['Second']['Cnt'] < currentCount:
        ret['Second']={'Num':[currentNum],'Cnt':currentCount}
    elif ret['Second']['Cnt'] == currentCount:
        ret['Second']['Num'].append(currentNum)

    return ret


#############################
# メイン
#############################
n = input()
vars = input ()
a=[]
b=[]
varArray=vars.split(" ")
separate(varArray,a,b)
a.sort()
b.sort()
a_result=getCount(a)
b_result=getCount(b)
if (len(a_result['First']['Num'])>1 or
    len(b_result['First']['Num'])>1):
    #最頻値が複数ある場合は素直に計算可
    xa=len(a)-a_result['First']['Cnt']
    xb=len(b)-b_result['First']['Cnt']
    x=xa+xb
else:
    #abどちらも最頻値が1種類の場合
    if a_result['First']['Num'][0]!=b_result['First']['Num'][0]:
        #abの最頻値が異なる場合は素直に計算可
        xa=len(a)-a_result['First']['Cnt']
        xb=len(b)-b_result['First']['Cnt']
        x=xa+xb
    else:
        #abの最頻値が同じ値の場合、どちらかは2番目の値を採用する必要あり
        xaa=len(a)-a_result['First']['Cnt']
        xab=len(b)-b_result['Second']['Cnt']
        xa=xaa+xab
        xba=len(a)-a_result['Second']['Cnt']
        xbb=len(b)-b_result['First']['Cnt']
        xb=xba+xbb
        x=xa if xa<xb else xb

print(x)

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
l = [int(x) for x in list(str(n))]
print(l.replace("1","9").replace("9","1"))

Submission status: Runtime Error

Solution code:
n=input()
l = [int(x) for x in list(str(n))]
print(l.replace("1","9").replace("9","1"))

Submission status: Runtime Error

Solution code:
N=int(input())

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

print(int(A))

Submission status: Runtime Error

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

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:
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:
a=list(input())
for i in RANGE(3):
  if a[i]=='1':
    a[i]='9'
  elif a[i]=='9':
    a[i]='1'
print(a[0]+a[1]+a[2])

Submission status: Runtime Error

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

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:
import numpy as np
N = int(input())
A = np.fromstring(input(), dtype=int, sep=' ')

A = sorted(A)
x = sum(A[:N])
y = sum(A[N:])


if x == y:
    print(-1)
else:
    print(" ".join(map(str, A)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print 1110 - input

Submission status: Runtime Error

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


print("".join(s))

Submission status: Runtime Error

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

print(m)

Submission status: Runtime Error

Solution code:
n = (int(i) for i in input().split())
n = [1:9,9:1]
print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        String n=scn.next();
        for(int i=0;i<n.length();i++){
            if(n.charAt(i)=='9'){
                System.out.print('1');
            }else{
                System.out.print('9');
            }
        }
        System.out.println();
    }
}

Submission status: Runtime Error

Solution code:
import collections
n = int(input())
v = list(map(int,input().split()))
num1 = []
num2 = []
num2_sam = []
counts =[0,0]

for i in range(len(v)):
    if i % 2 == 0:
        num1.append(v[i])
    else:
        num2.append(v[i])
        num2_sam.append(v[i])

n1 = collections.Counter(num1).most_common()[0][0]
for i in range(num2_sam.count(n1)):
    num2_sam.remove(n1)

if len(num2_sam) == 0:
    n2 = len(num1)
else:
    n2 = collections.Counter(num2_sam).most_common()[0][0]

for i in range(len(num2)):
    if n1 != num1[i]:
        counts[0] += 1

    if n2 != num2[i]:
        counts[1] += 1

if (n1 == n2) and sum(num2) == sum(num1):
    print(len(num1))
else:
    print(sum(counts))

Submission status: Runtime Error

Solution code:
import collections
n = int(input())
v = list(map(int,input().split()))
num1 = []
num2 = []
counts =[0,0]
for i in range(len(v)):
    if i % 2 == 0:
        num1.append(v[i])
    else:
        num2.append(v[i])

n1 = collections.Counter(num1).most_common()[0][0]
n2 = collections.Counter(num2).most_common()[0][0]

for i in range(len(num2)):
    if n1 != num1[i]:
        counts[0] += 1

    if n2 != num2[i]:
        counts[1] += 1

if (n1 == n2) and counts[0] == counts[1]:
    print(len(num1))
else:
    print(sum(counts))

Submission status: Runtime Error

Solution code:
import collections
n = int(input())
v = list(map(int,input().split()))
num1 = []
num2 = []
counts =[0,0]
for i in range(len(v)):
    if i % 2 == 0:
        num1.append(v[i])
    else:
        num2.append(v[i])

n1 = collections.Counter(num1).most_common()[0][0]
n2 = collections.Counter(num2).most_common()[0][0]

for i in range(len(num2)):
    if n1 != num1[i]:
        counts[0] += 1

    if n2 != num2[i]:
        counts[1] += 1

if (n1 == n2) or sum(num2) == sum(num1):
    print(len(num1))
else:
    print(sum(counts))

Submission status: Runtime Error

Solution code:
N = str(input())

print(N.replace('1', '9').replace('9', '1')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=str(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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()
v=input().split()
#vin=[int(i) for i in v]
nlis=list(n)
nint=int(n)
part_num=int((nint/2))
ev_num=[]
for i in range(part_num):
    ev = 2*i
    ev_num.extend(v[ev])
count_ev=[]
for i in range(part_num):
    count=0
    count_ev.append(ev_num.count(ev_num[i]))
    
ans_ev=min(count_ev)

od_num=[]
for i in range(part_num):
    od = (2*i) + 1
    od_num.extend(v[od])
count_od=[]
for i in range(part_num):
    count=0
    count_od.append(od_num.count(od_num[i]))
ans_od=min(count_od)

if v.count(v[0]) == len(v):
    ans=part_num
else:
    ans=ans_ev+ans_od
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
K = 0
for i in range(3):
  l = k//(10**i)
  if(l == 1):
    K+=9*(10**i)
  else:
    K+=1*(10**i)
print(K)

Submission status: Runtime Error

Solution code:
n = int(input)
K = 0
for i in range(3):
  l = k//(10**i)
  if(l == 1):
    K+=9*(10**i)
  else:
    K+=1*(10**i)
print(K)

Submission status: Runtime Error

Solution code:
import collections
N = int(input())
V = input().split(' ')

EVEN = V[0::2]
ODD = V[1::2]
EVEN_V = collections.Counter(EVEN)
ODD_V = collections.Counter(ODD)
if N == 2:
  print(0)
A = len(EVEN_V)
B = len(ODD_V)


if EVEN_V.most_common()[0][1] >= ODD_V.most_common()[0][1]:
  MAX_ELE = EVEN_V.most_common()[0][0]
  count_max =EVEN_V.most_common()[0][1]
  for i in range(B):
    if MAX_ELE != ODD_V.most_common()[i][0]:
      SECOND_ELE = ODD_V.most_common()[i][0]
      count_SEC = ODD_V.most_common()[i][1]
      break
    else:
      count_SEC = N/2
  
else:
  MAX_ELE = ODD_V.most_common()[0][0]
  count_max = ODD_V.most_common()[0][1]
  for i in range(A):
    if MAX_ELE != EVEN_V.most_common()[i][0]:
      SECOND_ELE =EVEN_V.most_common()[i][0]
      count_SEC = EVEN_V.most_common()[i][1]
      break
    else:
      count_SEC = N/2
print((N- int(count_max) - int(count_SEC)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
S = int(S)
for i in range(len(S)):
  if S[i] == 9:
    S[i] = 1
  elif S[i] == 1:
    S[i] = 9
S = str(S)
print(S)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
inp = [[int(x) for x in input().split()] for _ in range(int(input()))]
inpsum = sum(map(lambda ij: abs(ij[0]+ij[1]) % 2, inp))
if not (inpsum == len(inp) or inpsum == 0):
    print(-1)
    exit(0)

seeds = ([] if inpsum == len(inp) else [1]) + [1 << i for i in range(0, 32)]
# print(inp)

print(' '.join(map(str, reversed(seeds))))

for x, y in inp:
    for k in reversed(seeds):
        res = ''
        if abs(x) > abs(y):
            if x > 0:
                res = 'R'
                x -= k
            else:
                res = 'L'
                x += k
        else:
            if y > 0:
                res = 'U'
                y -= k
            else:
                res = 'D'
                y += k
        # print((x,y))
        print(res, end='')
    print('')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
list(nyu = input())

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

Submission status: Runtime Error

Solution code:
list = [int(input().split(''))for i in range(3)]

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

print()

Submission status: Runtime Error

Solution code:
list = [int(input().splir\t(''))for i in range(3)]

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

print()

Submission status: Runtime Error

Solution code:
list = [int(input(''))for i in range(3)]

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

print()

Submission status: Runtime Error

Solution code:
list = [int(input())for i in range(3)]

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

print()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

array1 = v[::2]
array2 = v[1::2]

dict1 = {}
dict2 = {}
for i in array1:
  if i not in dict1:
    dict1[i] = 1
  else:
    dict1[i] = dict1[i] + 1

for i in array2:
  if i not in dict2:
    dict2[i] = 1
  else:
    dict2[i] = dict2[i] + 1

sort_array1 = []
sort_array2 = []
for k, v in sorted(dict1.items(), key=lambda x: -x[1]):
    sort_array1.append({k:v})
for k, v in sorted(dict2.items(), key=lambda x: -x[1]):
    sort_array2.append({k:v})

one_num1 = 0
one_num2 = 0

for k1,v1 in sort_array1[0].items():
  if len(sort_array1) != 1:
    one_num1 = len(array1) - v1
  for k2,v2 in sort_array2[0].items():
    if len(sort_array2) != 1:
      one_num2 = len(array2) - v2
    if k1 != k2:
      print(one_num1 + one_num2)
      break

    if len(sort_array1) == 1 and len(sort_array2) == 1:
      print(1)
      break
    if len(sort_array1) == 1:
      for k,v in sort_array2[1].items():
        two_num2 = v
      print(1+two_num2)
      break
    if len(sort_array2) == 1:
      for k,v in sort_array1[1].items():
        two_num1 = v
      print(1+two_num1)
      break

    for k,v in sort_array1[1].items():
      two_num1 = len(array1) - v
    for k,v in sort_array2[1].items():
      two_num2 = len(array2) - v
    if two_num1 <= two_num2:
      print (one_num2 + two_num1)
    else:
      print (one_num1 + two_num2)

Submission status: Runtime Error

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

res = ''
for i in a:
  res += str(10 - i)
--
print(res)

Submission status: Runtime Error

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

res = ''
for i in a:
  res += str(10 - a)
  
print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())

res = ''
for i in a:
  res += str(10-a)
  
print(res)

Submission status: Runtime Error

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

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:
a=str(input())
b=int(a[0])
c=int(a[1])
d=int(a[2])
if b==1:
  b="9"
elif b==9:
  b="1"
if c==1:
  c="9"
elif c==9:
  c="1"
if d==1:
  d="9"
elif d==9:
  d=="1"
e=int(b+c+d)
print(e)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,list(input(),split()))
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
print({}{}{}.format(a,b,c))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
inp = input()

corrected = ""
for l in inp:
  if l == "1":
    corrected += "9"
  elif l == 9:
    corrected += "1"
  else:
    print("error")

print(int(corrected))

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

Solution code:
n = list(input())
count = 0

for i in n:
    if i == "1":
        n[count] = "9"
    elif i == "9":
        n[count] = "1"
    count += 1

print("".job(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=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 = [int(s) for s in input().split()]
len = len(n)
i = 0
while i < len:
  if n[i] = 1:
    n[i] = 9
  elif n[i] = 9:
    n[i] = 1
  else:
    None
  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'
    else:
        n[i] = '1'

print(n)

Submission status: Runtime Error

Solution code:
n=int(input())
v=list(map(int, input().split()))
import collections
v1=v[0::2]
v11=collections.Counter(v1)
v2=v[1::2]
v22=collections.Counter(v2)
ans=0
o=v11.most_common()[0][0]
e=v22.most_common()[0][0]
if e!=o:
    for x in v1:
        if x!=o:
            ans+=1
    for y in v2:
        if y!=e:
            ans+=1
else:
    if v1.count(o)>v2.count(e):
        for x in v1:
            if x!=o:
                ans+=1
        for y in v2:
            if y!=v22.most_common()[1][0]:
                ans+=1
    else:
        for x in v1:
            if x!=v11.most_common()[1][0]:
                ans+=1
        for y in v2:
            if y!=v2:
                ans+=1
print(ans)

Submission status: Runtime Error

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

n = ls(input())
nans =[]
for i in range (3):
  if n[i] == "1":
    nans.append("9")
    else:
      nans.append("1")
print("".join(nans))

Submission status: Runtime Error

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

n = ls[input()]
nans =[]
for i in range (3):
  if n[i] == "1":
    nans.append("9")
    else:
      nans.append("1")
print("".join(nans))

Submission status: Runtime Error

Solution code:
import collections
def los(x, y):
    if x < y:
        return -1
    elif x > y:
        return 1
    elif x == y:
        return 0
def fun1(list, i):
    if i%2 == 0 and i < n:
        e.append(list[i])
        fun1(list, i+1)
    elif i%2 == 1 and i < n:
        o.append(list[i])
        fun1(list, i+1)

n = int(input())
list = list(map(lambda x:int(x), input().split(' ')))
e = []
o = []
fun1(list, 0)

ec = collections.Counter(e)
oc = collections.Counter(o)

ec0, ec0n= ec.most_common()[0]
oc0, oc0n= oc.most_common()[0]
try:
    ec1, ec1n= ec.most_common()[1]
except:
    ec1, ec1n= None, None
try:
    oc1, oc1n= oc.most_common()[1]
except:
    oc1, oc1n= None, None


if ec0 == oc0:
    if ec1==None and oc1==None:
        not_change= ec0n
    elif ec1==None:
        d= los(ec0n + oc1n, oc0n)
        if d==0 or d==1:
            not_change= ec0n + oc1n
        elif d==-1:
            not_change= oc0n
    elif oc1==None:
        d= los(oc0n + ec1n, ec0n)
        if d==0 or d==1:
            not_change= oc0n + ec1n
        elif d==-1:
            not_change= ec0n
    else:
        d= los(ec0n+oc1n, ec1n+oc0n)
        if d==0 or d==1:
            not_change= ec0n+oc1n
        elif d==-1:
            not_change= ec1n+oc0n
elif ec0 != oc0:
    not_change= ec0n + oc0n

print(n-not_change)

Submission status: Runtime Error

Solution code:
n = list(input())
for num in n:
    if num ==1:
        num=9
    elif num==1:
        num=9:
print(n)