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

import sys
import math
from collections import defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, a, b = LI()
V = LI()
V.sort()
V.reverse()

cnt = defaultdict(int)
sum_v = 0
for i in range(a):
    sum_v += V[i]
    cnt[V[i]] += 1

# 大きい順にa個選ぶ場合，価値の平均値は最大となる
print(sum_v / a)

# a個選んだ中で一番価値の低いものがいくつ残っているか数える
min_v = V[i]
min_cnt = cnt[min_v]
for i in range(a, n):
    v = V[i]
    if v != min_v:
        break
    cnt[v] += 1

if cnt[min_v] == min_cnt:
    print(1)
    exit()
elif len(cnt.keys()) != 1:
    print(comb(cnt[min_v], min_cnt))
    exit()
ans = 0
for i in range(b - a + 1):
    ans += comb(cnt[min_v], min_cnt + i)

print(ans)


### FIXED CODE ###

# coding:utf-8

import sys
import math
from collections import defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, a, b = LI()
V = LI()
V.sort()
V.reverse()

cnt = defaultdict(int)
sum_v = 0
for i in range(a):
    sum_v += V[i]
    cnt[V[i]] += 1

# 大きい順にa個選ぶ場合，価値の平均値は最大となる
print(sum_v / a)

# a個選んだ中で一番価値の低いものがいくつ残っているか数える
min_v = V[i]
min_cnt = cnt[min_v]
for i in range(a, n):
    v = V[i]
    if v != min_v:
        break
    cnt[v] += 1

if cnt[min_v] == min_cnt:
    print(1)
    exit()
elif len(cnt.keys()) != 1:
    print(comb(cnt[min_v], min_cnt))
    exit()
ans = 0
for i in range(b - a + 1):
    if cnt[min_v] < min_cnt + i:
        break
    ans += comb(cnt[min_v], min_cnt + i)

print(ans)
# coding: utf-8
# Your code here!
import fractions
from functools import reduce
def pin(type=int):
    return map(type,input().split())


N, =pin()
m = list(pin())




def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print(gcd_list(m))

### FIXED CODE ###

# coding: utf-8
# Your code here!
import fractions
from functools import reduce
def pin(type=int):
    return map(type,input().split())


N, =pin()
m = list(pin())




def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

print(gcd_list(m))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = int(input())

aa = a[0]+a[1]*c
bb = b[0]+b[1]*c
d = aa-bb
e = a[1]-b[1]

if aa >= bb:
  if d % e == 0:
    print("YES")
  else:
    print("NO")
else:
  print("NO")

### FIXED CODE ###

a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if abs(a-b) <= t*(v-w):
    print('YES')
else:
    print('NO')
from collections import deque
import math
mod = 10**9+7
N,K = map(int,input().split())


Kperm =[1,K]
pre = K
for i in range(2,K+1):
    pre = (pre*(K+1-i))%mod
    Kperm.append(pre)


#K-2Pxの計算のメモ化
K_2perm =[1,K-2]
pres = K-2
for i in range(2,K-1):
    pres = (pres*(K-1-i))%mod
    K_2perm.append(pres)

child = [[] for i in range(N)]
for hoge in range(N-1):
    a,b = [int(i)-1 for i in input().split()]#点を0-indexedになおす
    child[a].append(b)
    child[b].append(a)


ans = Kperm[len(child[0])+1]
#DFSしながら塗る
went = [False] * N
queue = deque()
queue.append(0)
went[0] = True
while queue:
    cur = queue.popleft()
    if cur!=0:
        ans *= K_2perm[len(child[cur])-1]
        ans %= mod
    for togo in child[cur]:
        if not went[togo]:
            went[togo] = True
            queue.append(togo)
print(ans)



### FIXED CODE ###

from collections import deque
import math
import sys
mod = 10**9+7
N,K = map(int,input().split())

#k
Kperm =[1,K]
pre = K
for i in range(2,K+1):
    pre = (pre*(K+1-i))%mod
    Kperm.append(pre)


#K-2Pxの計算のメモ化
K_2perm =[1,K-2]
pres = K-2
for i in range(2,K-1):
    pres = (pres*(K-1-i))%mod
    K_2perm.append(pres)

child = [[] for i in range(N)]
for hoge in range(N-1):
    a,b = [int(i)-1 for i in input().split()]#点を0-indexedになおす
    child[a].append(b)
    child[b].append(a)

if len(child[0])>=K:
    print(0);sys.exit()
ans = Kperm[len(child[0])+1]
#DFSしながら塗る
went = [False] * N
queue = deque()
queue.append(0)
went[0] = True
while queue:
    cur = queue.pop()
    if cur!=0 and len(child[cur])>=K:
        print(0)
        sys.exit()
    if cur!=0:
        ans *= K_2perm[len(child[cur])-1]
        ans %= mod
    for togo in child[cur]:
        if not went[togo]:
            went[togo] = True
            queue.append(togo)
print(ans)
class Solution:
    def solve(self, N: int, P: List[int]) -> int:

        max_p = N
        answer = 0

        for pn in P:
            if pn <= max_p:
                answer += 1
                max_p = pn

        return answer


if __name__ == '__main__':

    # standard input
    N = int(input())

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

    # solve
    solution = Solution()
    print(solution.solve(N, P))

### FIXED CODE ###

class Solution:
#    def solve(self, N: int, P: List[int]) -> int:
    def solve(self, N, P) :
        max_p = N
        answer = 0

        for pn in P:
            if pn <= max_p:
                answer += 1
                max_p = pn

        return answer


if __name__ == '__main__':

    # standard input
    N = int(input())

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

    # solve
    solution = Solution()
    print(solution.solve(N, P))
n = int(raw_input())
   
dis = [99999 for i in range(n)]
G = [0 for i in range(n)]
v = [[0 for i in range(n)] for j in range(n)]
   
def BFS(s):
  for e in range(n):
    if v[s][e] == 1:
      if dis[e] > dis[s] + 1:
        d[e] = d[s]+1
        BFS(e)
   
for i in range(n):
  G = map(int, raw_input().split())
  for j in range(G[1]):
    v[G[0]-1][G[2+j]-1] = 1
   
dis[0] = 0
for s in range(n):
  BFS(s)
for s in range(n):
  if dis[s] == 99999:
    dis[s] = -1
for s in range(n):
  print'{0} {1}'.format(s+1, dis[s])

### FIXED CODE ###

n = int(raw_input())
   
dis = [99999 for i in range(n)]
G = [0 for i in range(n)]
v = [[0 for i in range(n)] for j in range(n)]
   
def BFS(s):
  for e in range(n):
    if v[s][e] == 1:
      if dis[e] > dis[s] + 1:
        dis[e] = dis[s]+1
        BFS(e)
   
for i in range(n):
  G = map(int, raw_input().split())
  for j in range(G[1]):
    v[G[0]-1][G[2+j]-1] = 1
   
dis[0] = 0
for s in range(n):
  BFS(s)
for s in range(n):
  if dis[s] == 99999:
    dis[s] = -1
for s in range(n):
  print'{0} {1}'.format(s+1, dis[s])
import numpy
n = int(input())
A = map(int, input().split())
ans = numpy.prod(A)
if ans > 10 ** 8:
  print(-1)
else:
  print(ans)

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
if 0 in A:
  print(0)
  exit()
ans = 1
for i in range(len(A)):
  ans = ans * A[i]
  if ans > 10 ** 18:
    print(-1)
    exit()
  else:
    pass
  
print(ans)
#print('RRRLLRL'.index('LR'))
#print('RRRLLRLR'.index('LR'))
#=>4
#str.index(検索文字列,開始位置,終了位置)

#indexは見つからないとエラー
#findは見つからないと-1を出力

#s='RRLRLR'
#bubun=s[0:3]
#print(bubun)
#=>RRL


def stateRL(s):
	state=[0]*len(s)
	r=s.count('R')
	l=s.count('L')
	state[r-1]=1+(r-1)//2+l//2
	state[r]=1+r//2+(l-1)//2
	return state

s=input()
n=len(s)

state=[]

kireme=-1
nkireme=s.find('LR',0)

while nkireme!=-1:
	bubun=s[kireme+1:nkireme+1:]
	state+=stateRL(bubun)
	kireme=nkireme
	nkireme=s.find('LR',kireme+1)

bubun=s[kireme::]
state+=stateRL(bubun)
	
for i in range(n):
	print(state[i],end=' ')

### FIXED CODE ###

#print('RRRLLRL'.index('LR'))
#print('RRRLLRLR'.index('LR'))
#=>4
#str.index(検索文字列,開始位置,終了位置)

#indexは見つからないとエラー
#findは見つからないと-1を出力

#s='RRLRLR'
#bubun=s[0:3]
#print(bubun)
#=>RRL


def stateRL(s):
	state=[0]*len(s)
	r=s.count('R')
	l=s.count('L')
	state[r-1]=1+(r-1)//2+l//2
	state[r]=1+r//2+(l-1)//2
	return state

s=input()
n=len(s)

state=[]

kireme=-1
nkireme=s.find('LR',0)

while nkireme!=-1:
	bubun=s[kireme+1:nkireme+1:]
	state+=stateRL(bubun)
	kireme=nkireme
	nkireme=s.find('LR',kireme+1)

bubun=s[kireme+1::]
state+=stateRL(bubun)
	
for i in range(n):
	print(state[i],end=' ')
n,k = map(int,input().strip().split())
c = 0
for i in range(1,n+1):
  if n>k:
    c+=1/n
  else:
    cnt=0
    while i<k:
      i*=2
      cnt+=1
    c+=1/N*(1/2)**cnt
print(c)


### FIXED CODE ###

n,k = map(int,input().strip().split())
c = 0
for i in range(1,n+1):
  if i>k:
    c+=1/n
  else:
    cnt=0
    while i<k:
      i*=2
      cnt+=1
    c+=1/n*(1/2)**cnt
print(c)
n=int(input())
a=list(map(int,input().split()))
a.sort()
a.reverse()
max1=0;max2=0
for i in range(n-3):
  if a[i]==a[i+1]:
    max1=a[i]
    a[i+1]=0
    count=i+1
    break
for j in range(count,n-1):
  if a[j]==a[j+1]:
    max2=a[j]
    break
print(max1*max2)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort()
a.reverse()
max1=0;max2=0
count=0
for i in range(n-3):
  if a[i]==a[i+1]:
    max1=a[i]
    a[i+1]=0
    count=i+1
    break
if count==0:
  print(0)
  exit()
for j in range(count,n-1):
  if a[j]==a[j+1]:
    max2=a[j]
    break
print(max1*max2)
import operator
for e in iter(input,'0'):
    target = [[*map(int,input().split())]for _ in[0]*int(e)]
    s,t = min(target)
    target = {(x - bx, y - by) for x, y in target}
    max_tx = max(map(lambda x:x[0], target))
    b = {tuple(map(int,input().split()))for _ in[0]*int(input())}
    max_sx = max(map(operator.itemgetter(0), b))
    lim_x = max_sx - max_tx
    for x,y in b:
        if x > lim_x:continue
        for u,v in target:
            if (x + u, y + v) not in b:break
        else:
            print(x - s, y - t)
            break


### FIXED CODE ###

for e in iter(input,'0'):
 a=[[*map(int,input().split())]for _ in[0]*int(e)]
 s,t=min(a)
 b={tuple(map(int,input().split()))for _ in[0]*int(input())}
 m=max(b)[0]-max(a)[0]+s
 for x,y in b:
  if x<=m:
   for u,v in a:
    if(x+u-s,y+v-t)not in b:break
   else:print(x-s,y-t);break
N= map(int, input())
a = list(map(int,input().split()))

counter=0
for i in range(N):
  print(a[i])

### FIXED CODE ###

N= int(input())
a = list(map(int,input().split()))

counter=0
for i in range(N):
  if (i+1)%2==1:
    if a[i]%2==1:
      counter+=1
print(counter)
import math
n =int(input())
proint(2*n*math.pi)

### FIXED CODE ###

import math
n =int(input())
print(2*n*math.pi)
k, x = map(int, input().split())
l = []
for i in range(k):
    l.append(x+i)
    if i > 0:
        l.append(x-i)
l = sorted(l)
for j in range(10000):
    print(l[j], end=" ")

### FIXED CODE ###

k, x = map(int, input().split())
l = []
for i in range(k):
    l.append(x+i)
    if i > 0:
        l.append(x-i)
l = sorted(l)
for j in range(2*k-1):
    print(l[j], end=" ")
import math
a,b,x = list(map(int,input().split()))
# b*c*1/2 * a = x
if a*b*0.5*a > x:
    c = (2*x) / (a*b)
    ans = 90 - math.degrees(math.atan(c/b))
    print(ans)
else:
    c = (2*x) / a**2 - b
# (b+c)*a *1/2 *a = x
    ans = 90 - math.degrees(math.atan(a/(b-c)))
    print(ans)


### FIXED CODE ###

import math
a,b,x = list(map(int,input().split()))
if a*b*0.5*a > x:
    c = (2*x) / (a*b)
    ans = 90 - math.degrees(math.atan(c/b))
    print(ans)
else:
    c = (2*x) / a**2 - b
    if b-c == 0:
        ans = 0
    else:
        ans = 90 - math.degrees(math.atan(a/(b-c)))
    print(ans)
s=list(input())
divide=["dream","erase","eraser","dreamer"]
#全探索する
def dfs(n):
        if n==len(s):#最後まで行ったらtrue
                return True
        for i in divide:
                tmp="".join(s[n:n+len(i)])
                if n+len(i)<=len(s) and tmp==i:
                        if dfs(n+len(i)):
                                return True
        return False
print("YES") if dfs(0) else print("NO")


### FIXED CODE ###

s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")
L =int(input())

if L == 1:
    print('0.037036926')
elif L==2:
     print('0.296296074')
else:
    ans =0
    for i in range(2000):
        for j in range(2000):
            ans =max(ans, i/2*j/2*(L-(i/2+j/2)))
    print(ans

### FIXED CODE ###

L =int(input())

if L == 1:
    print('0.037036926')
elif L==2:
     print('0.296296074')
else:
    ans =0
    for i in range(100000):
        ans =max(ans, i/100*i/100*(L-(i/100+i/100)))
    print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))

min_idx = 0
for idx in range(N):
  if A[idx] < A[min_idx]:
    min_idx = idx
ans = 10**5
for idx in range(K):
  left = min_idx - K + idx
  right = min_idx + idx
  if min_idx - K + idx < 0:
    continue
  if min_idx - K + idx >= N:
    break
  sum_cnt = 1
  if (N-right)%(K-1) == 0:
    sum_cnt += (N-right)//(K-1)
  else:
    sum_cnt += (N-mright)//(K-1)+1
  if left%(K-1) == 0:
    sum_cnt += left//(K-1)
  else:
    sum_cnt += left//(K-1) + 1
  ans = min(ans, sum_cnt)
print(ans)


### FIXED CODE ###

import math

N, K = map(int, input().split())
nums = list(map(int, input().split()))
print(math.ceil((len(nums)-1)/(K-1)))
#https://atcoder.jp/contests/abc128
# -*- coding: utf-8 -*-

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

k = []
s = []
for i in range(m):
    x = list(map(int,input().split()))
    k.append(x[0])
    y = []
    for j in range(x[0]):
        y.append(x[j+1])
    s.append(y)

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

cnt = 0
for i in range(1024):
    x = format(i,"08b")[::-1]
    if x[n] == "1":
        break

    for j in range(m):
        tmpSum = 0
        for k in s[j]:
            tmpSum += int(x[k-1])
        if tmpSum%2 is not p[j]:
            break
    else:
        cnt += 1
        
print(cnt)

### FIXED CODE ###

#https://atcoder.jp/contests/abc128
# -*- coding: utf-8 -*-

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

k = []
s = []
for i in range(m):
    x = list(map(int,input().split()))
    k.append(x[0])
    y = []
    for j in range(x[0]):
        y.append(x[j+1])
    s.append(y)

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

cnt = 0
for i in range(1024):
    x = format(i,"010b")[::-1]
    if n < 10 and x[n] == "1":
        break
    
    for j in range(m):
        tmpSum = 0
        for k in s[j]:
            tmpSum += int(x[k-1])
        if tmpSum%2 is not p[j]:
            break
    else:
        cnt += 1

print(cnt)
import sys
from itertools import permutations

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    N = int(input())
    assert N <= 8

    X = [int(i) for i in input().split()]

    cnt = 0
    MOD = 10**9 + 7

    for pm in permutations(range(N)):
        Xc = X[:]
        flag = True

        for p in pm:
            for i in range(p-1, -1, -1):
                if Xc[i] < 2*i + 1:
                    flag = False
                    break
            if flag:
                break
            Xc[p] = float('inf')

        cnt += flag

    print(cnt % MOD)


if __name__ == '__main__':
    solve()

### FIXED CODE ###

import sys
from math import factorial

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    N = int(input())
    X = [int(i) for i in input().split()]
    MOD = 10**9 + 7
    ans = 1
    stack = 0

    for x in X:
        stack += 1
        if x < 2*(stack - 1) + 1:
            ans *= stack
            ans %= MOD
            stack -= 1

    ans *= (factorial(stack) % MOD)
    ans %= MOD

    print(ans)


if __name__ == '__main__':
    solve()
n,u,v = map(int,input().split())

edges = [[] for _ in range(n)]

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

visit1 = [False]*n
visit2 = [False]*n

visit1[u-1] = True
visit2[v-1] = True

stack1 = [u-1]
stack2 = [v-1]

dis1 = [-1] * n
dis2 = [-1] * n
dis1[u-1] = 0
dis2[v-1] = 0

while stack1:
    for _ in range(len(stack1)):
        q1 = stack1.pop(-1)
        for i in edges[q1]:
            if not visit1[i] and not visit2[i]:
                visit1[i] = True
                dis1[i] = dis1[q1] + 1
                stack1.append(i)

    for _ in range(len(stack2)):
        q2 = stack2.pop(-1)
        for i in edges[q2]:
            if not visit2[i]:
                visit2[i] = True
                dis2[i] = dis2[q2] + 1
                stack2.append(i)

while stack2:
    q = stack2.pop(-1)
    for i in edges[q]:
        if not visit2[i]:
            visit2[i] = True
            dis2[i] = dis2[q] + 1
            stack2.append(i)

Ans = 0
for i in range(n):
    If dis1[i] != 0:
        Ans =max(Ans,dis2[i])
ans = Ans -1

print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline

n,u,v = map(int,input().split())
edges = [[] for _ in range(n)]

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

visit1 = [False] * n
visit2 = [False] * n
visit1[u-1] = True
visit2[v-1] = True

dis1 = [-1] * n
dis2 = [-1] * n
dis1[u-1] = 0
dis2[v-1] = 0

stack1 = [u-1]
stack2 = [v-1]

while stack1:
    l = stack1.pop(-1)
    for i in edges[l]:
        if visit1[i] == False:
            visit1[i] = True
            dis1[i] = dis1[l] + 1
            stack1.append(i)

while stack2:
    l = stack2.pop(-1)
    for i in edges[l]:
        if visit2[i] == False:
            visit2[i] = True
            dis2[i] = dis2[l] + 1
            stack2.append(i)

ans = 0

for i in range(n):
    if dis1[i] < dis2[i]:
        ans = max(ans, dis2[i])

print(ans-1)
N=int(input())
S=input()
w=ans=9**9
for i in range(N):
    e=S[:i].count("W")
    w=S[i:].count("E")
    ans=min(ans,e+w)
    if w=0:break
print(ans)


### FIXED CODE ###

N=int(input())
S=input()
e=0
ans=w=S.count("E")
for i in S:
    if i=="E":w-=1
    else: e+=1
    ans=min(ans,e+w)
print(ans)
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.

__author__ = "c0117054"
__date__ = "$2019/02/18 19:31:49$"

if __name__ == "__main__":

    a=int(input())
    b=int(input())
    
    if b%a==0:
        print(a+b)
    else:
        print(b-a)

### FIXED CODE ###

a,b=map(int,input().split())
if b%a==0:
	print(a+b)
else:
	print(b-a)
n=int(input())
p=[int(i) for i in input().split()]
n1=[i for i in range(1,n+1)]
for i in n1:
  for k in n1:
    n1=n1.replace(i,k)
    if n1==p:
      print('YES')
      exit()
else:
  print('NO')
    
 

### FIXED CODE ###

n=int(input())
p=[int(i) for i in input().split()]
n1=[i for i in range(1,n+1)]
for i in range(n):
  for k in range(n):
    n1[i],n1[k]=n1[k],n1[i]
    if n1==p:
      print('YES')
      exit()
    n1=[i for i in range(1,n+1)]
else:
  print('NO')
n, m = map(int, input().split())
a = [0]
b = [0]
for i in range(1, m+1):
    ta, tb = map(int, input().split())
    a.append(ta)
    b.append(tb)
dir = [[] for _ in range(m+1)]
for i in range(1, m+1):
    dir[a[i]].append(b[i])
    dir[b[i]].append(a[i])
ans = [0 for i in range(n+1)]
flag = [0 for i in range(n+1)]
flag[1] = 1
que = [1]
while len(que) != 0:
    print('que: ', len(que), que)
    now = que.pop(-1)
    flag[now] = 1
    for to in dir[now]:
        if flag[to] != 1 and not (to in que):
            que.append(to)
            flag[to] != 1
            ans[to] = now
"""         print(to)
        ans[to] = now
        flag[to] = 1
        for toto in dir[to]:
            if flag[toto] != 1:
                que.append(toto) """
print('Yes')
for i in range(2,n+1):
    print(ans[i])

### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())
dir = [[] for _ in range(n+1)]

for i in range(m):
    ta, tb = map(int, input().split())
    dir[ta].append(tb)
    dir[tb].append(ta)

ans = [0]*(n+1)
flag = [False]*(n+1)
flag[1] = True
que = deque([1])
while que:
    #print('que: ', len(que), que)
    now = que.popleft()
    for to in dir[now]:
        if flag[to]:
            continue
        que.append(to)
        flag[to] = True
        ans[to] = now

print('Yes')
for i in range(2,n+1):
    print(ans[i])
import numpy as np
N, C = map(int, input().split())
D = np.array(map(int, input().split()), dtype=int)
for i in range(C-1):
    D = np.vstack((D, np.array(map(int, input().split()), dtype=int)))
Z = np.array(map(int, input().split()), dtype=int)
for i in range(N-1):
    Z = np.vstack((c, np.array(map(int, input().split()), dtype=int)))
num = np.zeros(size=(3,C), dtype=int)
for i in range(3):
    X = np.array([[(x+y+2)%3==i for y in range(N)] for x in range(N)])
    for c in range(C):
        Y = (Z*X)==c+1
        num[i,c] = Y.sum()
costs = np.matmul(num, D)
mincost = 10**10
for c0 in range(C):
    for c1 in range(C):
        if c1 ==c0:
            continue
        for c2 in range(C):
            if c2 == c1:
                continue
            cost = costs[0,c0]+costs[1,c1]+costs[2,c2]
            mincost = min(mincost, cost)
print(mincost)

### FIXED CODE ###

import numpy as np
N, C = map(int, input().split())
D = np.array(list(map(int, input().split())), dtype=int)
for i in range(C-1):
    D = np.vstack((D, np.array(list(map(int, input().split())), dtype=int)))
Z = np.array(list(map(int, input().split())), dtype=int)
for i in range(N-1):
    Z = np.vstack((Z, np.array(list(map(int, input().split())), dtype=int)))
num = np.zeros((3,C), dtype=int)
for i in range(3):
    X = np.array([[(x+y+2)%3==i for y in range(N)] for x in range(N)])
    for c in range(C):
        Y = ((Z*X)==(c+1))
        num[i,c] = Y.sum()
costs = np.dot(num, D)
mincost = 10**10
for c0 in range(C):
    for c1 in range(C):
        if c1 ==c0:
            continue
        for c2 in range(C):
            if c2 == c0 or c2 == c1:
                continue
            cost = costs[0,c0]+costs[1,c1]+costs[2,c2]
            mincost = min(mincost, cost)
print(mincost)
s = input()
first = s[0]
cnt_f = 0
cnt_s = 0
for i in range(len(s)):
    if s[i] != first:
        second = s[i]
        break
for i in range(len(s)):
    if s[i] == first:
        cnt_f+=1
    if s[i] == second:
        cnt_s+=1
if cnt_f == 2 and cnt_s == 2:
    print("Yes")
else:
    print("No")



### FIXED CODE ###

s = input()
first = s[0]
second = ""
cnt_f = 0
cnt_s = 0
for i in range(len(s)):
    if s[i] != first:
        second = s[i]
        break
for i in range(len(s)):
    if s[i] == first:
        cnt_f+=1
    if s[i] == second:
        cnt_s+=1
if cnt_f == 2 and cnt_s == 2:
    print("Yes")
else:
    print("No")
n =input()
if 111 =< n <= 999:
  

### FIXED CODE ###

s = input()

r = ""
for i in s:
  if i =='1':
    r += '9'
  else:
    r += '1'
print(r)
a, b = int(input())

print(max(a + b,a - b,a*b))

### FIXED CODE ###

a,b = map(int,input().split())

print(max(a + b,a - b, a*b))
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import itertools

def main():
    a,b = map(int,input().split())
    datas = list(range(a,b+1))
    answer=1
    if a == 0 or b ==0 or (a<0 and b>0):
        print("Zero")
        exit()
    else:
        if abs(a-b)%2!=0:
            print("Positive")
        else:
            print("Negative")

if __name__=="__main__":
    main()

### FIXED CODE ###

#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    a,b = map(int,input().split())
    if a == 0 or b ==0 or (a<0 and b>0):
        print("Zero")
        exit()
    else:
        if a > 0 and b > 0:
            print("Positive")
        elif abs(a-b)%2!=0:
            print("Positive")
        else:
            print("Negative")

if __name__=="__main__":
    main()