Harryxun/stf_run huggingface dataset:
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

X, Y = map(int,input().split())
a=(-X+2*Y)/3
b=(2*X-Y)/3
if a.is_integer()==False or b.is_integer()==False:
    print(0)
else:
    print(cmb(int(a+b),int(b),mod))
    

### FIXED CODE ###

p = 1000000007

X, Y = map(int, input().split())

if (X + Y) % 3 != 0:
    print(0)
    exit()

a = (2 * Y - X) // 3
b = (2 * X - Y) // 3

if a < 0 or b < 0:
    print(0)
    exit()

n = a + b
fac = [0] * (n + 1)
fac[0] = 1
for i in range(n):
    fac[i + 1] = fac[i] * (i + 1) % p


def mcomb(n, k):
    if n == 0 and k == 0:
        return 1
    if n < k or k < 0:
        return 0
    return fac[n] * pow(fac[n - k], p - 2, p) * pow(fac[k], p - 2, p) % p


print(mcomb(n, a))
#他者の解答を参考にした
k=int(input())
print(k*ACL)

### FIXED CODE ###

k=int(input())
if k==1:
  print('ACL')
elif k==2:
  print('ACLACL')
elif k==3:
  print('ACLACLACL')
elif k==4:
  print('ACLACLACLACL')
elif k==5:
  print('ACLACLACLACLACL')
from operator import mul
from functools import reduce

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

def cmb(n, r):
    if n < r:  return 0
    r = min(n - r, r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under

dic = {}
for i in range(N):
    if A[i] in dic:  dic[A[i]] += 1
    else:  dic[A[i]] = 1
        
sum_ = 0
for i in dic: sum += cmb(dic[i], 2)

for i in range(N):
    ans = sum_ - (dic[A[i]] - 1)
    print(ans)

### FIXED CODE ###

from operator import mul
from functools import reduce

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

def cmb(n, r):
    if n < r:  return 0
    r = min(n - r, r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under

dic = {}
ma = max(A)
for i in range(N):
    if A[i] in dic:
        dic[A[i]] += 1
    else:
        dic[A[i]] = 1
        
c = [0 for _ in range(ma + 1)]
for i in dic:
    c[i] = cmb(dic[i], 2)
sum_ = sum(c)

for i in range(N):
    ans = sum_ - c[A[i]] + cmb(dic[A[i]] - 1, 2)
    print(ans)
import numpy as np
n=int(input())
a=np.array(list(map(int,input().split())))
q=int(input())
bc=np.array([list(map(int,input().split())) for _ in range(q)])
a.sort()
def find(i):#iは参照番号
  j=0
  while a[j]<bc[i][0]:
    if j==q-1:
      break
    j+=1
  while a[j]==bc[i][0]:
    a[j]=bc[i][1]
    j+=1
    if j==len(a):
      break
  a.sort()
  
for i in range(q):
  find(i)
  print(np.sum(a))

### FIXED CODE ###

import numpy as np
n=int(input())
a=np.array(list(map(int,input().split())))
q=int(input())
num=np.zeros(100001)
for i in a:
  num[i]+=1
sum=a.sum()
for i in range(q):
  b,c=map(int,input().split())
  sum+=(c-b)*num[b]
  num[c]+=num[b]
  num[b]=0
  print(int(sum))
while(1):
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    elif m==-1 or f==-1:
        print("F")
    elif m+f>=80:
        print("A")
    elif m+f>=65 and m+f<80:
        print("B")
    elif m+f>=50 and m+f<65:
        print("C")
    elif m+f>=30 and m+f<50:
        print("D")
    elif r>=50:
        print("D")
    elif:
        print("F")






### FIXED CODE ###

while(1):
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    
    elif m==-1 or f==-1:
        print("F")
    elif m+f>=80:
        print("A")
    elif m+f>=65 and m+f<80:
        print("B")
    elif m+f>=50 and m+f<65:
        print("C")
    elif m+f>=30 and m+f<50 and r>=50:
        print("C")
    elif m+f>=30 and m+f<50:
        print("D")
    elif m+f<30:
        print("F")
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
from math import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())
a=list(map(int,input().split()))
cnt=0
maxa=max(a)
while 2**cnt<2*maxa:
    cnt+=1
    # print(2**cnt)

lsta=[0]*n
for i in range(1,cnt+1)[::-1]:
    dic=defaultdict(list)
    for j in range(n):
        if 2**i>a[j] and lsta[j]==0:
            if dic[a[j]]!=[]:
                lsta[j]=-1
                lsta[dic[a[j]].pop()]=-1
            else:
                dic[2**i-a[j]].append(j)
    # print(dic)
# print(lsta)
ans=-sum(lsta)//2
print(ans)

### FIXED CODE ###

import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
# from math import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())
a=list(map(int,input().split()))
cnt=0
maxa=max(a)
while 2**cnt<2*maxa:
    cnt+=1
    # print(2**cnt)

lsta=[0]*n
for i in range(1,cnt+1)[::-1]:
    dic=defaultdict(list)
    for j in range(n):
        if 2**i>a[j] and lsta[j]==0:
            if dic[a[j]]!=[]:
                lsta[j]=-1
                lsta[dic[a[j]].pop()]=-1
            else:
                dic[2**i-a[j]].append(j)
    # print(dic)
# print(lsta)
ans=-sum(lsta)//2
print(ans)
import sys
from collections import Counter
input = sys.stdin.readline
n = int(input())
s = list(input())

c  = list(Counter(s).values())  

num = c[0]*c[1]*c[2]

for j in range(n):
    for d in range(1,min(j,n-j-1)+1):
        i = j-d
        k = j+d
        if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            num -= 1
print(num)

### FIXED CODE ###

import sys
from collections import Counter
input = sys.stdin.readline
n = int(input())
s = list(input())

c  = Counter(s)  

num = c['R']*c['G']*c['B']

for j in range(n):
    for d in range(1,min(j,n-j-1)+1):
        i = j-d
        k = j+d
        if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            num -= 1
print(num)
# coding: utf-8
# ?????????????????¨????????????
class Dice(object):
	def __init__(self):
		# ???????????????????????°
		# ????????¶???
		self.dice = (2, 5), (3, 4), (1, 6) # x, y, z
		self.ax = [[0, False], [1, False], [2, False]]
		self.axmap = [0, 1, 2]
		self.mm = {"N": (0, 2), "S": (2, 0), "E": (1, 2), "W": (2, 1), "R": (0, 1), "L": (1, 0)}

	def rotate(self, dir):
		def rot(k, r):
			# k?????????????????????????????????????????§?§????
			# r?????????????????¢???????§????
			t = self.axmap[r]
			self.axmap[k], self.axmap[r] = t, self.axmap[k]
			self.ax[t][1] = not self.ax[t][1]

		rot(*self.mm[dir])

	def top(self):
		z = self.ax[self.axmap[2]]
		return self.dice[z[0]][z[1]]
	
	def right(self):
		y = self.ax[self.axmap[1]]
		return self.dice[y[0]][y[1]]

	def front(self):
		x = self.ax[self.axmap[0]]
		return self.dice[x[0]][x[1]]

if __name__=="__main__":
	dice = Dice()
	labels = input().split()
	q = int(input())
	for _ in range(q):
		a, b = input().split()
		p = labels.index(a) + 1
		for _ in range(4):
			if p==dice.top():
				break
			dice.rotate("N")
		for _ in range(4):
			if p==dice.top():
				break
			dice.rotate("E")
		
		p = labels.index(b) + 1
		for _ in range(4):
			if p==dice.front():
				break;
			dice.rotate("R")

		print(labels(dice.right()-1))

### FIXED CODE ###

# coding: utf-8
# ?????????????????¨????????????
class Dice(object):
	def __init__(self):
		# ????????¶???
		self.dice = (2, 5), (3, 4), (1, 6) # x, y, z
		self.ax = [[0, False], [1, False], [2, False]]
		self.axmap = [0, 1, 2]
		self.mm = {"N": (0, 2), "S": (2, 0), "E": (1, 2), "W": (2, 1), "R": (0, 1), "L": (1, 0)}

	def rotate(self, dir):
		def rot(k, r):
			t = self.axmap[r]
			self.axmap[k], self.axmap[r] = t, self.axmap[k]
			self.ax[t][1] = not self.ax[t][1]

		rot(*self.mm[dir])

	def front(self): return self.value(0, True)
	def rear(self): return self.value(0, False)
	def right(self): return self.value(1, True)
	def left(self): return self.value(1, False)
	def top(self): return self.value(2, True)
	def bottom(self): return self.value(2, False)
	def value(self, ax, d):
		a = self.ax[self.axmap[ax]]
		return self.dice[a[0]][a[1] if d else not a[1]]

if __name__=="__main__":
	dice = Dice()
	labels = input().split()
	q = int(input())
	def tf(p, f, d):
		for _ in range(4):
			if p==f(): break
			dice.rotate(d)

	for _ in range(q):
		a, b = input().split()
		p = labels.index(a) + 1
		f = dice.top
		tf(p, f, "N")
		if p!=f(): tf(p, f, "E")
		
		p = labels.index(b) + 1
		f = dice.front
		tf(p, f, "R")

		print(labels[dice.right()-1])
N,W = map(int,input().split())
wv = []
for i in range(N):
    wv.append(list(map(int,input().split())))
    
#- dp[i][j] i番目より後ろの品物から、重さjまで許して荷物を入れた時の価値の最大
dp = [[0]*(W+1) for i in range(N+1)]

for i in range(N-1,-1,-1):#N番目以降は品物がもうないので0。→N-1からやる
    for j in range(W,-1,-1): #重いほうから見ていく
        if j<wv[i][0]:#i番目の荷物の重さがそもそも許容値よりも大きい→いれられない
            dp[i][j] = dp[i+1][j]
        else:
            dp[i][j] = max(dp[i+1][j],dp[i+1][j-wv[i][0]]+wv[i][1])#いれない or いれる　の大きいほう
#最後の出力は、0番目以降の品物(つまり、全部)から、重さWまで許したときの価値の最大
print(dp[0][W])


### FIXED CODE ###

N,W = map(int,input().split())
wv = [0]
for i in range(N):
    wv.append(list(map(int,input().split())))
    
#- dp[i][j] i番目までの品物から、価値がjとなるように選んだ時の、重さの最小値
Vmax = 10**3*100
dp = [[float('inf')]*(Vmax+1) for i in range(N+1)]
dp[0][0]=0#なにも品物を選ばないなら価値0で重さ0

for i in range(1,N+1):#N番目以降は品物がもうないので0。→N-1からやる
    for j in range(0,Vmax+1): #価値でループ
        if j<wv[i][1]:#i番目の荷物の価値がそもそも入れたい価値よりも大きい→いれられない
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = min(dp[i-1][j],dp[i-1][j-wv[i][1]]+wv[i][0])#いれない or いれる　の大きいほう
#最後の出力は、最終番目以降の品物(つまり、全部)から、価値の大きいほうから見ていき、許容W以下のもの
for i in range(Vmax,-1,-1):
    if dp[N][i] <= W:
        print(i)
        break
def check(s):
  n=len(s)
  if s!==s[::-1]:
    return "No"
  temp=s[:(n-1)//2]
  if temp!=temp[::-1]:
    return "No"
  temp=s[((n+3)//2)-1:]
  if temp!=temp[::-1]:
    return "No"
  return "Yes"
s=input()
print(check(s))

### FIXED CODE ###

def check(s):
  n=len(s)
  if s!=s[::-1]:
    return "No"
  temp=s[:(n-1)//2]
  if temp!=temp[::-1]:
    return "No"
  temp=s[((n+3)//2)-1:]
  if temp!=temp[::-1]:
    return "No"
  return "Yes"
s=input()
print(check(s))
import copy
import numpy as np
n,m = map(int, input().split())
cakes = []
for i in range(n):
    cakes.append(list(map(int, input().split())))

def rec(i, k, s, obj):
    if i==k:
        obj.append(s)
        return
    rec(i+1, k, copy.deepcopy(s), obj)
    s[i]=1
    rec(i+1, k, copy.deepcopy(s), obj)
    s[i]=-1


def makeCombination(k):
    s=[-1 for i in range(k)]
    obj = []
    rec(0, k, s, obj)
    return obj

comb = makeCombination(3)
max = 0
for c in comb:
    sum_list = []
    nc = np.array(c)
    for cak in cakes:
        cake = np.array(cak)
        total = cake.dot(nc)
        sum_list.append(total)
    ssum_list = sorted(sum_list)
    sum_mm = sum(ssum_list[n-m:])
    if(max < sum_mm):
        max = sum_mm

print(max)


### FIXED CODE ###

A, B = map(int, input().split())
if(A > 8 or B > 8):
    print(':(')
else:
    print('Yay!')
n = int(input())

flag = 0
for i in range(3):
  if(n[i] == n[i+1]):
    flag = 1
  if(flag == 1):
    print("Bad")
    break
if(flag == 0):
  print("Good")


### FIXED CODE ###

n = input()

flag = 0
for i in range(3):
  if(n[i] == n[i+1]):
    flag = 1
  if(flag == 1):
    print("Bad")
    break
if(flag == 0):
  print("Good")
n=int(input())
sub=dict()
for _ in range(n):
  x,u=input().split()
  if u in sub:
    sub[u]+=x
  else:
    sub[u]=x
print(int(sub["JPY"])+int(sub["TBD"])*380000.0)

### FIXED CODE ###

N = int(input())
XU = [[_ for _ in input().split()] for _ in range(N)]
ans = 0
for x, u in XU:
    if u == 'BTC':
        ans += float(x) * 380000
    else:
        ans += int(x)
print(ans)
#copy code.
n, r = input().split()

def calc(n, r):
  if n >= 10:
    return n
  else:
    return 100*(10-r)

return calc(n,r)

### FIXED CODE ###

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

def calc(n, r):
  if n >= 10:
    return r
  else:
    return r + 100*(10-n)

print(calc(n, r))
import sys
for n in sys.stdin:
    c=0
    for i in range(1,int(n)+1):
        j=i
        while j%5==0:
            j/=5
            c+=1
    print c

### FIXED CODE ###

while 1:
    n = input()
    if n==0: break
    c = 0
    while n:
        n /= 5
        c += n
    print c
if 2**i <=n:


### FIXED CODE ###

n = int(input())
ans = 0
for i in range(n):
    if 2**i <=n:
        ans = 2**i
    else:
        break
print(ans)
N=int(input())
for i in range 26:
  for j in range 14:
    if i+j==N:
      print('Yes')
      break
  else:
    continue
  break
else:
  print('No')
  

### FIXED CODE ###

N=int(input())
for i in range(26):
  price=4*i
  for j in range(16):
    price+=7*j
    if price==N:
      print('Yes')
      break
  if price==N:
      break
else:
  print('No')
M=(P+3A)/2
M

### FIXED CODE ###

A,P=(int(i) for i in input().split())
print((P+3*A)//2)
n=[input() for i in range(int(input()))]
m=[input() for i in range(int(input()))]
l=list(set(n))
print(max(0,max(n.count(l[i])-m.count(l[i]) for i in range(len(l))))

### FIXED CODE ###

n=[input() for i in range(int(input()))]
m=[input() for i in range(int(input()))]
l=list(set(n))
print(max(0,max(n.count(l[i])-m.count(l[i]) for i in range(len(l)))))
n,m=map(int,input().split())
k=[[0]*m for i in range(n)]
for i in range(n):
    k[i]=list(map(int,input().split()))
ans=1000
for i in range(m-1):
    ma=[0]*m
    mi=-1
    for j in range(n):
        ma[k[j][0]]+=1
    if ans>max(ma):
        ans=max(ma)
    mi=ma.index(max(ma))+1
    for j in range(n):
        k[j].remove(mi)
print(ans)
        


### FIXED CODE ###

n,m=map(int,input().split())
k=[[0]*m for i in range(n)]
for i in range(n):
    k[i]=list(map(int,input().split()))
ans=1000
for i in range(m-1):
    ma=[0]*m
    mi=-1
    for j in range(n):
        ma[k[j][0]-1]+=1
    if ans>max(ma):
        ans=max(ma)
    mi=ma.index(max(ma))+1
    for j in range(n):
        k[j].remove(mi)
if m==1:
    print(n)
else:
    print(ans)
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()
ls = list(S)
ls = [int(x) for x in ls]

ans = min(ls.count(0),ls.count(1))
pirnt(ans*2)

### FIXED CODE ###

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

S = input()
ls = list(S)
ls = [int(x) for x in ls]

ans = min(ls.count(0),ls.count(1))
print(ans*2)
a=input()
print(a.count("1"))

### FIXED CODE ###

a=input()
print(a.count("1"))
#入力
S=input()

#処理
l=len(S)
if l==0:
  t=1
else:
  t=0

X="AKIHABARA"
while len(S)!=0:
  if S[0]=="A":
    if S[0]==X[0]:
      S=S[1:]
      X=X[1:]
    else:
      t=1
      break
  else:
    if X[0]=="A":
      X=X[1:]
    else:
      if S[0]==X[0]:
      	S=S[1:]
      	X=X[1:]
      else:
        t=1
        break
        
if t==1:
  print("NO")
elif len(X)!=0:
  print("NO")
else:
  print("YES")
        

### FIXED CODE ###

#1
#入力
S=input()


#処理
import re
m=re.fullmatch(r'A?KIHA?BA?RA?',S)

if m==None:
    print("NO")
else:
    print("YES")
n = input()

tmp = n[0]+n[1]+n[2]

if n%tmp == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = input()
tmp = 0
 
for i in range(len(n)):
  tmp += int(n[i])
 
if int(n)%tmp == 0:
  print("Yes")
else:
  print("No")
a,b = map(int , input().split())

if a,b > 9:
  print(a*b)
  else:
    print(-1)

### FIXED CODE ###

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

if a > 9 or a < 1:
	print(-1)
elif b > 9 or b < 1:
	print(-1)
else:
	print(a*b)
str_lis = input().split()
A, B, K = [int(x) for x in str_lis]
N = min(A, B)
num_lis = [n for n in range(1, N + 1) if A % n == 0 and B % n == 0]
print(num_lis[K])

### FIXED CODE ###

str_lis = input().split()
A, B, K = [int(x) for x in str_lis]
N = min(A, B)
num_lis = [n for n in range(1, N + 1) if A % n == 0 and B % n == 0]
lis = num_lis[::-1]
print(lis[K - 1])
n=int(input());
num_list=[];
for i in range(n):
    num_list.append(int(input()));
    m=max(num_list)
for j in range(n):
    if(num_list[j]==m):
        num_list[j]=0;
        print(max(num_list))
    print(m);


### FIXED CODE ###

a=int(input());
print(3*a**2);
from collections import deque

def num_way(stair):
  memo = ["EMPTY"]*(stair+1)
  def _fib(stair):
    if stair == 1 or stair == 0:
      return 1
    elif stair == 2:
      return 2
    elif memo[stair] != "EMPTY":
      return memo[stair]
    else:
      memo[stair] = _fib(stair-1)+_fib(stair-2)
      return memo[stair]
  return _fib(stair)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)
  ans %= 1000000007

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  if (end-start) <= -1:
    path_poss = 0
  if path_poss == 0:
    print(0)
  else:
  	print(num_way(end-start))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
from collections import deque

def num_way(stair):
  memo = ["EMPTY"]*(stair+1)
  def _fib(stair):
    if stair == 1 or stair == 0:
      return 1
    elif stair == 2:
      return 2
    elif memo[stair] != "EMPTY":
      return memo[stair]
    else:
      memo[stair] = _fib(stair-1)+_fib(stair-2)
      return memo[stair]
  return _fib(stair)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)
  ans %= 1000000007

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  if(end-start) <= -1:
    path_poss = 0
  if path_poss == 0:
    print(0)
  else:
    ans *= num_way(end-start)
    print(ans%1000000007)
ipt = [int(input()) for i in range(5)]

minnum = 1000

for i, con in enumerate(ipt):
    if con % 10 != 0:
        if minnum > con % 10:
            minnum = con % 10
            minidx = i

print(sum([int((con+9)/10)*10 if i != minidx and con%10 != 0 else con for i,con in enumerate(ipt)]))

### FIXED CODE ###

ipt = [int(input()) for i in range(5)]

minnum = 1000
minidx = 6
for i, con in enumerate(ipt):
    if con % 10 != 0:
        if minnum > con % 10:
            minnum = con % 10
            minidx = i

print(sum([int((con+9)/10)*10 if i != minidx and con%10 != 0 else con for i,con in enumerate(ipt)]))
import sys
input = sys.stdin.readline
n,m,p=map(int,input().split())
edge = [[] for i in range(m)]
for i in range(m):
  a,b,c=map(int,input().split())
  edge[i]=[a-1,b-1,-c+p]
d=[float("inf")]*n
d[0]=0
for i in range(n):
  e0,e1,e2=edge[i]
  if d[e0]!=float("inf") and d[e1]>d[e0]+e2:
    d[e1]=d[e0]+e2
ans1=d[-1]
for i in range(n):
  e0,e1,e2=edge[i]
  if d[e0]!=float("inf") and d[e1]>d[e0]+e2:
    d[e1]=d[e0]+e2
ans2=d[-1]
print(-1 if ans1!=ans2 else max(0,-ans2))

### FIXED CODE ###

import sys
input = sys.stdin.readline
n,m,p=map(int,input().split())
edge = [[] for i in range(m)]
for i in range(m):
  a,b,c=map(int,input().split())
  edge[i]=[a-1,b-1,-c+p]
d=[float("inf")]*n
d[0]=0

for _ in range(n):
  for i in range(m):
    e0,e1,e2=edge[i]
    d[e1]=min(d[e1],d[e0]+e2)
ans1=d[-1]
for _ in range(n):
  for i in range(m):
    e0,e1,e2=edge[i]
    if d[e1]>d[e0]+e2:
      d[e1]=-float("inf")
ans2=d[-1]
print(-1 if ans1!=ans2 else max(0,-ans1))
n, m = map(int,input().split())
hole = [int(input()) for _ in range(m)]
k = 0
a, b = 0, 0
x = (10 ** 9 + 7)
for i in range(n):
    if i + 1 == hole[k]:
        a, b = 0, a
    else:
        if i == 0:
            a = 1
        elif i == 1:
            a, b = (a + 1) % x, a % x
        else:
            a, b = (a + b) % x, a % x
    if i + 1 >= hole[k] and k < m - 1:
        k += 1

    
print(a)

### FIXED CODE ###

n, m = map(int,input().split())
hole = [int(input()) for _ in range(m)]
k = 0
a, b = 0, 0
x = (10 ** 9 + 7)
for i in range(n):
    if m >= 1:
        if i + 1 == hole[k]:
            a, b = 0, a
        else:
            if i == 0:
                a = 1
            elif i == 1:
                a, b = (a + 1) % x, a % x
            else:
                a, b = (a + b) % x, a % x
        if i + 1 >= hole[k] and k < m - 1:
            k += 1
    else:
        if i == 0:
                a = 1
        elif i == 1:
            a, b = (a + 1) % x, a % x
        else:
            a, b = (a + b) % x, a % x
    
print(a)
A, B, C = sorted(map(int, input().split()))
print(10*c +a +b)

### FIXED CODE ###

A, B, C = sorted(map(int, input().split()))
print(10*C+B+A)
print('{}'.format(int(input())**2-int(input()))

### FIXED CODE ###

print('{}'.format(int(input())**2-int(input())))
= int(input())
if N // 2 == 0:
  ans = N / 2 - 1
else:
  ans = (N - 1) / 2
print(ans)

### FIXED CODE ###

N=int(input())
if N%2==0:
    print(N//2-1)
else:
    print((N+1)//2-1)
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for _ in range(n)]
def LIR(n):
    return [LI() for _ in range(n)]
def SR(n):
    return [S() for _ in range(n)]
def LSR(n):
    return [LS() for _ in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    a = LI()
    b = LI()
    cnt = defaultdict(lambda : 0)
    for i in a:
        cnt[i] += 1
    for i in b:
        if not cnt[i]:
            continue
        cnt[i] += 1
    for i in cnt.values():
        if i > n:
            print("No")
            return
    r = n-1
    while 1:
        if r < 0:
          r += n
        update = False
        for l in range(n):
            if a[l] == b[l]:
                update = True
                b[l],b[r] = b[r],b[l]
                r -= 1
        if not update:
            break
    print("Yes")
    print(*b)
    return

#Solve
if __name__ == "__main__":
    solve()


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for _ in range(n)]
def LIR(n):
    return [LI() for _ in range(n)]
def SR(n):
    return [S() for _ in range(n)]
def LSR(n):
    return [LS() for _ in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    x = I()
    print(1-x)
    return

#Solve
if __name__ == "__main__":
    solve()
N = int(input())
l = list(map(int,input().split() for i in range(N))
l = set(l)
print(len(l))

### FIXED CODE ###

N = int(input())
l = list(int(input()) for i in range(N))
a = set(l)
print(len(a))
n,m = map(int,input().split())
a = n
while a % m != 0:
    a += n
    if a >= 10 ** 10:
        print(-1)
        exit(0)
l = ['0'] * a
s = input()
t = input()
for i in range(n):
    l[a//n*i] = s[i]
for i in range(m):
    if l[a//m*i] != '0':
        if l[a//m*i] != t[i]:
            print(-1)
            exit(0)
    else:
        l[a//m*i] = t[i]
print(a)


### FIXED CODE ###

from math import gcd
n,m = map(int,input().split())
z = n * m // gcd(n,m)
s = input()
t = input()
n = z // n
m = z // m
x = 0
y = 0
i = 0
j = 0
while x < z and y < z:
    if x > y:
        y += m
        j += 1
    elif x < y:
        x += n
        i += 1
    else:
        if s[i] != t[j]:
            print(-1)
            exit(0)
        x += n
        y += m
        i += 1
        j += 1
print(z)