Harryxun/stf_run huggingface dataset:
import sys
input = sys.stdin.readline
def main():
    n,m = map(int,input().split())
    ans = []
    if m%2:
        l = 1
        r = m
        while l+1<r:
            ans.append(l,r)
            l += 1;r-=1
        l = r
        r = 2*m+1
        while l<r:
            ans.append([l,r])
            l+=1;r-=1
    else:
        l = 1
        r = m+1
        while l+1<r:
            ans.append(l,r)
            l += 1;r-=1
        l = r
        r = 2*m+1
        while l<r:
            ans.append([l,r])
            l+=1;r-=1
    
    for a in ans:
        print(*a)


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
def main():
    n,m = map(int,input().split())
    ans = []
    r = 2*m+1
    if m%2:
        for i in range(1,m//2+1):
            ans.append([i,m+1-i])
        for i in range(m+1,(m+1+r)//2+1):
            ans.append([i,m+1+r-i])
    else:
        for i in range(1,m//2+1):
            ans.append([i,m+1-i])
        for i in range(m+1,(m+1+r)//2):
            ans.append([i,m+1+r-i])            
    for a in ans:
        print(*a)


if __name__ == "__main__":
    main()
h = list(input())
w = list(input())
n = list(input())

print(n//max(h,w))

### FIXED CODE ###

import math
h = int(input())
w = int(input())
n = int(input())

print(math.ceil(n/max(h,w)))
n,k=map(int,input().split())
num=[]

for i in range(k):
  d=int(input())
  num+=list(map(int,input().split()))

Q=list( set (num))
print(n-len(Q))

### FIXED CODE ###

S=input()
if S=="ABC":
  print("ARC")
else:
  print("ABC")
n = input()
l = len(n)

for i in range(2**l):
    op=["-"]*l
    for j in range(l):
        if (i>>j)&1:
            op[l - j - 1] = "+" #なぜ i - j - 1 ではなく、l - j - 1なのか、決まっている数から引いたものが知りたい
    formula = ""
    for op1,op2 in zip(n,op+[""]): #式の文字列を作るループ
        formula += op1 + op2
    if eval(formula)==7:
        print(formula + "=7")
        break

### FIXED CODE ###

def dfs(i, Str, res):
    if i==3:
        if res==7:
            print(Str+"=7")
            exit()
        return
    
    dfs(i+1,Str+"+"+s[i+1],res+int(s[i+1]))
    dfs(i+1,Str+"-"+s[i+1],res-int(s[i+1]))

s=input()
dfs(0,s[0],int(s[0]))
import sys
sys.setrecursionlimit(10**7)
N,M = map(int,input().split())
S = input()
src = [tuple(map(lambda x:int(x)-1,input().split())) for i in range(M)]

aa = [set() for i in range(N)]
bb = [set() for i in range(N)]
ab = [set() for i in range(N)]
ba = [set() for i in range(N)]

for x,y in src:
    if S[x] != S[y]:
        if S[x] == 'A':
            ab[x].add(y)
            ba[y].add(x)
        else:
            ba[x].add(y)
            ab[y].add(x)
    elif S[x] == 'A':
        aa[x].add(y)
        aa[y].add(x)
    else:
        bb[x].add(y)
        bb[y].add(x)


skip = [False] * N
def remove(i):
    if skip[i]: return
    if S[i] == 'A':
        if aa[i]: return
        for b in ab[i]:
            if i in ba[b]:
                ba[b].remove(i)
        for b in ab[i]:
            remove()
        ab[i] = set()
    else:
        if bb[i]: return
        for a in ba[i]:
            if i in ab[a]:
                ab[a].remove(i)
        for a in ba[i]:
            remove()
        ba[i] = set()
    skip[i] = True

for i in range(N):
    remove(i)


mem = [[None]*N for i in range(4)]
def rec(v, depth):
    if mem[depth][v] is not None:
        return mem[depth][v]
    ret = False
    if depth == 0:
        for to in ab[v]:
            if rec(to, depth+1):
                ret = True
                break
    elif depth == 1:
        for to in bb[v]:
            if rec(to, depth+1):
                ret = True
                break
    elif depth == 2:
        for to in ba[v]:
            if rec(to, depth+1):
                ret = True
                break
    else:
        for to in aa[v]:
            if ab[to]:
                ret = True
    mem[depth][v] = ret
    return ret

for i in range(N):
    if rec(i, 0):
        print('Yes')
        exit()

print('No')

### FIXED CODE ###

import sys,time
sys.setrecursionlimit(10**7)

start_time = time.time()
N,M = map(int,input().split())
S = input()
src = [tuple(map(lambda x:int(x)-1,sys.stdin.readline().split())) for i in range(M)]

outdeg = [set() for i in range(2*N)]
for x,y in src:
    if S[x] == S[y]:
        #A0->A1, B0->B1
        outdeg[x].add(y+N)
        outdeg[y].add(x+N)
    else:
        #A1->B0, B1->A0
        outdeg[x+N].add(y)
        outdeg[y+N].add(x)

mem = [0] * (2*N)
def visit(v):
    if time.time() - start_time > 1.8:
        # gori~~~
        print('No')
        exit()
    if mem[v] == 1:
        print('Yes')
        exit()
    if mem[v] == 0:
        mem[v] = 1
        for to in outdeg[v]:
            visit(to)
        mem[v] = 2

for i in range(2*N):
    visit(i)

print('No')
import sys
input=sys.stdin.readline
S = list(input())
if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")import sys

### FIXED CODE ###

import sys
input=sys.stdin.readline
S = list(input())
if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
BC = []

for i in range(M):
    b,c = map(int,input().split())
    BC.append((b,c))

BC.sort(key=lambda x:x[1],reverse=True)

ind = 0
for b,c in BC:
    for i in range(b):
        if A[ind]>=c or ind==N:
            print(sum(A))
            exit()
        elif ind<N:
            A[ind]=c
            ind+=1

print(sum(A))



### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
BC = []

for i in range(M):
    b,c = map(int,input().split())
    BC.append([b,c])

BC.sort(key=lambda x:x[1],reverse=True)

ind = 0
ans = 0
for b,c in BC:
    if c > A[min(ind+b,N-1)]:
        ans += c * min(b,N-ind)
        ind += b
    else:
        while c > A[ind]:
            ans += c
            ind += 1
    if ind >= N:
        print(ans)
        exit()
print(ans + sum(A[ind:]))
import sys
import time
import random
sys.setrecursionlimit(100000000)
N, A, B = map(int, input().split())
sTime = time.time()

P = [-1] * N
Q = [0] * (2**N)
X = [0] * (2**N)
X[0] = 1
X[1] = 1
Y = [1<<i for i in range(N)]
Z = [0]

def calc(k, l, M):
    aa = 0
    bb = 0
    done = [0] * N
    for i in range(M):
        # print("M, i, k,aa,Y=", M, i, k, aa, Y)
        while k & Y[aa] == 0:
            aa += 1
        while l & Y[bb] == 0:
            bb += 1
        P[aa] = bb
        done[bb] = 1
        aa += 1
        bb += 1
    j = 0
    # print(P)
    # print(done)
    for i in range(N):
        if P[i] >= 0:
            continue
        while done[j] == 1:
            j += 1
        P[i] = j
        j += 1

def change(n):
    ret = 0
    for i in range(N):
        if n & (1<<i):
            ret += 1<<P[i]
    return ret

def dc(n):
    return sum(map(int, list(bin(n)[2:])))


def dfs(n, c):
    if time.time() - sTime > 1.75:
        return -1
    for i in range(N):
        m = n ^ Y[i]
        # print(n, i, m, c)
        if c == 2**N - 2 and m == 1:
            X[m] = 1
            Z.append(m)
            return 1
        if X[m] == 0 and m != 1:
            X[m] = 1
            Z.append(m)
            # print(Z)
            r = dfs(m, c+1)
            if r:
                return r
            if r < 0:
                return -1
            X[m] = 0
            Z.pop()
    return 0

if (dc(A) + dc(B)) % 2 == 0:
    print("NO")
else:
    r = dfs(0, 0)
    for i in range(2**N):
        if Z[i] == A:
            Z = Z[i:] + Z[:i]
            break
    # print(X, Y, Z)
    if r < 0:
        print("NO")
    else:
        # print("A", Z[:10], Z[-10:])
        mi = 99999
        while mi > 0:
            # for i in range(3, 2**N-1, 2):
            i = random.randrange(max(2**N-1001, 1),2**N-1,2)
            if Z[i-1]^Z[-1] in Y:
                Z = Z[:i] + Z[i:][::-1]
                mi = abs(dc(Z[-1]) - dc(B))
        # print("A", Z[:10], Z[-10:])
        # print("(Z[-1], B, dc(B))", Z[-1], B, dc(B))
        calc(Z[-1], B, dc(B))
        # print("P=", P)
        for i in range(N):
            s = 1<<P[i]
            t = 1<<i
            for j in range(2**N):
                if j & t:
                    Q[j] += s
        Z = [Q[z] for z in Z]
        # print(Z[:10], Z[-10:])
        print("YES")
        print(*Z)
            
        

### FIXED CODE ###

def dc(n):
    return sum(map(int, list(bin(n)[2:])))
def calc(a, b, X):
    if len(X) == 1:
        return [a, b]
    i = 0
    while i not in X or (a & (1<<i)) == (b & (1<<i)):
        i += 1
    j = X[1] if i == X[0] else X[0]
    Y = [x for x in X if x != i]
    return calc(a, a ^ (1<<j), Y) + calc(a ^ (1<<j) ^ (1<<i), b, Y)

N, A, B = map(int, input().split())
if dc(A^B) % 2 == 0:
    print("NO")
else:
    print("YES")
    print(*calc(A, B, list(range(N))))
N = int(input())
List = [list(map(int, input().split())) for _ in range(N)]

import itertools

arr = list(itertools.combinations(List, 2))
vec = []

for i in range(len(arr)):
    vec.append([arr[i][1][0]-arr[i][0][0], arr[i][1][1]-arr[i][0][1]])

counter = collections.Counter(map(tuple, vec))
num = counter.most_common(1)[0][1]

print(N-num)

### FIXED CODE ###

N = int(input())
List = [list(map(int, input().split())) for _ in range(N)]

import itertools
import collections

if N==1:
    print(1)
    
else:
    arr = list(itertools.combinations(List, 2))
    vec1 = []
    vec2 = []
    for i in range(len(arr)):
        vec1.append([arr[i][1][0]-arr[i][0][0], arr[i][1][1]-arr[i][0][1]])
        vec2.append([arr[i][0][0]-arr[i][1][0], arr[i][0][1]-arr[i][1][1]])
        
    vec = vec1+vec2
    counter = collections.Counter(map(tuple, vec))
    
    v =  counter.most_common(1)[0][0]
    num = counter.most_common(1)[0][1]
    
    print(N-num)
A, B = map(int, input().split())
if a % 3 or b % 3 or (A+B) % 3 == 0:
    print("Possible")
else:
    print("Impossible")

### FIXED CODE ###

A, B = map(int, input().split())
if A % 3 == 0 or B % 3 == 0 or (A+B) % 3 == 0:
    print("Possible")
else:
    print("Impossible")
s=sorted(input())
t=sorted(input(),reverse=True)
if s==t:
	print("No")
    exit()
a=sorted([s,t])
if a[0]==s:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

s=sorted(input())
t=sorted(input(),reverse=True)
a=sorted([s,t])
if s==t:
    print("No")
    exit()
if a[0]==s:
    print("Yes")
else:
    print("No")
A,B = list(map(int,input().split()))
list_ans = []
for i in range():
  if i%A == 0 and i%B == 0:
    ans = i
  else:
    i += 0
print(ans)

### FIXED CODE ###

from fractions import gcd
A,B = map(int,input().split())
lcm = A * B // gcd(A, B)
print(lcm)
import sys
from fractions import gcd

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

length = b - a + 1
lc = a % c
rc = b % c
ld = a % d
rd = b % d
lcm = lcm(c, d)

ans = length
if (b < c) and (b < d):
    print(ans)
    sys.exit()

if length == c:
    ans -= length//c
if length == d:
    ans -= lenght//d

if length > c:
    temp = length//c
    if lc + rc >= c:
        temp += 1
    ans -= temp

if length > d:
    temp = length//d
    if ld + rd >= d:
        temp += 1
    ans -= temp

if length < c and ((lc > rc) or lc == 0 or rc == 0):
    ans -= 1
if length < d and ((ld > rd) or ld == 0 or rd == 0):
    ans -= 1

i = 1
while i * lcm <= b:
    if a <= i * lcm <= b:
        ans += 1
    i += 1

print(ans)

### FIXED CODE ###

from sys import stdin
from fractions import gcd

def lcm(x, y):
    return (x * y) // gcd(x, y)

a, b, c, d = (int(x) for x in stdin.readline().rstrip().split())

lcm = lcm(c, d)

total = b - (a - 1)
mc = b // c - (a - 1) // c
md = b // d - (a - 1) // d
mlcm = b // lcm - (a - 1) // lcm

print(total - (mc + md - mlcm))
inr = lambda: list(map(int, input().split()))

N, Y = inr()

lmn = [[-1, -1, -1]]

for x in range(N+1):
    Y_rem = Y - x * 10000
    N_rem = N - x
    if Y_rem >= 0:
        for y in range(N_rem+1):
            Y_rem_2 = Y_rem - y * 5000
            z = N_rem - y
            if Y_rem_2 == z *1000:
                lmn.append([x, y, z])
print(lmn[1][0],lmn[1][1],lmn[1][2])

### FIXED CODE ###

inr = lambda: list(map(int, input().split()))

N, Y = inr()

lmn = [-1, -1, -1]

for x in range(N+1):
    for y in range(N-x+1):
        z = N - x - y
        oto_sum = 10000 * x + 5000 * y + 1000 * z
        if z >= 0 and oto_sum == Y:
            print(x, y, z)
            exit()

print(-1, -1, -1)
#

import sys
input=sys.stdin.readline

MOD=10**9+7
kl = [0]*(10**6+1)

            
def main():
    N=int(input())
    A=list(map(int,input().split()))
    if N==1:
        print(1)
        exit()
    for j in range(N):
        n=A[j]
        for i in range(2,int((n)**0.5)+1):
            if n%i==0:
                cnt=0
                while(n%i==0):
                    n/=i
                    cnt+=1
                if kl[i]<cnt:
                    kl[i]=cnt
        if n!=1:
            if kl[n]<1:
                kl[n]=1
                
    lcm=1
    for i in range(2,10**6+1):
        lcm*=pow(i, kl[i], MOD)

    modsum=0
    for i in range(N):
        modsum+=pow(A[i],MOD-2,MOD)

    ans = lcm*modsum%MOD
    print(ans)
    
    
    
if __name__=="__main__":
    main()


### FIXED CODE ###

#

import sys
input=sys.stdin.readline

MOD=10**9+7
kl = [0]*(10**6+1)

            
def main():
    N=int(input())
    A=list(map(int,input().split()))
    if N==1:
        print(1)
        exit()
    for j in range(N):
        n=A[j]
        for i in range(2,int((n)**0.5)+1):
            if n%i==0:
                cnt=0
                while(n%i==0):
                    n//=i
                    cnt+=1
                if kl[i]<cnt:
                    kl[i]=cnt
        if n!=1:
            if kl[n]<1:
                kl[n]=1
                
    lcm=1
    for i in range(2,10**6+1):
        lcm*=pow(i, kl[i], MOD)

    modsum=0
    for i in range(N):
        modsum+=pow(A[i],MOD-2,MOD)

    ans = lcm*modsum%MOD
    print(ans)
    
    
    
if __name__=="__main__":
    main()
num = x

x = int(input('高橋くんは何歳ですか？'))

if x = 3:
    print "YES"

elif x = 5:
    print "YES"

elif x = 7:
    print "YES"

else:
    print "NO"
    


### FIXED CODE ###

x = int(input())

if x == 3 or x == 5 or x == 7:
    print ("YES")

else:
    print ("NO")
r = input()
print(r*r)

### FIXED CODE ###

r = input()
r = int(r)
result = r**2
print(result)
if __name__ == "__main__":
    a, b, h, m = input().split()

    a = float(a)
    b = float(b)
    h = float(h)
    m = float(m)

    theta = 2.0 * math.pi * h / 12.0
    phi = 2.0 * math.pi * m / 60.0

    xa = a * math.sin(theta)
    ya = a * math.cos(theta)

    xb = b * math.sin(phi)
    yb = b * math.cos(phi)

    print(xa, ya)
    print(xb, yb)
    distance = math.sqrt(math.pow(xa-xb, 2) + math.pow(ya-yb, 2))

    print(distance)

### FIXED CODE ###

import math


if __name__ == "__main__":
    a, b, h, m = input().split()

    a = int(a)
    b = int(b)
    h = int(h)
    m = int(m)

    theta = 2.0 * math.pi * (h + m / 60.0) / 12.0
    phi = 2.0 * math.pi * m / 60.0

    xa = a * math.sin(theta)
    ya = a * math.cos(theta)

    xb = b * math.sin(phi)
    yb = b * math.cos(phi)

    distance = math.sqrt(math.pow(xa-xb, 2) + math.pow(ya-yb, 2))

    print(distance)
n, x, m = map(int, input().split())
count=x
now=x
flag=-1
sled=[now]
for i in range(1,n):
     now=(now*now)%m
     if now==0:
         flag=0
         break
     if now==1:
         flag==1
         nokori=n-i
         break
     if now in sled:
         start=sled.index(now)
         nokori=n-i
         flag=2
         break
     
     else:
         sled.append(now)
     count+=now
     #print(i,now,count)
sled=sled[start:]
if flag==1:
    count+=nokori
if flag==2:
    #print(count)
    roopnum=int(nokori/len(sled))
    amari=nokori%len(sled)
    
    one_roop=sum(sled)
    count+=one_roop*roopnum
    #print(count)
    for i in range(amari):
        count+=sled[i]
print(count)

### FIXED CODE ###

n, x, m = map(int, input().split())
count=x
now=x
flag=-1
sled=[now]
for i in range(1,n):
     now=(now*now)%m
     if now==0:
         flag=0
         break
     if now in sled:
         start=sled.index(now)
         nokori=n-i
         flag=2
         break
     
     else:
         sled.append(now)
     count+=now
     #print(i,now,count)

if flag==2:
    #print(count)
    sled=sled[start:]
    roopnum=int(nokori/len(sled))
    amari=nokori%len(sled)
    
    one_roop=sum(sled)
    count+=one_roop*roopnum
    #print(count)
    for i in range(amari):
        count+=sled[i]
print(count)
n = int(input())
data = list(map(int,input().split()))
data = sorted(data, reverse=True)
sum = 0
while data != []
    del data[0]
    del data[-1]
    sum += data[0]
    del data[0]
print(sum)

### FIXED CODE ###

n = int(input())
data = list(map(int,input().split()))
data = sorted(data, reverse=True)
sum = 0
for i in range(n):
    sum += data[1+2*i]
print(sum)
n,*a=map(int,open(0).read().split())
b=0
if a[0]>a[1]:
    b=-1
elif a[0]==a[1]:
    b=0
else:b=1
c=[[a[0]]]
for i in range(1,n):
    if (a[i]-a[i-1])*b>0:
        c[-1]+=[a[i]]
    else:
        if len(c[-1])==1 or b==0:
            c[-1]+=[a[i]]
        else:c+=[[a[i]]]  
    if a[i-1]>a[i]:
        b=-1
    elif a[i-1]==a[i]:
        b=0
    else:b=1
print(len(c))

### FIXED CODE ###

n,*a=map(int,open(0).read().split())
ans=1
vec=0
for i in range(n-1):
    now=a[i+1]-a[i]
    if vec*now<0:
        ans+=1
        vec=0
    elif vec==0:
        vec=now
print(ans)
import pandas as pd
import numpy as np

N = input()
N = int(N)
a_np = np.ones((N,1))
a_pd = pd.DataFrame(a_np,columns=['A'])
a_pd['B']=None
a_pd['C']=None
for i in range(0,N):
    S, P = map(str, input().split())
    P = int(P)
    a_pd.loc[i,:] = [i,S,P]
    #print(i,S,P)
b_pd = a_pd.sort_values(['B','C'],ascending=[True, False])
b_pd = b_pd.reset_index()
print(b_pd)
c = b_pd.loc[:,'A']
for j in range(0,N):
    print(int(c[j]+1))
    

### FIXED CODE ###

import numpy as np

N = input()
N = int(N)
a = []
for i in range(0,N):
    S, P = map(str,input().split())
    P = int(P)
    a.append([i,S,P])

b = sorted(a, key=lambda x:(x[1],-x[2]))
for j in range(0,N):
    print(b[j][0]+1)
from math import gcd

N, X = map(int, input().split())
xs = list(map(int, input().split()))
xs.append(X)
xs = sorted(xs)
m = 999999999999999999
diffs = []
for idx,e in enumerate(xs):
  if idx==0:
    continue
  diff = abs(e - xs[idx-1])
  diffs.append(diff)
diffs = sorted(diffs)
for idx,dif in enumerate(diffs):
  if idx == 0:
    continue
  if gcd(diffs[idx], diffs[idx-1]) < m:
    m = gcd(diffs[idx], diffs[idx-1])
if len(diffs) == 1:
  m = diffs[0]
print(m)


### FIXED CODE ###

from fractions import gcd

N, X = map(int, input().split())
xs = list(map(int, input().split()))
xs.append(X)
xs = sorted(xs)
m = 999999999999999999
diffs = []
for idx,e in enumerate(xs):
  if idx==0:
    continue
  diff = abs(e - xs[idx-1])
  diffs.append(diff)
diffs = sorted(diffs)
for idx,dif in enumerate(diffs):
  if idx == 0:
    continue
  if gcd(diffs[idx], diffs[idx-1]) < m:
    m = gcd(diffs[idx], diffs[idx-1])
if len(diffs) == 1:
  m = diffs[0]
print(m)
a,b,c=map(int(input().split())
print(a*b//2)

### FIXED CODE ###

a,b,c=map(int,input().split())
print(a*b//2)
#include <stdio.h>
#include <string.h>
char s[101];
int main(void)
{
    scanf("%s",s);
    int res = 0;
    int i;
    int n = strlen(s);
    for (i=0;i<n;i++)
    {
        if (s[i] != s[n-i-1]) res++;
    }
    printf("%d\n",res/2);
}


### FIXED CODE ###

S = input()
a = len(S)
k1 = ''
k2 = ''
res = 0
if a % 2 == 0:
    for i in range(0,a//2):
        k1 += S[i]
    for i in range(a//2,a):
        k2 += S[i]
else:
    for i in range(0,(a-1)//2):
        k1 += S[i]
    for i in range((a-1)//2 + 1,a):
        k2 += S[i]
for i in range(len(k1)):
    if k1[i] != k2[(len(k1)-i-1)]:
        res += 1 
print(res)
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations
    #from itertools import accumulate, product, permutations
    from math import floor, ceil

    #mod = 1000000007

    s = input()
    k = int(input())
    if s[0]=='1':
        print(s[1])
    else:
        print(s[0])

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations
    #from itertools import accumulate, product, permutations
    from math import floor, ceil

    #mod = 1000000007

    s = input()
    k = int(input())
    n = 0
    while n<=k-1:
        if not s[n]=='1':
            print(s[n])
            exit()
        else:
            n += 1
    print('1')


if __name__ == '__main__':
    main()
s = input()
for sz in [3, 5, 7, 9, 11, 13, 15, 17, 19, 21]
    for i in range(len(s) - sz):
        curr = s[i:i + sz]
        if curr.count(curr[0]) > sz // 2 or curr.count(curr[1]) > sz // 2 or curr.count(curr[2]) > sz // 2:
            print(i + 1, i + sz)
            exit(0)
print("-1 -1")


### FIXED CODE ###

s = input()
for i in range(len(s) - 1):
    if s[i] == s[i + 1]:
        print(i + 1, i + 2)
        exit(0)
for sz in range(3, 4, 2):
    if sz > len(s):
        break
    for i in range(len(s) - sz + 1):
        curr = s[i:i + sz]
        for it in curr:
            if curr.count(it) > sz // 2:
                print(i + 1, i + sz)
                exit(0)
print("-1 -1")
a,b = list(map(int, input().split()))
print(mod(a+b))

### FIXED CODE ###

a,b = list(map(int, input().split()))
print((a+b)%24)
from scipy.misc import comb
from collections import defaultdict, deque
d = defaultdict(lambda: -1)
d_ = defaultdict(lambda: -1)
n = int(input())
a = deque([int(x) for x in input().split()])
for i in a:
  a_ = a.copy()
  a_.remove(i)
  b = i
  if d[str(b)] != -1:
    print(d[str(b)])
    continue
  A = list(set(a_))
  ans = 0
  for j in A:
    c = a_.count(j)
    if d_[str(c)] != -1:
      ans += d_[str(c)]
    else:
      e = comb(c, 2, exact=True)
      ans += e
      d_[str(c)] = e

  d[str(b)] = ans
  print(ans)




### FIXED CODE ###

n = int(input())
a = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for i in a:
  d[i] += 1

total = 0
for i in set(a):
  x = d[i]
  total += x*(x-1)/2

for i in a:
  x = d[i]
  print(int(total-((x*(x-1)/2))+((x-1)*(x-2)/2)))
D=input(int())
T=input(int())
S=input(int())

if S*T >=D:
  print('Yes')
else:
        print('No')

### FIXED CODE ###

D,T,S = input().split()

D = int(D)
T = int(T)
S = int(S)


if S*T >=D:
  print('Yes')
else:
  print('No')
N=int(input())
A=input()
if len(set(A))-1==N:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S,T=input().split()
A,B=input().split()
U=input()
a=int(A)
b=int(B)
if U==S:
    print(a-1,b)
else:
    print(a,b-1)
from sys import exit

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

shops = {}

for _ in range(N):
    A, B = map(int, input().split())
    if shops[A]:
        shops[A] += B
    else:
        shops[A] = B

shops = sorted(shops.items())
ans = 0

for k in shops:
    if M - k[1] <= 0:
        ans += k[0] * M
        break
    else:
        ans += k[0] * k[1]
        M -= k[1]

print(ans)


### FIXED CODE ###

from sys import exit

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

shops = {}

for _ in range(N):
    A, B = map(int, input().split())
    if A in shops.keys():
        shops[A] += B
    else:
        shops[A] = B

shops = sorted(shops.items())
ans = 0

for k in shops:
    if M - k[1] <= 0:
        ans += k[0] * M
        break
    else:
        ans += k[0] * k[1]
        M -= k[1]

print(ans)
n,m =map(int,input().split())
a =[]*m
b =[]*m
for i in range(n):
        l,r =map(int,input().split())
        a.append(l)
        b.append(r)

if max(a) <=min(b):
        print(min(b)-max(a)+1)
else:
        print(0)


### FIXED CODE ###

n,m =map(int,input().split())
a =[]*m
b =[]*m
for i in range(m):
        l,r =map(int,input().split())
        a.append(l)
        b.append(r)

if max(a) <=min(b):
        print(min(b)-max(a)+1)
else:
        print(0)