Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-

class HashTable(dict):
    def __init__(self, length):
        dict.__init__(self)
        self.length = length
        #self[:] = [None] * length

    def h1(self, key):
        return key % self.length

    def h2(self, key):
        return 1 + (key % (self.length - 1))

    def h(self, key, i):
        return (self.h1(key) + i*self.h2(key)) % self.length

    def insert(self, key):
        i = 0
        while True:
            j = self.h(key, i)
            if self[j] is None:
                self[j] = key
                return j
            else:
                i += 1
    
    def search(self, key):
        i = 0
        while True:
            j = self.h(key, i)
            if self[j] == key:
                return j
            elif self[j] is None or i >= self.length:
                return None
            else:
                i += 1

def getNum(char):
    char2num = str.maketrans("ACGT", "1234")
    return int(char.translate(char2num))

if __name__ == '__main__':

    n = int(input())
    T = HashTable(n)
    C = [input().split(" ") for i in range(n)]
    C = map(lambda x:(x[0], getNum(x[1])), C)
    
    for command, num in C:
        if command == "insert":
            T.insert(num)
        else:
            if T.search(num) is None:
                print("no")
            else:
                print("yes")



### FIXED CODE ###

# -*- coding: utf-8 -*-

class HashTable(list):
    def __init__(self, length):
        list.__init__(self)
        self.length = length
        self[:] = [None] * length

    def h(self, key, i):
        h1 = key % self.length
        h2 = 1 + (key % (self.length - 1))
        return (h1 + i*h2) % self.length

    def insert(self, key):
        i = 0
        while True:
            h1 = key % self.length
            h2 = 1 + (key % (self.length - 1))
            j = (h1 + i*h2) % self.length
            #j = self.h(key, i)
            if self[j] is None:
                self[j] = key
                return j
            else:
                i += 1
    
    def search(self, key):
        i = 0
        while True:
            h1 = key % self.length
            h2 = 1 + (key % (self.length - 1))
            j = (h1 + i*h2) % self.length
            #j = self.h(key, i)
            if self[j] == key:
                return j
            elif self[j] is None or i >= self.length:
                return None
            else:
                i += 1

def getNum(char):
    char2num = str.maketrans("ACGT", "1234")
    return int(char.translate(char2num), 5)

if __name__ == '__main__':

    n = int(input())
    T = HashTable(1046527)
    C = [input().split(" ") for i in range(n)]
    
    for command, char in C:
        num = getNum(char)
        if command[0] == "i":
            T.insert(num)
        else:
            if T.search(num) is None:
                print("no")
            else:
                print("yes")
N = int(input())
src = [int(input()) for i in range(N)]
idx = {a:i for i,a in enumerate(src)}

size = [1] * N
ss = list(sorted(src))

es = []
gr = [[] for i in range(N)]
while len(ss) > 1:
    a = ss.pop()
    k = size[idx[a]]
    b = a + 2*k - N
    if b == a or b not in idx:
        print(-1)
        exit()
    size[idx[b]] += k
    ai,bi = idx[a],idx[b]
    es.append((ai,bi))
    gr[a].append(b)
    gr[b].append(a)

from collections import deque
dist = [N] * N
dist[idx[ss[0]]] = 0
q = deque([idx[ss[0]]])
while q:
    v = q.popleft()
    for to in gr[v]:
        if dist[to] < N: continue
        q.append(to)
        dist[to] = dist[v] + 1

if all(d<N for d in dist) and sum(dist) == ss[0]:
    for a,b in es:
        print(a+1, b+1)
else:
    print(-1)

### FIXED CODE ###

N = int(input())
src = [int(input()) for i in range(N)]
idx = {a:i for i,a in enumerate(src)}

size = [1] * N
ss = list(sorted(src))

es = []
while len(ss) > 1:
    a = ss.pop()
    k = size[idx[a]]
    b = a + 2*k - N
    if b == a or b not in idx:
        print(-1)
        exit()
    size[idx[b]] += k
    es.append((idx[a],idx[b]))

gr = [[] for i in range(N)]
for a,b in es:
    gr[a].append(b)
    gr[b].append(a)

from collections import deque
dist = [N] * N
dist[idx[ss[0]]] = 0
q = deque([idx[ss[0]]])
while q:
    v = q.popleft()
    for to in gr[v]:
        if dist[to] < N: continue
        q.append(to)
        dist[to] = dist[v] + 1

if all(d<N for d in dist) and sum(dist) == ss[0]:
    for a,b in es:
        print(a+1, b+1)
else:
    print(-1)
# -*- coding: utf-8 -*-
N=int(input())

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

ans=make_divisors(N)

temp=ans[0]+ans[1]-2

for i in range(len(ans)):
    if i%2!=0:
        continue
    if temp>ans[i]+ans[i+1]-2:
        temp=ans[i]+ans[i+1]-2
print(temp)

### FIXED CODE ###

# -*- coding: utf-8 -*-
N=int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            divisors.append(n//i)
    return divisors

ans=make_divisors(N)

temp=ans[0]+ans[1]-2

for i in range(len(ans)):
    if i%2!=0:
        continue
    if temp>ans[i]+ans[i+1]-2:
        temp=ans[i]+ans[i+1]-2
print(temp)
n=int(input())
jo=int(n[-1])
if jo==3:
    print("bon")
elif jo ==0 or 1 or 6 or 8:
    print("pon")
else:
    print("hon")

### FIXED CODE ###

n=str(input())
jo=int(n[-1])
if jo==3:
    print("bon")
elif jo==0 or jo == 1 or jo==6 or jo==8:
    print("pon")
else:
    print("hon")
n=int(input())
d=list(map(int,input().split()))
D=sorted(d)
print(D[(n//2)+1]-D[(n//2)-1])

### FIXED CODE ###

n=int(input())
d=list(map(int,input().split()))
D=sorted(d)
num=D[n//2]-D[(n//2)-1]
print(num)
import sys
sys.setrecursionlimit=10**12

def modinv(a,m=10**9+7):
    if a==0: return 1
    b=m
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return lastx % m

def cur(n):
    for x in neighbor[n]:
        if x!=par[n]:
            par[x]=n
            descend[n]+=cur(x)
    return descend[n]

def cur2(p):
    for x in neighbor[p]:
        if x==par[p]: continue
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])%mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[[]  for _ in range(n+1)]
descend=[1]*(n+1)
par=[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].append(b)
    neighbor[b].append(a)
cur(1)

ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])%mod
ans[1]=ans1
cur2(1)
for i in range(1,n+1):
    print(ans[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def modinv(a,m=10**9+7):
    if a==0: return 1
    else:
        b=m
        (x, lastx) = (0, 1)
        (y, lasty) = (1, 0)
        while b != 0:
            q = a // b
            (a, b) = (b, a % b)
            (x, lastx) = (lastx - q * x, x)
            (y, lasty) = (lasty - q * y, y)
        return lastx % m

def cur(p):
    if neighbor[p]==[]: return
    for x in neighbor[p]:
        par[x]=p
        neighbor[x].remove(p)
        cur(x)
    descend[par[p]]+=descend[p]

def cur2(p):
    for x in neighbor[p]:
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])
        ans[x]%=mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[set()  for _ in range(n+2)]
descend=[1 for i in range(n+1)]
par=[0]+[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].add(b)
    neighbor[b].add(a)

cur(1)


ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])
    ans1%=mod
ans[1]=ans1

cur2(1)

for i in range(1,n+1):
    print(ans[i])
# -*- coding: utf-8 -*-

# Input#
# n = int(input())
n, m = map(int, input().split())
# a = list(map(int, input().split()))

x = [-1]
y = [-1]
for i in range(m):
    x_in, y_in = map(int, input().split())
    x.append(x_in)
    y.append(y_in)

memo = [-1] * (n + 1)


def dp(i):
    if memo[i] == -1:
        ret = 0
        for j in range(m + 1)[1:]:
            if x[j] == i:
                tmp = dp(y[j]) + 1
                ret = max(tmp, ret)
        memo[i] = ret
        return ret
    else:
        return memo[i]


ans = -1
for i in range(n + 1)[1:]:
    tmp = dp(i)
    ans = max(tmp, ans)

print("{}".format(ans))


### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import deque

from sys import setrecursionlimit

setrecursionlimit(1000000)

INF = float("inf")
# Input#
# n = int(input())
n, m = map(int, input().split())
# a = list(map(int, input().split()))

d = deque()
d_tmp = deque()
x = [-1]
y = [[-1] for _ in range((n + 1))]

for _ in [0] * m:
    x_in, y_in = map(int, input().split())
    #    x.append(x_in)
    y[x_in].append(y_in)
    d.append((x_in, y_in))

memo = [-1] * (n + 1)
ans = -1


def dp(i):
    global ans
    if memo[i] == -1:
        ret = 0
        for x_in in y[i][1:]:
            tmp = dp(x_in) + 1
            if tmp > ret:
                ret = tmp
        memo[i] = ret
        if ret > ans:
            ans = ret
        return ret
    else:
        return memo[i]


for i, _ in d:
    if memo[i] == -1:
        dp(i)

print("{}".format(ans))
friend_dic = {}
block_dic = {}
clusters = {}

N, M, K = map(int, input().split())

for i in range(1, N+1):
    friend_dic[i] = []
    block_dic[i] = []
    clusters[i] = None

for _ in range(M):
    a, b = map(int, input().split())
    friend_dic[a].append(b)
    friend_dic[b].append(a)

for _ in range(K):
    a, b = map(int, input().split())
    block_dic[a].append(b)
    block_dic[b].append(a)

def dfs(graph, start, cluster):
    cluster.append(start)
    for neighbor in graph[start]:
        if neighbor not in cluster:
            dfs(graph, neighbor, cluster)


result = ""
for i in range(1, N+1):
    if clusters[i] is not None:
        cluster = clusters[i]
    else:
        cluster = []
        dfs(friend_dic, i, cluster)
        for v in cluster:
            clusters[v] = cluster
    result += str(len(set(cluster) - set(friend_dic[i]) - set(block_dic[i])) - 1)
print(" ".join(result))


### FIXED CODE ###

class UnionFind:
    """
    parents: 各要素の親要素
             要素がrootの場合には　-(そのグループに属する要素数) を格納
    """
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        # xが属するグループのrootを取得
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

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

        if x == y:
            return

        # 高い方の木の根に低い方の木の根を結合
        if self.parents[x] > self.parents[y]:
            x, y = y, x

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

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

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

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

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

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

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

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

      
n, m, k = map(int, input().split())

union_find = UnionFind(n)
friends_counter = {i: 0 for i in range(n)}
blocks_counter = {i: 0 for i in range(n)}

for _ in range(m):
    a, b = map(int, input().split())
    union_find.union(a-1, b-1)
    friends_counter[a-1] += 1
    friends_counter[b-1] += 1

for _ in range(k):
    c, d = map(int, input().split())
    if union_find.same(c-1, d-1):
        blocks_counter[c-1] += 1
        blocks_counter[d-1] += 1

result = []
for i in range(n):
    result.append(str(union_find.size(i) - friends_counter[i] - blocks_counter[i] - 1))

print(" ".join(result))
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

import numpy as np
from heapq import heappush, heappop

N,M,S,T = map(int,input().split())
graph = [[] for _ in range(N+1)]
for _ in range(M):
    u,v,a,b = map(int,input().split())
    graph[u].append((v,a,b))
    graph[v].append((u,a,b))

def dijkstra(start, mode):
    INF = 10 ** 15
    dist = [INF] * (N+1)
    dist[start] = 0
    q = [(0,start)]
    while q:
        d,v = heappop(q)
        if dist[v] < d:
            continue
        for w,*a in graph[v]:
            d1 = d + a[mode]
            if dist[w] > d1:
                dist[w] = d1
                heappush(q, (d1,w))
    return dist

d1 = np.array(dijkstra(S,0))
d2 = np.array(dijkstra(T,1))

d1 += d2
answer = 10 ** 15 - np.minimum.accumulate(d1[::-1])[::-1][1:]

print('\n'.join(answer.astype(str)))

### FIXED CODE ###

a,b = map(int,input().split())
answer = 'x'
if a+b == 15:
  answer = '+'
elif a*b == 15:
  answer = '*'
print(answer)
import sys

input = sys.stdin.read()
(a, b) = map(lambda x:int(x) , input.split(" "))


x = a*b
y = 2*(a+b)

print str(x) + "?\t" + str(y)

### FIXED CODE ###

import sys

lst = sys.stdin.read().split(" ")

a = int(lst[0])
b = int(lst[1])

print str(a*b) + " " + str(2*(a+b))
A, B = int(map, input().split())
if A <= B:
  if A = 1:
    print('Alice')
  else:
    print('Bob')
else:
  if B = 1:
    print('Bob')
  else:
    print('Alice')
  

### FIXED CODE ###

A, B = map(int, input().split())
if A < B:
  if A == 1:
    print('Alice')
  else:
    print('Bob')

elif A > B:
  if B == 1:
    print('Bob')
  else:
    print('Alice')
else:
  print('Draw')
def ncr(n,r):
  if r==0 or n==r:
    return 1
  if r==1 or r==n-1:
    return n
  if r>=n-r:
    r=n-r
  dp=[[0 for i in range(r+1)] for j in range(n+1)]
  for i in range(n+1):
    dp[i][0]=1
  dp[1][1]=1
  for i in range(2,n+1):
    for j in range(1,r+1):
      dp[i][j]=dp[i-1][j-1]+dp[i-1][j]
  return dp[n][r]

n,k=map(int,input().split())
for i in range(1,k+1):
  ans=ncr(n-k+1,i)*ncr(k-1,i-1)
  while ans>10**9+7:
    ans%=10**9+7
  print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
dp=[[0 for i in range(k+1)] for j in range(n+1)]
for i in range(n+1):
  dp[i][0]=1
dp[1][1]=1
for i in range(2,n+1):
  for j in range(1,k+1):
    dp[i][j]=dp[i-1][j-1]+dp[i-1][j]
for i in range(1,k+1):
  ans=dp[n-k+1][i]*dp[k-1][i-1]
  while ans>10**9+7:
    ans%=10**9+7
  print(ans)
#coding: Shift_JIS
import numpy as np

def set_array(a,n):
	str=input()
	array=str.split()
	for i in range(n):
		a[i]=int(array[i])
	

n=int(input())
S=np.zeros(n)
set_array(S,n)
q=int(input())
T=np.zeros(q)
set_array(T,q)
C=0

def linear_search(S,x):
	np.append(S,x)
	len=np.size(S)
	i=0
	while(len>i):
		if S[i]==x: break;
		i=i+1
	
	np.delete(S,-1)
	if i!=len:
		return 1;
	else:
		return 0;

for v in T:
	C+=linear_search(S,v)

print(C)


### FIXED CODE ###

#coding: Shift_JIS

def set_array(a,n):
	str=input()
	array=str.split()
	for i in range(n):
		a.append(int(array[i]))
	

n=int(input())
S=[]
set_array(S,n)
q=int(input())
T=[]
set_array(T,q)
C=0

def linear_search(S,x):
	S.append(x)
	l=len(S)
	i=0
	while(l>i):
		if S[i]==x:
			break
		i=i+1
	S.pop(-1)
	if i!=l-1:
		return 1;
	else:
		return 0;
for v in T:
	C+=linear_search(S,v)

print(C)
N = input()
a = [input() for i in range(N)]

if max(a)　>=　sum(a) - max(a):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=input()
a=list(map(int, input().split()))
if max(a)*2 < sum(a):
    print("Yes")
else:
    print("No")
S = input()
T = input()
rec = []
for i in range(len(S)):
    flag = True
    Z = S
    for j in range(len(T)):
        if Z[i] == T[j]:
            for e in range(i - j):
                if Z[e] == "?":
                    Z = Z.replace("?", "a", 1)
            for k in range(len(T)):
                if Z[i + k - j] == T[k]:
                    continue
                elif Z[i + k - j] == "?":
                    Z = Z.replace("?", T[k], 1)
                else:
                    flag = False
            if flag:
                Z = Z.replace("?", "a")
                rec.append(Z)
        elif Z[i] == "?":
            if len(S)-i < len(T):
                flag = False
                break
            for e in range(i):
                if Z[e] == "?":
                    Z = Z.replace("?", "a", 1)
            for k in range(len(T)):
                if Z[i + k] == T[k]:
                    continue
                elif Z[i + k] == "?":
                    Z = Z.replace("?", T[k], 1)
                else:
                    flag = False
            if flag:
                Z = Z.replace("?", "a")
                rec.append(Z)

if rec == []:
    print("UNRESTORABLE")
else:
    print(rec[-1])

### FIXED CODE ###

S = input()
T = input()
rec = []
for i in range(len(S)):
    flag = True
    Z = S
    for j in range(len(T)):
        if Z[i] == T[j]:
            if len(S)-i < len(T):
                flag = False
                break
            for e in range(i - j):
                if Z[e] == "?":
                    Z = Z.replace("?", "a", 1)
            for k in range(len(T)):
                if Z[i + k - j] == T[k]:
                    continue
                elif Z[i + k - j] == "?":
                    Z = Z.replace("?", T[k], 1)
                else:
                    flag = False
            if flag:
                Z = Z.replace("?", "a")
                rec.append(Z)
        elif Z[i] == "?":
            if len(S)-i < len(T):
                flag = False
                break
            for e in range(i):
                if Z[e] == "?":
                    Z = Z.replace("?", "a", 1)
            for k in range(len(T)):
                if Z[i + k] == T[k]:
                    continue
                elif Z[i + k] == "?":
                    Z = Z.replace("?", T[k], 1)
                else:
                    flag = False
            if flag:
                Z = Z.replace("?", "a")
                rec.append(Z)

if rec == []:
    print("UNRESTORABLE")
else:
    print(rec[-1])
from decimal import *
def ABC_169_C():
    getcontext().prec=28
    i=0
    A,B= map(float, input().split())
    k=Decimal(A)*Decimal(B)
    k=str(k)
    i=k.index('.')
    print(k[0:i])

if __name__ == '__main__':

    ABC_169_C()

### FIXED CODE ###

from decimal import *
def ABC_169_C():
    getcontext().prec=28
    A,B= map(float, input().split())
    k=Decimal(str(A))*Decimal(str(B))
    print(int(k))

if __name__ == '__main__':

    ABC_169_C()
N,Y = map(int,input().split())
y = Y/1000
Answer = [-1, -1, -1]
for i in range(N+1):
  if i*10 <= y:
    for j in range(N-i):
      if i*10 + j*5 <= y:
        k = y - i*10 - j*5:
          if i + j + k == N:
            Answer = [i,j,k]
      else:
        break
    else:
      break
print(Answer[0],Answer[1],int(Answer[2]))

### FIXED CODE ###

N,Y = map(int,input().split())
y = Y/1000
Answer = [-1, -1, -1]

for i in range(N+1):
  for j in range(N+1-i):
    if 10*i+5*j+(N-i-j) == Y/1000:
      Answer = [i, j, N-i-j]
      print(*Answer)
      exit()
print(*Answer)
N, M = map(int, input().split())
a_list = list(map(int, input().split()))

items = {
    1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6
}
dp = [0] * (N + 1)

for a in a_list:
    need = items[a]
    dp[need] = a

for i in range(2, N+1):
    for j in range(M):
        if i - items[a_list[j]] >= 0:
                if dp[i - items[a_list[j]]] != 0:
                    dp[i] = max(dp[i - items[a_list[j]]] * 10 + a_list[j], dp[i])

print(dp[N])


### FIXED CODE ###

N, M = map(int, input().split())
a_list = list(map(int, input().split()))

items = {
    1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6
}

dp = [-float("inf")] * (N + 1)
b_list = []
for a in a_list:
    need = items[a]
    if need <= N:
        dp[need] = 1
        b_list.append(a)

M = len(b_list)
dp[0] = 0
for i in range(N + 1):
    for b in b_list:
        if i - items[b] >= 0:
            if dp[i - items[b]] != -float("inf"):
                dp[i] = max(dp[i], dp[i - items[b]] + 1)

b_list.sort(reverse=True)
ans = ""

for i in range(dp[N]):
    for b in b_list:
        if dp[N - items[b]] == dp[N] - 1:
            ans += str(b)
            N -= items[b]
            break
print(ans)
import numpy as np
n, m = map(int, raw_input().split())

### FIXED CODE ###

n, m = map(int, raw_input().split())
 
a = [[0]*m for i in xrange(n)]
 
b = [0]*m
 
for i in xrange(n):
    tmp = map(int, raw_input().split())
    for j in xrange(m):
        a[i][j] = tmp[j]
for i in xrange(m):
    b[i] = input()
for i in xrange(n):
    tmp = 0
    for j in xrange(m):
        tmp += a[i][j] * b[j]
    print tmp
XYZ = map(int, input().split())
print(XYZ[2], XYZ[1], XYZ[0])


### FIXED CODE ###

XYZ = input().split()
print(XYZ[2], XYZ[0], XYZ[1])
H, W = map(int, input().split())
grid = [input() for _ in range(H)]
ans = 0
L = [[0] * W]*H; R = [[0] * W]*H; D = [[0] * W]*H; U = [[0] * W]*H;
for i in range(H):
    for j in range(W):
        if grid[i][j] == '.'
            L[i][j] = L[i][j-1] if j >= 1 else 1
            U[i][j] = U[i-1][j] if i >= 1 else 1
for i in reversed(range(H)):
    for j in reversed(range(W)):
        if grid[i][j] == '.'
            R[i][j] = R[i][j+1] if j <= W-1 else 1
            D[i][j] = D[i+1][j] if i <= H-1 else 1
for i in range(H):
    for j in range(W):
        ans = max(ans, L[i][j] + R[i][j] + D[i][j] + U[i][j] - 3)
print(ans)

### FIXED CODE ###

H, W = map(int, input().split())
grid = [input() for _ in range(H)]
ans = 0
vert = [[0] * W for _ in range(H)]; hori = [[0] * W for _ in range(H)];
for i in range(H):
    for j in range(W):
        if grid[i][j] == '.':
            hori[i][j] = hori[i][j-1] + 1 if j > 0 else 1
    for j in range(W-2, -1, -1):
        if grid[i][j] == '.' and grid[i][j+1] == '.':
            hori[i][j] = hori[i][j+1] 
for j in range(W):
    for i in range(H):
        if grid[i][j] == '.':
            vert[i][j] = vert[i-1][j] + 1 if i > 0 else 1
    for i in range(H-2, -1, -1):
        if grid[i][j] == '.' and grid[i+1][j] == '.':
            vert[i][j] = vert[i+1][j]
for i in range(H):
    for j in range(W):
        if grid[i][j] == '.':
            ans = max(ans, hori[i][j] + vert[i][j] - 1)
print(ans)
#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        print(*args, **kwargs, file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
N, = getIntList()
#print(N)
za = []
for i in range(N):
    a = input()
    a = int(a)
    za.append(a)

za.sort()

if N%2==0:
    t = N//2
    s0 = sum(za[:t])
    s1 = sum(za[t:])
    res = s1*2 - s0 *2  - za[t] + za[t-1]
else:
    t = N//2 + 1
    s0 = sum(za[:t])
    s1 = sum(za[t:])
    res0 = s1 *2 - s0*2 + za[t-1] + za[t-2]
    t = t - 1
    s0 = sum(za[:t])
    s1 = sum(za[t:])
    res1 = s1 *2 - s0*2 -  za[t] - za[t+1]
    res = max(res1, res0)

print(res)
        




### FIXED CODE ###

 
import collections, atexit, math, sys, bisect 
 
def getIntList():
    return list(map(int, input().split()))    
 
 
N, = getIntList()
#print(N)
za = []
for i in range(N):
    a = input()
    a = int(a)
    za.append(a)

za.sort()

if N%2==0:
    t = N//2
    s0 = sum(za[:t])
    s1 = sum(za[t:])
    res = s1*2 - s0 *2  - za[t] + za[t-1]
else:
    t = N//2 + 1
    s0 = sum(za[:t])
    s1 = sum(za[t:])
    res0 = s1 *2 - s0*2 + za[t-1] + za[t-2]
    t = t - 1
    s0 = sum(za[:t])
    s1 = sum(za[t:])
    res1 = s1 *2 - s0*2 -  za[t] - za[t+1]
    res = max(res1, res0)

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

### FIXED CODE ###

s=input()
t=[]
for i in range(3):
  if s[i] =='9':
    t.append('1')
  else:
    t.append('9')
st="".join(t)
print(st)