Harryxun/stf_run huggingface dataset:
def main():
    input_string = list(map(int,input().split()))
    N = input_string[0]
    C = input_string[1]
    data = []
    max_time = 0
    for i in range(N):
        data.append(list(map(int,input().split())))
        max_num = max(data[i])
        if max_num>max_time:
            max_time=max_num

    #data_np = np.array(data).reshape(N,3)
    #data_np = np.array(data)

    #max_time = int(max(data))
    #print("max",max_time)
    schedule = [[0]*C for i in range(max_time)]
    #schedule = np.zeros([max_time,C])

    for i in range(N):
        start = data[i][0]-1
        end = data[i][1]-1
        channel = data[i][2]-1
        for j in range(end-start+1):
            if start+j-1<0:continue
            schedule[start+j-1][channel] = 1

#    for c in range(C):
#        for t in range(max_time):
#            if t==0:continue
#            if schedule[t][c]==1 and schedule[t-1][c]==0:
#                schedule[t-1][c]=1

    #max_N =0
    #for t in range(max_time):
    #    sum_of_ch = sum(schedule[t])

    temp = list(map(sum,list(schedule)))
    max_N = int(max(temp))


    #    if sum_of_ch>max_N:
    #        max_N = int(sum_of_ch)
    print(max_N)







main()


### FIXED CODE ###

def main():
    input_string = list(map(int,input().split()))
    N = input_string[0]
    A = input_string[1]
    B = input_string[2]

    price1 = A*N
    price2 = B

    print(min(price1,price2))

main()
import sys
input = sys.stdin.readline
import numpy as np

n,u,v = ( int(x) for x in input().split() )

u,v = u-1,v-1

a = [[] for i in range(n)]
b = [[] for i in range(n)]

for i in range(n-1):
	# 配列indexは0開始だからinputは-1
	l,m = ( int(x)-1 for x in input().split() )
	a[l].append(m)
	a[m].append(l)

def distance(cr,p,dist): # cr:current node, p:pathed or not, dist:out;each distance
	for i in a[cr]: #a[cr]から行ける各頂点へ
		p[cr] = 1
		if p[i] == 0: #まだ通っていなかったら
			p[i] = 1
			dist[i] = dist[cr]+1
			distance(i,p,dist)

p = [0]*(n)
dist_v = [0]*(n)
distance(v,p,dist_v)
p = [0]*(n)
dist_u = [0]*(n)
distance(u,p,dist_u)

for i in range(n):
	if dist_u[i] >= dist_v[i]:
		dist_u[i] = -1

tmp = max(dist_u)
max_idx = dist_u.index(tmp)

print(dist_v[max_idx] - 1)

### FIXED CODE ###

import sys
input = sys.stdin.readline

# 再帰上限を引き上げる
sys.setrecursionlimit(10**6)

# G:graph, cr:current node, seen:is seen?, dist:out;each distance
def dfs(G,cr,seen,dist):
	seen[cr] = 1
	for i in G[cr]: #G[cr]から行ける各頂点へ
		if seen[i] == 0: #まだ通っていなかったら
			dist[i] = dist[cr]+1
			dfs(G,i,seen,dist)


n,u,v = (int(x) for x in input().split())

u,v = u-1,v-1

a = [[] for i in range(n)]

for i in range(n-1):
	# 配列indexは0開始だからinputは-1
	l,m = (int(x)-1 for x in input().split())
	a[l].append(m)
	a[m].append(l)

# v視点のdistを調べる
dist_u = [0]*n
dist_v = [0]*n

dfs(a,u,[0]*n,dist_u)
# u視点のdistを調べる
dfs(a,v,[0]*n,dist_v)

for i in range(n):
	if dist_u[i] >= dist_v[i]: # vが追いつける距離なら
		dist_v[i] = -1

print(max(dist_v) - 1)
N = int(input())
a_list = list(map(int, input().split()))

two_count = 0
two_sum = 0
four_count = 0
result = 'No'

for i in a_list:
    if i % 2 == 0:
        two_count += 1
        if i % 4 == 0:
            four_count += 1

if two_count * 2 + 1 >= N:
    if (N - two_count) == 1:
        if four_count == 1:
            result = 'Yes'
    else:
        if (N - two_count) - 1<= four_count:
            result = 'Yes'

print(result)


### FIXED CODE ###

n ,m = [int(i) for i in input().split()]
print((n - 1) * (m - 1))
# Aizu Problem 00127: Pocket Pager Input
#
import sys, math, os, copy

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


code = {1: "afkpuz", 2: "ablqv.", 3: "chmrw?", 4: "dinsx!", 5: "ejoty "}

def pocket_pager(string):
    if len(string) % 2 == 1:
        return "NA"
    res = ""
    for k in range(len(string) // 2):
        i = int(string[2*k])
        j = int(string[2*k+1])
        res += code[j][i-1]
    return res


for line in sys.stdin:
    print(pocket_pager(line.strip()))

### FIXED CODE ###

# Aizu Problem 00127: Pocket Pager Input
#
import sys, math, os, copy

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


code = {1: "afkpuz", 2: "bglqv.", 3: "chmrw?", 4: "dinsx!", 5: "ejoty "}

def pocket_pager(string):
    if len(string) % 2 == 1:
        return "NA"
    res = ""
    for k in range(len(string) // 2):
        i = int(string[2*k])
        j = int(string[2*k+1])
        if not 1 <= i <= 6 or not 1 <= j <= 5:
            return "NA"
        res += code[j][i-1]
    return res


for line in sys.stdin:
    print(pocket_pager(line.strip()))
N=int(input())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))

def mul(n):
  s=1
  for t in range(n):
    s=s*t
  return s

def f(x):
  result=0
  M=len(x)
  for i in range (x):
    k=0
    for j in range(i,M):
      if x[i]>x[j]:
        k=k+1
    result=result+k*mul(M-i-1)
  return result

print(f(P)-f(Q))

### FIXED CODE ###

def mul(n):
  s=1
  for t in range(1,n+1):
    s=s*t
  return s

def f(x):
  result=0
  N=len(x)
  for i in range (N):
    k=0
    for j in range(i,N):
      if x[i]>x[j]:
        k=k+1
    result=result+k*mul(N-i-1)
  return result

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

print(abs(f(P)-f(Q)))
v = []
v = input().split()

print(v[2])

### FIXED CODE ###

cnt = int(input())
dif_max = -1000000000
v_min = 1000000000

for i in range(cnt):
    buf = int(input())
    if i > 0:
        dif_max = dif_max if buf - v_min < dif_max else buf - v_min
    v_min = buf if buf < v_min else v_min
print(dif_max)
def pf(N):
    A = []
    while N % 2 == 0:
        A.append(2)
        N //= 2
    f = 3
    while f * f <= N:
        if N % f == 0:
            A.append(f)
            N //= f
        else:
            f += 2
    if N != 1:
        A.append(N)
    return A

n = int(input())
a = list(map(int, input().split()))
b = [0]*1001
for i in range(n):
    x = pf(a[i])
    x = list(set(x))
    for j in x:
        b[j] += 1
#print(b)
tnp = 0
for i in range(1001):
    if (b[i]>1):
        tnp += 1
        break
if (tnp==0):
    print("pairwise coprime")
    exit()
        
for i in range(1001):
    if (b[i]==n):
        print("not coprime")
        exit()
print("setwise coprime")

### FIXED CODE ###

def pf(N):
    A = []
    while N % 2 == 0:
        A.append(2)
        N //= 2
    f = 3
    while f * f <= N:
        if N % f == 0:
            A.append(f)
            N //= f
        else:
            f += 2
    if N != 1:
        A.append(N)
    return A

n = int(input())
a = list(map(int, input().split()))
b = [0]*1000001
for i in range(n):
    x = pf(a[i])
    x = list(set(x))
    for j in x:
        b[j] += 1
#print(b)
tnp = 0
for i in range(1000001):
    if (b[i]>1):
        tnp += 1
        break
if (tnp==0):
    print("pairwise coprime")
    exit()
        
for i in range(1000001):
    if (b[i]==n):
        print("not coprime")
        exit()
print("setwise coprime")
import numpy as np

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

na = np.matrix(a)

mat = np.bitwise_xor(na.T,na)

print(((mat.sum())//2)%(10**9+7))

### FIXED CODE ###

import math
import  numpy as np

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

ans = 0
a_max = max(a)

if a_max==0:alog=1
else:alog = int(math.log2(a_max))+1

for i in range(alog):
    p = pow(2, i)
    cnt = np.count_nonzero((a >> i)& 1 == 1)
    
    ans += cnt * (N - cnt)*(2**i)
print(ans%(10**9+7))
N = int(input())
count = [0]*N
for i in range(N):
	x, y = [int(x) for x in input().split()]
    count[x] += 1
    count[y] += 1
for c in N:
    print(c)

### FIXED CODE ###

N, M = [int(x) for x in input().split()]
count = [0]*N
for i in range(M):
	x, y = [int(x) for x in input().split()]
	count[x-1] += 1
	count[y-1] += 1
for c in count:
	print(c)
# coding: utf-8
# Here your code !
a=input()
a=[2,3]
b=a.split(",")
A=b[0]
B=b[1]

C=A+B
if C%3==0:
    print("Possible")
else:
    print("Impossible")

### FIXED CODE ###

# coding: utf-8
# Here your code !
a=input()
b=a.split(" ")
A=int(b[0])
B=int(b[1])

C=A+B
if C%3==0 or A%3==0 or B%3==0:
    print("Possible")
else:
    print("Impossible")
A, B = input().split()
ans = A * B
print(format(ans, '.0f'))

### FIXED CODE ###

def resolve():
    A, B = input().split()
    ans = int(A)*int(B[0])*100+int(A)*int(B[2:])
    print(str(ans)[:-2] if len(str(ans)) >= 3 else "0")
resolve()
num_of_pro = raw_input()
problems = raw_input()
num_of_drinks = raw_input()
drinks_lines = []
count = 0
while count < int(num_of_drinks):
count += 1
each_line = raw_input()
drinks_lines.append(each_line)
for each_line in drinks_lines:
problem_num = [int(each_num) for each_num in problems.split()]
problem_num[int(each_line.split()[0]) -1] = int(each_line.split()[1])
print sum(problem_num)

### FIXED CODE ###

#!/usr/bin/env python
num_of_pro = raw_input()
problems = raw_input()
num_of_drinks = raw_input()
drinks_lines = []
count = 0 
while count < int(num_of_drinks):
	count += 1
	each_line = raw_input()
	drinks_lines.append(each_line)
for each_line in drinks_lines:
	problem_num = [int(each_num) for each_num in problems.split()]
	problem_num[int(each_line.split()[0]) -1] = int(each_line.split()[1])
	print sum(problem_num)
from bisect import bisect_left
from bisect import bisect_right

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

a_count = [0]*100010
a_sum = [0]*100010

for i in range(n):
    a_count[a[i]] += 1
    a_sum[a[i]] += a[i]

for i in range(100005,-1,-1):
    a_count[i] += a_count[i+1]
    a_sum[i] += a_sum[i+1]

def chk(x):
    case = 0
    for i in range(n):
        if 0<= x-a[i]:
            case += a_count[x-a[i]]
        else:
            case += n
    if case >= m:
        ch = True
    else:
        ch = False
    return ch

l = 2*a[-1]+1    #NG
r = 1 #OK

while abs(r-l) > 1:
    kk = (r+l)//2
    if chk(kk):
        r = kk
    else:
        l = kk

ans = 0
sm = sum(a)

l = r

case = 0
for i in range(n):
    num = n-bisect_right(a,l-a[i]-1)
    case += num
    ans += num*a[i]*2

ans -= (case-m)*l

print(ans)

### FIXED CODE ###

from bisect import bisect_left
from bisect import bisect_right

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

a_count = [0]*110000
a_sum = [0]*110000

for i in range(n):
    a_count[a[i]] += 1
    a_sum[a[i]] += a[i]

for i in range(100005,0,-1):
    a_count[i] += a_count[i+1]
    a_sum[i] += a_sum[i+1]

def chk(x):
    case = 0
    for i in range(n):
        case += n-bisect_right(a,x-a[i]-1)
    if case >= m:
        ch = True
    else:
        ch = False
    return ch


l = 2*a[-1]+1    #NG
r = 1 #OK

while abs(r-l) > 1:
    kk = (r+l)//2
    if chk(kk):
        r = kk
    else:
        l = kk

ans = 0
sm = sum(a)

l = r

case = 0
for i in range(n):
    num = n-bisect_right(a,l-a[i]-1)
    case += num
    ans += num*a[i]*2

ans -= (case-m)*l

print(ans)
from fractions import Fraction
from collections import defaultdict

N = int(input())
AB = [tuple(map(int, input().split())) for _ in range(N)]
MOD = 10**9 + 7

d = defaultdict(int)
cnt_0 = 0
for a,b in AB:
    if a == b == 0:
        cnt_0 += 1
    else:
        d[Fraction(a,b)] += 1


ans = 1
ks = list(d.keys())
for k in ks:
    if d[k] == 0:
        continue

    # 傾きkから一つ以上選んで -1/k の方からは選ばない + 傾き -1/k から一つ以上選んで k の方からは選ばない + どちらからも選ばない
    ans *= (((pow(2, d[k], MOD) - 1) + (pow(2, d[Fraction(-1, k)], MOD) - 1) + 1)% MOD)
    ans %= MOD
    d[k] = 0
    d[Fraction(-1, k)] = 0


print((ans + cnt_0 - 1) % MOD)

### FIXED CODE ###

from math import gcd
from collections import defaultdict

N = int(input())
AB = [tuple(map(int, input().split())) for _ in range(N)]
MOD = 10**9 + 7

d = defaultdict(int)
cnt_00 = 0
cnt_0b = 0
cnt_a0 = 0
for a,b in AB:
    if a == b == 0:
        cnt_00 += 1
    elif a == 0:
        cnt_a0 += 1
    elif b == 0:
        cnt_0b += 1
    else:
        num_gcd = gcd(a,b)
        grad = 1 if a * b > 0 else -1
        a //= num_gcd
        b //= num_gcd
        d[(grad, abs(a), abs(b))] += 1



ans = 1
for k in d.keys():
    if d[k] == 0:
        continue
    
    grad, a, b = k[0], k[1], k[2]
    if (-grad, b, a) in d:
        
        # 傾き a/bのものを一つ以上選ぶ場合（-b/aは選ばない） + -b/aから一つ以上選ぶ場合（a/bは選ばない） + どちらからも選ばない場合
        ans *= (pow(2, d[(grad, a, b)], MOD)-1) + (pow(2, d[(-grad, b, a)], MOD)-1) + 1
        ans %= MOD
        d[(grad, a, b)] = 0
        d[(-grad, b, a)] = 0
    else:
        # a/bから0個以上選ぶ場合
        ans *= pow(2, d[(grad, a, b)], MOD)
        ans %= MOD
        d[(grad, a, b)] = 0

# a,bの一方のみ0の場合 + どちらからも選ばない場合
ans *= (pow(2, cnt_a0, MOD)-1) + (pow(2, cnt_0b, MOD)-1) + 1
ans %= MOD

# 0,0のみを１つだけ入れる場合
ans += cnt_00
# なにも選ばない場合を除く
ans -= 1

ans %= MOD

print(ans)
sankaNum, scoreMax, ansCnt = map(int, input().split())

score = []

for i in range(sankaNum):
    score.append(scoreMax)

for n in range(ansCnt):
    ansSanka = input()

    for k in range(sankaNum):
        if int(ansSanka) - 1 != k:
            score[k] -=  1
    
for m in range(sankaNum):

    if score[m]  > 0:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

weather = input()

list = {'Sunny':'Cloudy', 'Cloudy':'Rainy', 'Rainy':'Sunny'}

print(list[weather])
a,b,c=map(int,input().split())
print(min(a%*b*c,b%*a*c,c%*a*b))

### FIXED CODE ###

A, B, C = map(int, input().split())
print(min(C%2*A*B, A%2*B*C, B%2*C*A))
n = int(input())
s = input()
count = 0
for i in range(len(list(s))-1):
  if s[i] == "A" and s[i+1] == "B" and s[i+2] =="C":
    count += 1
print(count)

### FIXED CODE ###

n = int(input())
s = input()
count = 0
for i in range(len(list(s))-2):
  if s[i] == "A" and s[i+1] == "B" and s[i+2] =="C":
    count += 1
print(count)
s = input()

if((s[3]==s[4]) and (s[5]==s[6])):
  	print("yes")
else:
	print("no")


### FIXED CODE ###

s = input()

if((s[2]==s[3]) and (s[4]==s[5])):
  	print("Yes")
else:
	print("No")
from collections import deque
n=int(input())
a=list(map(int,input().split()))
A=[a[0]+a[0]<a[1]-a[0]>a[1]]+a+[a[-1]+a[-1]<a[-2]-a[-1]>a[-2]]
valley=0
peak=1
dp=deque()
for i in range(1,n+1):
  if A[i-1]<A[i]>A[i+1]:
    dp.append((i-1,peak))
  elif A[i-1]>A[i]<A[i+1]:
    dp.append((i-1,valley))
l,lf=dp.popleft()
r,rf=dp.popleft()
if lf == peak:
  ans=a[0]
else:
  ans=a[0]*(r+1)
print(ans)
for i in range(1,n-1):
  if r == i:
    t,tf=r,rf
    r,rf=dp.popleft()
    if tf == valley:
      ans+=a[i]*(i-l+1)*(r-i+1)
    else:
      ans+=a[i]
    l,lf=t,tf
  else:
    if lf == valley:
      ans+=a[i]*(r-i+1)
    else:
      ans+=a[i]*(i-l+1)
if rf == valley:
  ans+=a[-1]*(n-l)
else:
  ans+=a[-1]
print(ans)


### FIXED CODE ###

class BinaryIndexedTree:
    # http://hos.ac/slides/20140319_bit.pdf
    def __init__(self, size):
        """
        :param int size:
        """
        self.bit = [0 for _ in range(size)]
        self.size = size

    def add(self, i, w):
        """
        i番目にwを加える
        :param int i:
        :param int w:
        :return:
        """
        x = i + 1
        while x <= self.size:
            self.bit[x - 1] += w
            x += x & -x
        return

    def sum(self, i):
        """
        [0,i]の合計
        :param int i:
        :return:
        """
        res = 0
        x = i + 1
        while x > 0:
            res += self.bit[x - 1]
            x -= x & -x
        return res

    def search(self, x):
        """
        二分探索。和がx以上となる最小のインデックス(>= 1)を返す
        :param int x:
        :return :
        """
        i = 0
        s = 0
        step = 1 << self.size.bit_length()
        while step:
            if i + step <= self.size and s + self.bit[i + step - 1] < x:
                print(self.bit[i + step - 1], i, step)
                i += step
                s += self.bit[i - 1]
            step >>= 1
        return i

    def __len__(self):
        return self.size
from collections import defaultdict
n=int(input())
a=list(map(int,input().split()))
d=defaultdict(int)
for i in range(n):
  d[a[i]]=i+1
Bit = BinaryIndexedTree(n+1)
ans=0
for i in range(n):
  j=i+1
  i=d[j]
  x=Bit.sum(i)
  ok=i
  ng=-1
  while ok - ng > 1:
    mid=(ok+ng)//2
    if Bit.sum(mid)==x:
      ok=mid
    else:
      ng=mid
  l=ok+1
  ok=i
  ng=n+1
  while ng - ok > 1:
    mid=(ok+ng)//2
    if Bit.sum(mid)==x:
      ok=mid
    else:
      ng=mid
  r=ok
  ans+=j*(i-l+1)*(r-i+1)
  Bit.add(i,1)
print(ans)
S = input()
W = input()

if S > W:
  print('safe')
else:
  print('unsafe')

### FIXED CODE ###

S, W = input().split()

S = int(S)
W = int(W)

if S <= W:
    print('unsafe')
else:
    print('safe')
n=eval(input())
if n<1200:
	print("ABC")
elif n>=1200 and n<2800:
	print("ARC")
else:
    peint("AGC")

### FIXED CODE ###

n=eval(input())
if n<1200:
	print("ABC")
elif n>=1200 and n<2800:
	print("ARC")
else:
    print("AGC")
A=input()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)
if a<c:
    max=c
else:
    max=a
if b>d:
    min=d;
else:
    min=b
if (min-max)>0:
    print(min-max)
    print('\n')
else:
    print('0\n')
quit()


### FIXED CODE ###



a,b,c,d=[int(i) for i in input().strip().split(' ')]

'''
入力は他の人のを見た
'''

max=0
min=0

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
else :
    print(0)
from collections import defaultdict
N = int(input())
btn = [int(input()) for _ in range(N)]
i, ans = 0, 0
checked = defaultdict(int)
while 1:
  next = btn[i]
  ans += 1
  if next == 2:
    print(ans)
  	break
  if checked[next] == 1:
    print(-1)
    break
  i = next
  checked[i] = 1

### FIXED CODE ###

from collections import defaultdict
N = int(input())
btn = [0] + [int(input()) for _ in range(N)]
i, ans = 1, 0
checked = defaultdict(int)
while 1:
  next = btn[i]
  ans += 1
  if next == 2:
    print(ans)
    break
  if checked[next] == 1:
    print(-1)
    break
  i = next
  checked[i] = 1
d={}
d[a]=list(input())
d[b]=list(input())
d[c]=list(input())
now='a'
while True:
  if d[now]>1:
    now=d[now].pop(0)
  else:
    print(upper(now))
    exit()

### FIXED CODE ###

d={}
d['a']=list(input())
d['b']=list(input())
d['c']=list(input())
now='a'
while True:
  if len(d[now])>0:
    now=d[now].pop(0)
  else:
    print(now.upper())
    exit()
import copy
 
INF = 10000000000
def merge(A, left, mid, right):
    count = 0
    L = A[left:mid] + [(INF,INF)]
    R = A[mid:right] + [(INF,INF)]
     
    i, j = 0, 0
    for k in range(left, right):
        count = count + 1
        if L[i][1] <= R[j][1]:
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1
    return count
 
def mergeSort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        countL = mergeSort(A, left, mid)
        countR = mergeSort(A, mid, right)
        return merge(A, left, mid, right) + countL + countR
    return 0
def partition(a,p,r):
    x=a[r][1]
    i=p-1
    for j in range(p,r):
        if a[j][1]<=x:
            i+=1
            a[i],a[j]=a[j],a[i]
    a[i+1],a[r]=a[r],a[i+1]
    return i+1
def quickSort(a,p,r):
    if p<r:
        q=partition(a,p,r)
        quicksort(a,p,q-1)
        quicksort(a,q+1,r)
n = int(input())
A = [None for i in range(n)]
for i in range(n):
    a, b = input().split()
    A[i] = (a, int(b))

B = copy.deepcopy(A)
quickSort(A, 0, n-1)
mergeSort(B, 0, n)
if A == B:
    print("Stable")
else:
    print("Not stable")
 
ans = [str(x[0]) +" "+str(x[1]) for x in A]
ans = '\n'.join(ans)
print(ans)


### FIXED CODE ###

import copy
 
INF = 10000000000
def merge(A, left, mid, right):
    count = 0
    L = A[left:mid] + [(INF,INF)]
    R = A[mid:right] + [(INF,INF)]
     
    i, j = 0, 0
    for k in range(left, right):
        count = count + 1
        if L[i][1] <= R[j][1]:
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1
    return count
 
def mergeSort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        countL = mergeSort(A, left, mid)
        countR = mergeSort(A, mid, right)
        return merge(A, left, mid, right) + countL + countR
    return 0
def partition(a,p,r):
    x=a[r][1]
    i=p-1
    for j in range(p,r):
        if a[j][1]<=x:
            i+=1
            a[i],a[j]=a[j],a[i]
    a[i+1],a[r]=a[r],a[i+1]
    return i+1
def quickSort(a,p,r):
    if p<r:
        q=partition(a,p,r)
        quickSort(a,p,q-1)
        quickSort(a,q+1,r)
n = int(input())
A = [None for i in range(n)]
for i in range(n):
    a, b = input().split()
    A[i] = (a, int(b))

B = copy.deepcopy(A)
quickSort(A, 0, n-1)
mergeSort(B, 0, n)
if A == B:
    print("Stable")
else:
    print("Not stable")
ans = [str(x[0]) +" "+str(x[1]) for x in A]
ans = '\n'.join(ans)
print(ans)
L,R = map(int,input().split())
def judge_distance(i,j):
    if j-i >= 2019:
        return True

def search_2019(i,j):
    for p in range(j-i+1):
        if i+p % 2019 == 0:
            return True

if judge_distance(L,R) or search_2019(L,R):
    print(0)
else:
    mincount = float("inf")
    for i in range(L,R):
        for j in range(L+1,R+1):
            if i*j%2019 <= mincount:
                mincount = (i*j)%2019

print(mincount)

### FIXED CODE ###

L,R = map(int,input().split())
def judge_distance(i,j):
    if j-i >= 2019:
        return True

def search_2019(i,j):
    res = False
    for p in range(j-i+1):
        if i+p % 2019 == 0:
            res = True
            exit()

if judge_distance(L,R) or search_2019(L,R):
    print(0)
else:
    mincount = float("inf")
    for i in range(L,R):
        for j in range(L+1,R+1):
            if i*j%2019 <= mincount:
                mincount = (i*j)%2019

    print(mincount)
def xor_operate(a_list):
    result = 0
    for a in a_list:
        result ^= int(a)
    return str(result)



if __name__ == "__main__":
    N = input()
    a_list = input()

    a_list = a_list.split(" ")

    i_list = []
    for i in range(len(a_list)):
        r_list = a_list[:i]+a_list[i+1:]
        i_list.append(xor_operate(r_list))
    return " ".join(i_list)
    


        



### FIXED CODE ###

def xor_operate(a_list):
    result = 0
    for a in a_list:
        result ^= int(a)
    return result



if __name__ == "__main__":
    N = input()
    a_list = input()

    a_list = a_list.split(" ")

    bit_value = xor_operate(a_list)

    i_list = []
    for a in a_list:
        i_list.append(str(bit_value ^ int(a)))
    print(" ".join(i_list))
import math
def j(n):
    return math.factorial(n) // (2*math.factorial(n-2))
n,m = map(int,raw_input().split())
if n == 1 and m == 1: 
    print 0
else:
    print j(n)+j(m)

### FIXED CODE ###

import math
def j(n):
    return math.factorial(n) // (2*math.factorial(n-2))
n,m = map(int,raw_input().split())
if (n == 1 and m == 1)or(n == 0 and m == 0): 
    print 0
elif n == 1 or n == 0:
    print j(m)
elif m == 1 or m == 0:
    print j(n)
else:
    print j(n)+j(m)
mod = 1000000007

n = int(input())
factorial_previous = 1

for i in range(2,n+1):
    factorial = (i*factorial_previous)%mod
    factorial_previous = factorial
print(factorial)


### FIXED CODE ###

mod = 1000000007

n = int(input())
factorial_previous = 1

for i in range(1,n+1):
    factorial = (i*factorial_previous)%mod
    factorial_previous = factorial
print(factorial)
N = int(input())
T,A = [int(i) for i in input().split()]
Hi = [int(i) for i in input().split()]
Ave = [T - i*0.006 for i in Hi]
Result = [abs(i) for i in Ave - A]
print(index(min(result)) + 1)

### FIXED CODE ###

N = int(input())
T,A = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]
sub = [0 for i in range(N)]
for i in range(N):
    sub[i] = abs(A - (T - 0.006*H[i]))
print(sub.index(min(sub))+1)
ipt = input().split()

a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
i=int(ipt[0])
j=int(ipt[1])
if i==j:
    print('Yes')
elif i in and j in a:
    print('Yes')
elif i in b and j in b:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

ipt = input().split()

a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
i=int(ipt[0])
j=int(ipt[1])
if i==j:
    print('Yes')
elif i in a and j in a:
    print('Yes')
elif i in b and j in b:
    print('Yes')
else:
    print('No')