TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
n = int(input())
vlist = list(map(int, input().split(" ")))

head = vlist[::2]
foll = vlist[1::2]

import collections
ch = collections.Counter(head).most_common()
cf = collections.Counter(foll).most_common()

h_ = ch[0]
f_ = cf[0]

if h_[0] == f_[0]:
    #if h_[1] == f_[1]:
    #    if h_[0] == vlist[0]:
    #        f_ = (-1.1, 0)
    #    else:
    #        h_ = (-1.1, 0)
    if h_[1] > f_[1]:
        if len(cf) != 1:
            f_ = cf[1]
        else:
            f_ = (-1.1, 0)
    else:
        if len(ch) != 1:
            h_ = ch[1]
        else:
            h_ = (-1.1, 0)

count = 0
for i in range(len(vlist)):
    if i % 2 == 0 and vlist[i] != h_[0]:
        count += 1
    if i % 2 == 1 and vlist[i] != f_[0]:
        count += 1

print(count)

import collections

n = int(input())
vlist = list(map(int, input().split(" ")))

import collections
c = collections.Counter(vlist)

head = c.most_common()[0][0]
if c.most_common()[0][1] == n:
    foll = -1
else:
    foll = c.most_common()[1][0]


for i in range(len(vlist)):
    if vlist[i] == head:
        break
    if vlist[i] == foll:
        head, foll == foll, head
        break

count = 0
for i in range(len(vlist)):
    if i % 2 == 0 and vlist[i] != head:
        count += 1
    if i % 2 == 1 and vlist[i] != foll:
        count += 1

print(count)

n = int(input())
vlist = list(map(int, input().split(" ")))

head = vlist[::2]
foll = vlist[1::2]

import collections
ch = collections.Counter(head).most_common()
cf = collections.Counter(foll).most_common()

h_ = ch[0]
f_ = cf[0]

if h_[0] == f_[0]:
    if h_[1] > f_[1]:
        if len(cf) != 1:
            f_ = cf[1]
        else:
            f_ = (-1.1, 0)
    else:
        if len(ch) != 1:
            h_ = ch[1]
        else:
            h_ = (-1.1, 0)
elif h_[1] == f_[1]:
    if h_[0] == vlist[0]:
        f_ = (-1.1, 0)
    else:
        h_ = (-1.1, 0)

count = 0
for i in range(len(vlist)):
    if i % 2 == 0 and vlist[i] != h_[0]:
        count += 1
    if i % 2 == 1 and vlist[i] != f_[0]:
        count += 1

print(count)

intput_ = list(input())
output = ""
for s_ in intput_:
  if s_ == '1':
    output += "9"
  elif s_ == '9':
    output += "1"
  else:
    output += s_

print(output)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

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)

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = str(input())
m = ""
for i in range(2):
  if n[i] == "9":
    m += "1"
  elif n[i] == "1":
    m += "9"
  else:
    m += n[i] 
print(int(m))

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s=input()
for i in range(3):
  if s[i]==1:s[i]=9
  elif s[i]==9:s[i]=1
print(s)

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = input()
print(n.replace('9', '1').replace('1', '9'))

s = input()

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = input()
for i in range(len(n)):
  if n[i] == '1':
    n[i] = '9'
  elif n[i] == '9':
    n[i] = '1'
print(n)


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


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

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
NA = int(input())
NX = NA.split(" ")
NW = []
for i in range (1,N+1):
    Ni = int(NX.count(i))
    NW.append(Ni)
NN = NW.sort()
print(NW)
S = 0
for x in range (0,N-2):
    S = S + NW[x]
print(S)

X = input()
Xn = X.replace("1","N")
Xo = Xn.replace("9","1")
print(Xo.replace("N","9"))


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s=input()
for i in range(len(s)):
  if s[i]=="1":
    s[i]="9"
  elif s[i]=="9":
    s[i]="1"

print(s)

s=input()
t=s.replace("9","2")
u=t.replace("1","3")
v=u.replace("2","1")
w=v.replace("3","9")

print(w)

Verdicts: Runtime Error

Accepted
Problem: 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.

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
l1=[1,2,3,4,5,6,7,8,9]
x=111
for i in l1:
    if(i*x>=n):
        print(i*x)
        break

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
cha = list(s)
answer = []
for hoge in int_cha:
  if hoge == '1':
    answer.append('9')
  else:
    answer.append('1')
print(''.join(answer))

s = input()
cha = list()
answer = []
for hoge in int_cha:
  if hoge == '1':
    answer.append('9')
  else:
    answer.append('1')
print(''.join(answer))


s = input()
cha = list(s)
answer = []
for hoge in cha:
  if hoge == '1':
    answer.append('9')
  else:
    answer.append('1')
print(''.join(answer))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = input()

n.replace('1', 'w')
n.replace('9', '1')
n.replace('w', '9')

print(n)

S = list(input())

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

print(''.join(S))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
for i in range(100,1000):
    if i >= n and i%100//10 == i%10 == i//100:
        print(i)
        break

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = input()
n.replace('1', 'x')
n.replace('9', '1')
n.replace('x', '9')
print(int(n))

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

n = str(input())
n = n.replace("1", "x")
n = n.replace('9', '1')
n = n.replace('x', '9')
print(int(n))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
alist  = list(map(int,input().split()))
list1 = alist[1::2]
list2 = alist[0::2]
from collections import Counter
dic1 = Counter(list1).most_common()
dic2 = Counter(list2).most_common()

if dic1[0][0]!=dic2[0][0]:
  print(n - dic1[0][1] - dic2[0][1]+1)
else:
  print(min(n - dic1[0][1] - dic2[1][1]+1, n -dic1[1][1] - dic2[0][1]+1))

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=input()
n=int(n)
print(111*(int(n/111)+1))

n=input()
n=int(n)
nf= n%10
ns =  (n-nf)%100
nt = n-nf-ns

if nf==1 :
    nf=9
elif nf==9:
    nf=1


if ns==10 :
    ns=90
elif ns==90:
    ns=10


if nt==100:
    nt=900
elif nt==900:
    nt=100
    
n=nf+ns+nt


print(n)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
numberL = list(map(int, input().split()))
 
kisuuSyuL=[]
kisuuKosuL=[]
kisuuKosuL2=[]
gusuSyuL=[]
gusuKosuL=[]
gusuKosuL2=[]
 
index=0
while index<n:
    if index==0:
        gusuSyuL.append(numberL[index])
        gusuKosuL.append(1)
        gusuKosuL2.append(1)
    elif index==1:
        kisuuSyuL.append(numberL[index])
        kisuuKosuL.append(1)
        kisuuKosuL2.append(1)
    else:
        if index%2==0:
            if numberL[index] in gusuSyuL:
                tarI = gusuSyuL.index(numberL[index])
                gusuKosuL[tarI]+=1
                gusuKosuL2[tarI]+=1
            else:
                gusuSyuL.append(numberL[index])
                gusuKosuL.append(1)
                gusuKosuL2.append(1)
        else:
            if numberL[index] in kisuuSyuL:
                tarI = kisuuSyuL.index(numberL[index])
                kisuuKosuL[tarI]+=1
                kisuuKosuL2[tarI]+=1
            else:
                kisuuSyuL.append(numberL[index])
                kisuuKosuL.append(1)
                kisuuKosuL2.append(1)
    index+=1

 
if len(kisuuSyuL)==1 and len(gusuSyuL)==1:
    if kisuuSyuL[0]==gusuSyuL[0]:
        print(int(n/2))
    else:
        print(0)
else:
    kiIndex = kisuuKosuL.index(max(kisuuKosuL))
    guIndex = gusuKosuL.index(max(gusuKosuL))
    if kisuuSyuL[kiIndex]!=gusuSyuL[guIndex]:
        noC=max(kisuuKosuL)+max(gusuKosuL)
        print(n-noC)
    else:
        if max(kisuuKosuL) < max(gusuKosuL):
            kisuuKosuL.sort()
            noC=kisuuKosuL[len(kisuuKosuL)-1]+max(gusuKosuL)
            print(n-noC)
        else:
            gusuKosuL.sort()
            noC=gusuKosuL[len(gusuKosuL)-1]+max(kisuuKosuL)
            print(n-noC)

listN = list(str(input()))

index=0
while index < 3:
    if listN[index] == "1":
        listN[index]="9"
    elif listN[index]=="9":
        listN[index]="1"
    index+=1

print(listN[0]+listN[1]+listN[2])

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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()
    n=input()
l=['1','9']
for i in n:
    print(l[l.index(i)-1], end = '')
print()
    

#!/usr/bin/env python3
n=input()
l=['1','9']
for i in n:
    print(l[l.index(i)-1], end = '')
print()
    

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a=list(input())
for i in range(len(a)):
  if a[i]=="1":
    a[i]="9"
  else:
    a[i]="1"
print(*a)

a=list(input())
for i in range(len(a)):
  if a[i]=="1":
    a[i]="9"
  else:
    a[i]="1"
print(*a,sep="")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=list(input())
s=''
for i in n: s=s+'1' if i=='9' else '9'
print(s)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())

n_letters = str(n)

for i in n_letters:
    if n_letters[i] == "1":
        n_letters[i] = "9"
    elif n_letters[i] == "9":
        n_letters[i] = "1"


n = int(input())

n_letters = str(n)

for i in range(len(n_letters)):
    if n_letters[i] == "1":
        n_letters[i].replace("1","9")
    elif n_letters[i] == "9":
        n_letters[i].replace("9","1")
    print(n_letters[i])

print(int(n_letters))


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

print(''.join(ans))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

import numpy as np

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S=input().replace('1','x').replace('9','1').replace('x',9)
print(S)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
print(''.join(map(lambda x:{'1':'9','9':'1'}[x],input().split())))

print(''.join(map(lambda x:{'1':'9','9':'1'}[x],input())))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
"".join(list(map(lambda x: "9" if x=="1" else "1", input())))

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = input()

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

n = input()

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = input().split()
ans = n.replace("1", "a")
ans = n.replace("9", "1")
ans = n.replace("a", "9")
print(int(ans))

n = int(input())
print(1110-n)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
print(input().replace("1", "9").replace("9", "1"))


N = input()
print(N.replace("1", "x").replace("9", "1").replace("x", "9"))                                                                                                                             


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=input()
print(a.replace("1", "9"))

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

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

a=input()
print(a.replace("1", "9", 3))

a=int(input())
print(1110-a)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a = list(input())
print(a)
for i, n in enumerate(a):
    if n == "1":
        a[i] = 9
    else:
        a[i] = 1
l = a[0] *100 + a[1] * 10 + a[2]  
print(int(l))

a = list(input())
for i, n in enumerate(a):
    if n == "1":
        a[i] = 9
    else:
        a[i] = 1
l = a[0] *100 + a[1] * 10 + a[2]  
print(int(l))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = str(input())

for i in range(len(n)):
  if n[i] == '1':
    n.replace('1', '9')
  else:
    n.replace('9', '1')
print(n)

n = input()

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



n = str(input())

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

n = str(input())
nn = []
for i in n:
  if i == '1':
    nn.append('9')
  else:
    nn.append('1')
print(''.join(nn))

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())

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

print(int(A))

N=str(input())

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

print(int(A))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
for i in range(9):
    if(N>L[i] and N<=L[i+1]):
        print(L[i+1])
        break
    elif(N==L[i]):
        print(L[i])
        break
    elif(N<111):
        print(111)
        break
    else:
        continue


N=input()

str_output=""

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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

n=list(str(input()))

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

print(N)  

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
num = input()
lis = ""

for i in num:
    if i == "1":
        lis+="9"
    else:
        lis+="1"

print(int(num))

num = input()
lis = ""

for i in num:
    if i == "1":
        lis+="9"
    else:
        lis+="1"

print(int(lis))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=list(input())
for i in range(3):
  if int(a[i])==1:
    a[i]='9'
  elif int(a[i])==9:
    a[i]=='1'
print(''.join(a))

a=list(input())
for i in range(3):
  if int(a[i])==1:
    a[i]='9'
  elif int(a[i])==9:
    a[i]='1'
print(''.join(a))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = input()
s = ''
for i in n:
    if i == 1:
        s += '9'
    else:
        s += '1'
print(s)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = input()
for i in range(len(n)):
  if n[i] == "1":
    n[i] == "9"
  else:
    n[i] == "1"
print(n)

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


n = input()
n = n.replace("1",  "@")
n = n.replace("9", "1")
n = n.replace("@", "9")

print(n)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = input()
if N[0] == 1:  N[0] == 9
elif N[0] == 9:  N[0] == 1
elif N[1] == 1:  N[1] == 9
elif N[1] == 9:  N[1] == 1
elif N[2] == 1:  N[2] == 9
elif N[2] == 9:  N[2] == 1
print(N)  

N = int(input())
print(1110-N)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
print(input().translate(str.maketrans({"1":9,"9":1})))

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

print(1110-int(input()))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
lst = str(input()).split(' ')

p1 = lst[0]
p2 = lst[1]
new_lst = []
for idx in range(n):
	if idx%2 == 0:
  		new_lst.append(p1)
	else:
		new_lst.append(p2)

cnt = 0
for o, l in zip(lst, new_lst):
	if not o == l:
		cnt +=1
if p1 == p2:
  print(int(n/2))
else:
  print(cnt)

n = str(input())
one_idx = []
nine_idx = []
print(n)
for idx in range(len(n)):
	if n[idx]=='1':
		one_idx.append(idx)
	if n[idx]=='9':
		nine_idx.append(idx)

out = ''
for idx in range(len(n)):
	if idx in one_idx:
		out += '9'
	if idx in nine_idx:
		out += '1'
          
print(out)

n = str(input())

if int(n[0]) > int(n[1]):
	out = n[0]*3
elif n[0] == n[1]:
  if int(n[1]) >= int(n[2]):
    out = n[0]*3
  else:
    out = str(int(n[0])+1)*3
else:
  out = str(int(n[0])+1)*3
    
print(out)

n = str(input())

if int(n[0]) > int(n[1]):
	out = n[0]*3
elif n[0] == n[1]:
  if int(n[1]) >= int(n[2]):
    out = n[0]*3
  else:
    out = str(int(n[0])+1)*3
else:
  out = str(int(n[0])+1)*3
    
print(out)

n = int(input())
lst = str(input()).split(' ')

p1 = [0]*(max([int(i) for i in lst])+1)
p2 = [0]*(max([int(i) for i in lst])+1)
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1) >= max(p2):
		pp1 = p1.index(max(p1))
		pp2 = p2.index(sorted(p2)[-2])
	elif max(p2) > max(p1):
		pp1 = p1.index(sorted(p1)[-2])
		pp2 = p2.index(max(p2))

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

n = str(input())

if int(n[0]) < int(n[1]):
	out = str(int(n[0])+1)*3
elif n[0] == n[1]:
  if int(n[1]) >= int(n[2]):
    out = n[0]*3
  else:
    out = str(int(n[0])+1)*3
else:
  out = str(int(n[0])+1)*3
    
print(out)

n = str(input())
one_idx = []
nine_idx = []
for idx in range(n):
	if n[idx]=='1':
		one_idx.append(idx)
    if n[idx]=='9':
		nine_idx.append(idx)

for idx in range(n):
	if idx in one_idx:
		n[idx] = '9'
    if idx in nine_idx:
		n[idx] = '1'
          
print(n)


n = str(input())
one_idx = []
nine_idx = []
for idx in range(len(n)):
	if n[idx]=='1':
		one_idx.append(idx)
	if n[idx]=='9':
		nine_idx.append(idx)

out = ''
for idx in range(len(n)):
	if idx in one_idx:
		out += '9'
	if idx in nine_idx:
		out += '1'
          
print(out)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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()


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


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


list(nyu = input())

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


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


nyu = input()
list(nyu)

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a={"1":"9","9":"1"}
t=input()
n=""
for i is range(3):
  n+=a[t[i]]
print(n)

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

print(m)

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

print(m)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
print(1110 - int(input())

print(1110 - int(input()))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = str(input())
s = ''
for i in range(2):
  if n[i] == '1':
    s += '9'
  elif n[i] == '9':
    s += '1'
  else:
    s += n[i]
print(s)


n = str(input())
for i in range(2):
  if n[i] == '1':
    n[i] = '9'
  elif n[i] == '9':
    n[i] = '1'
print(n)

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
	print(1110-N)

N=int(input())
print(1110-N)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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))

N = input()

ans =''

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

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())

S = (((N-1)//111))*111

print(S)


n = int(input())
v = list(map(int,input().split()))
a = [v[i] for i in range(n) if i%2==0]
b = [v[i] for i in range(n) if i%2==1]

x = 0
y = 0
p=0
q=0

for i in range(10**5):
    if x<a.count(i):
        p=i
        x=a.count(i)
    if y<b.count(i):
        q=i
        y=b.count(i)

print(n-x-y)

N = int(input())

S = (((N-1)//111)+1)*111

print(S)


n = int(input())

m = 1110 - n

print m

N = int(input())

S = ((N//111)+1)*111

print(S)

n = int(input())

m = 1110 - n

print(m
)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = list(input())
for i in N:
  if i is '1':
    i = '9'
  else:
    i = '1'
print(N[0] + N[1] + N[2])

N = list(input())
for i in range(len(N)):
  if N[i] is '1':
    N[i] = '9'
  else:
    N[i] = '1'
print(N[0] + N[1] + N[2])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
print(input().replace("1","9").replace("9","1"))

print(input().replace("1","8").replace("9","1").replace("8","9"))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n =input()

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

n =input()

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
l = ""
for i in range(3):
  if s[0] == "1":
    l += "9"
  else:
    l += "1"
    
print(l)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())

print(1000-n)

n = int(input())

print(1110-n)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a = int(input())

b = list(map(int,input().split()))
d = max(b)
c = [0 for i in range(pow(10,6)+1)]
cc = [0 for i in range(pow(10,6)+1)]
for i in range(len(b)):
    if i % 2 == 0:
        cc[b[i]-1] += 1
    else:
        c[b[i]-1] += 1

one = 0
onee = 0
two = 0
twoo = 0
k = 0
kk = 0
for i in range(len(c)):
    if one <= c[i]:
        onee = one
        one = c[i]
        k = i
    if two <= cc[i]:
        twoo = two
        two = cc[i]
        kk = i

t = max(one+twoo,onee+two)

if k != kk:
    print(a-one-two)
else:
    print(a-t)


a = int(input())

b = list(map(int,input().split()))
d = max(b)
c = [0 for i in range(pow(10,5)+100)]
cc = [0 for i in range(pow(10,5)+100)]
for i in range(a):
    if i % 2 == 0:
        c[b[i]] += 1
    else:
        cc[b[i]] += 1

one = 0
onee = 0
two = 0
twoo = 0
k = 0
kk = 0
for i in range(len(c)):
    if one <= c[i]:
        onee = one
        one = c[i]
        k = i
    if two <= cc[i]:
        twoo = two
        two = cc[i]
        kk = i

t = max(one+twoo,onee+two)

print(a-one-two)



a = list(input())
for i in range(3):
	a[i] = int(a[i])
	if a[i] ==1:
		a[i] = 9
	else:
		a[i] = 1
print(a[0]*100+a[1]*10+a[2])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N=input()
for x in N:
  if x=="1":
    x="9"
  elif x=="9":
    x="1"
print(N)

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

N=list(input())
for x in range(len(N)):
  if N[x]=="1":
    N[x]="9"
  else:
    N[x]="1"
print("".join(N))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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()


i = input()

k = []

for j in i:
    if j == '1':
        k.append('9')
    else:
        k.append('1')

print(''.join(k))


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a = input()
for i in a:
    print(i == "1" and "9" or "1" end="")


print(1110 - int(input()))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = str(input())
for i in n:
    if i == 9:
        n[i] = 1
    else:
        n[i] = 9
print(int(n))


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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A = input()
for a in A:
  if a == 1:
    print("9", end="")
  else:
    print("1", end="")
print("")

A = input()
for a in A:
  if a is "1":
    print("9", end="")
  else:
    print("1", end="")
print("")


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()

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

s = input()

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
from collections import Counter

n = int(input())
v = list(map(int, input().split()))
for_set_v = v 
set_v = set(v)
even = []
odd = []
count = 0 
count_list = []
for num in range(n):
    if num % 2 == 0:
        even.append(v[num])
    else:
        odd.append(v[num])

even_most = Counter(even).most_common()
odd_most = Counter(odd).most_common()
#print(even_most)
#print(odd_most)
if len(set(v)) >= 2:
    if even_most[0][0] != odd_most[0][0]:
        if len(set(even)) != 1:
            count += (n/2) - int(even_most[0][1])
        if len(set(odd)) != 1:
            count += (n/2) - int(odd_most[0][1])
    else:
        try:
            count_list.append(n-int(even_most[0][1])-int(odd_most[1][1]))
            count_list.append(n-int(even_most[1][1])-int(odd_most[0][1]))
            #print(count_list)
            count += int(min(count_list))
        except:
            if len(even_most) == 1:
                count += (n/2)-int(odd_most[1][1])
            elif len(odd_most) == 1:
                count += (n/2)-int(even_most[1][1])
else:
    count += (n/2)
print(int(count))


n = list(input())
result = ''
for num in n:
    if num == '1':
        result += '9'
    elif num == '9':
        result += '1'
print(int(result))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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())

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
a = 1100-n
print(a)

n = int(input())
a = 1110-n
print(a)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
inp = int(input())
ret = 0
for i in range(1, 9):
    ret = i*111
    if ret >= inp:
        break
print(ret)

inp = input()
ret = ""
for i in range(3):
    if inp[i] == '1':
        ret += "9"
    if inp[i] == '9':
        ret += "1"
print(ret)

Verdicts: Wrong Answer

Accepted