Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N,*E=map(int,open(0).read().split())
a,c=1,0
for _,d in sorted((e,2*(i<N)-1)for i,e in enumerate(E)):
	if c*d<0:a*=abs(c)
	c+=d
print(a%(10**9+7))

### FIXED CODE ###

mod = 10 ** 9 + 7
INF = 10 ** 10

N = int(input())
A = [int(input()) for _ in range(N)] + [INF]
B = [int(input()) for _ in range(N)] + [INF]

A.sort()
B.sort()

ans = 1
a = b = 0
i = j = 0
while i < N or j < N:
    if A[i] < B[j]:
        if b > 0:
            ans *= b
            b -= 1
        else:
            a += 1
        i += 1
    else:
        if a > 0:
            ans *= a
            a -= 1
        else:
            b += 1
        j += 1

    ans %= mod

print(ans)
### BUGGY CODE ###

import itertools

#入力
N=int(input())
A = [int(x) for x in list(input())]
ans = 0

AA=[x for x in range(10)]


for i in AA:
    for j in AA:
        for k in AA:
            v=[i,j,k]
            now = 0
            for l in A:
                if (l == v[now]):
                    now += 1
                    if (now == 3):
                        #print(v)
                        break
            if (now == 3):
                ans += 1

print(ans)

### FIXED CODE ###

# 入力
N = int(input())
A = [int(x) for x in list(input())]
ans = 0

AA = [x for x in range(10)]

for i in AA:
    for j in AA:
        for k in AA:
            v = [i, j, k]
            now=0
            temp=v[now]
            for l in A:
                if (l ==temp):
                    now += 1
                    if (now == 3):
                        # print(v)
                        break
                    temp = v[now]
            if (now == 3):
                ans += 1

print(ans)
### BUGGY CODE ###

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

MOD = 10**9+7

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

X = [0]*(N+1)
X[0] = 1

for t in T:
    Y = X[:]
    x = 1
    
    for i, s in enumerate(S):
        if t == s:
            Y[i+1] += x

        x += X[i+1]
        x %= MOD

    X = Y

print(sum(Y)%MOD)


### FIXED CODE ###

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


def f(N, M, S, T):
    W = [1]*(N+1)

    for i, t in enumerate(T):
        W2 = W[:]
        
        k = 0
        for j, s in enumerate(S):
            if t == s:
                k += W[j]

            x = (W2[j+1] + k)%1000000007
            W2[j+1] = x

        W = W2
        
    return W[-1]



def main():
    N, M = map(int, input().split())
    S = list(map(int, input().split()))
    T = list(map(int, input().split()))

    print(f(N,M,S,T))



if __name__ == '__main__':
    main()
### BUGGY CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

k=int(input())
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            tmp=gcd(i,j)
            ans+=gcd(tmp,k)

print(ans)

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
k=int(input())
ans=0
first=k*(k+1)//2
second=0

for i in range(1,k):
    for j in range(i+1,k+1):
        second+=gcd(i,j)*6

thir=0
for i in range(1,k-1):
    for j in range(i+1,k):
        for h in range(j+1,k+1):
            tmp=gcd(gcd(i,j),h)
            thir+=tmp*6

if k==1:
    print(first)
elif k==2:
    print(first+second)
else:
    print(first+second+thir)
### BUGGY CODE ###

n=int(input())
hoge={}
for i in range(n):
  tmp=input()
  if(tmp in  hoge):
    hoge[tmp]+=1
  else:
    hoge[tmp]=1
keys = [k for k, v in hoge.items() if v ==max(hoge.values())]
hoge=sorted(keys)
for i in range(len(hoge)):
  print(hoge[i])

### FIXED CODE ###

n=int(input())
hoge={}
for i in range(n):
  tmp=input()
  if(tmp in  hoge):
    hoge[tmp]+=1
  else:
    hoge[tmp]=1
    
key_max=max(hoge.values())
keys = [k for k, v in hoge.items() if v ==key_max]
hoge=sorted(keys)
for i in range(len(hoge)):
  print(hoge[i])
### BUGGY CODE ###

n = int(input())
a = [int(x) for x in input().split()]

ans=1
for i in range(n):
	ans*=a[i]

if(ans>1000000000000000000):
	print(-1)
else:
	print(ans)

### FIXED CODE ###

n = int(input())
a = [int(x) for x in input().split()]

abc=0

for i in range(n):
	if(a[i]==0):
		abc=1
		break
if(abc==1):
	print(0)
else:
	ans=1
	for i in range(n):
		ans*=a[i]
		if(ans>1000000000000000000):
			break

	if(ans>1000000000000000000):
		print(-1)
	else:
		print(ans)
### BUGGY CODE ###

N, M = map(int, input().split())
ab_list = [list(map(int, input().split())) for i in range(M)]

ab_list.sort()

start_list = list(filter(lambda x: x[0] == 1, ab_list))

res = False

while not res:
    for start in start_list:
        if start[1] == N:
            res = True
    for start in start_list:
        for ab in list(filter(lambda x: x[0] == start[1], ab_list)):
            if ab[1] == N:
                res = True

if res:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


### FIXED CODE ###

N, M = map(int, input().split())
ab_list = [list(map(lambda x: int(x) - 1, input().split())) for i in range(M)]

lis = [[] for i in range(N)]

for i in range(M):
    lis[ab_list[i][0]].append(ab_list[i][1])

que = [[0, 0, lis[0], []]]
ends = []
res = False

while que:
    count, now, next_nodes, visited = que.pop()
    visited.append(now)
    if now == N - 1:
        ends = visited[:]
    for node in next_nodes:
        if node in visited or count == 2:
            continue
        que.append([count + 1, node, lis[node], visited[:]])

if N - 1 in ends:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
### BUGGY CODE ###

n,x=map(int, input().split())
lst=list(map(int, input().split()))
ms=lst
lst=lst*2
ans=10**15
s=0
for i in range(n):
    s=i*x
    for j in range(n):
        ms[j]=min(ms[j],lst[n+j-i])
        s+=ms[j]
    ans=min(ans,s)
print(ans)


### FIXED CODE ###

n,x=map(int, input().split())
lst=list(map(int, input().split()))
ms=lst
lst=lst*2
ans=10**15
s=0
for i in range(n):
    s=i*x
    for j in range(n):
        ms[j]=min(ms[j],lst[n+j-i])
        s+=ms[j]
    ans=min(ans,s)
print(ans)
### BUGGY CODE ###

import sys
# sys.stdin = open('input.txt')

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

ans = {}
for i in range(1, n+1):
    ans[i] = a.count(i)

for i in ans.values():
    print(i)

### FIXED CODE ###

import sys
# sys.stdin = open('input.txt')

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

ans = {}
for i in range(1, n+1):
    ans[i] = 0
for i in a:
    ans[i] += 1

for i in ans.values():
    print(i)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

 
# なんこか入力
x,y,z,k = map(int, input().split())
 
# 空白区切りの数列をリストに代入
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
 
a.sort()
b.sort()
c.sort()
#cake = [[0 for i in range(3)] for j in range(3000)]
#cake[0][0]=x-1
#cake[0][1]=y-1
#cake[0][2]=z-1
#print(a[x-1]+b[y-1]+c[z-1])
#print(a[cake[0][0]],b[cake[0][1]],c[cake[0][2]])
t = np.array([[-1,-1,-1,-1] for i in range(3*k)]).astype(np.int64)
t[0] = [a[x-1]+b[y-1]+c[z-1],x-1,y-1,z-1]
t_a = 1
#print(s)
 
for i in range(0,k):
    ma = 0
    ma_j = -1
    temp = [-1,-1,-1,-1]
    for j in range(len(t)):
        if ma <= t[j][0] :
            temp = t[j]
            ma = t[j][0]
            ma_j = j
#    print(temp)
    print(temp[0])
    t[ma_j][0]=0
#    print("s=",s)
#    print("t=",t)
#    print(temp)
    f =1
    if temp[1] > 0:
        for j in range(len(t)):
            if temp[1]-1 == t[j][1] and temp[2]==t[j][2] and temp[3]==t[j][3]:
                f = 0
                break
        if f == 1:
            t[t_a] = [a[temp[1]-1]+b[temp[2]]+c[temp[3]],temp[1]-1,temp[2],temp[3]]
            t_a += 1
    f =1
    if temp[2] > 0:
        for j in range(len(t)):
            if temp[1] == t[j][1] and temp[2]-1==t[j][2] and temp[3]==t[j][3]:
                f = 0
                break
        if f == 1:
            t[t_a] = [a[temp[1]]+b[temp[2]-1]+c[temp[3]],temp[1],temp[2]-1,temp[3]]
            t_a += 1
    f =1
    if temp[3] > 0:
        for j in range(len(t)):
            if temp[1] == t[j][1] and temp[2]==t[j][2] and temp[3]-1==t[j][3]:
                f = 0
                break
        if f == 1:
            t[t_a] = [a[temp[1]]+b[temp[2]]+c[temp[3]-1],temp[1],temp[2],temp[3]-1]
            t_a += 1


### FIXED CODE ###

# -*- coding: utf-8 -*-
# ヒープキューを使う

import math
import sys
import itertools
import numpy as np
import heapq
 
# なんこか入力
x,y,z,k = map(int, input().split())
 
# 空白区切りの数列をリストに代入
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

a.sort()
b.sort()
c.sort()

h = [] # heap
g = set() #使用済み

heapq.heappush(h,(-(a[x-1]+b[y-1]+c[z-1]),x-1,y-1,z-1))
g.add((x-1,y-1,z-1))

#print(h)

for i in range(k):
#    heapq.heapify(h)
    temp =[]
    temp = heapq.heappop(h)
    print(-temp[0])
    for j in range(3):
        if temp[j+1]==0:
            continue
        if j == 0:
            temp2 = (-(a[temp[1]-1]+b[temp[2]]+c[temp[3]]),temp[1]-1,temp[2],temp[3])
        elif j == 1:
            temp2 = (-(a[temp[1]]+b[temp[2]-1]+c[temp[3]]),temp[1],temp[2]-1,temp[3])
        else:
            temp2 = (-(a[temp[1]]+b[temp[2]]+c[temp[3]-1]),temp[1],temp[2],temp[3]-1)
        if (temp2[1],temp2[2],temp2[3]) in g:
            continue
        heapq.heappush(h,temp2)
        g.add((temp2[1],temp2[2],temp2[3]))
### BUGGY CODE ###

n, k = [ int( val ) for val in raw_input( ).split( " " ) ]
w = [ int( raw_input( ) ) for val in xrange( n ) ]
sumW = sum( w )
maxW = max( w )

minP = 0
if 1 == k:
	minP = sumW
elif n == k:
	minP = maxW
else:
	minP = max( maxW, sumW//k )
	while True:
		truckCnt = i = loadings = 0
		while i < n:
			loadings += w[i]
			if minP < loadings:
				truckCnt += 1
				if k < truckCnt+1:
					break
				loadings = w[i]
			i += 1
		if truckCnt+1 <= k:
			break

		minP += 1

print( minP )

### FIXED CODE ###

n, k = [ int( val ) for val in input( ).split( " " ) ]
w = [ int( input( ) ) for val in range( n ) ]
sumW = sum( w )
maxW = max( w )

minP = 0
if 1 == k:
	minP = sumW
elif n == k:
	minP = maxW
else:
	left = maxW
	right = 100000*10000
	while left <= right:
		middle = ( left+right )//2
		truckCnt = i = loadings = 0
		while i < n:
			loadings += w[i]
			if middle < loadings:
				truckCnt += 1
				if k < truckCnt+1:
					break
				loadings = w[i]
			i += 1

		if truckCnt+1 <= k:
			minP = middle
		
		if k < truckCnt+1:
			left = middle + 1
		else:
			right = middle - 1

print( minP )
### BUGGY CODE ###

N = int(input())
S = input()

R = [i for i in range(N) if S[i] == "R"]
G = [i for i in range(N) if S[i] == "G"]
B = [i for i in range(N) if S[i] == "B"]

ans = 0
for r in R:
    for g in G:
        for b in B:
            i, j, k = sorted([r, g, b])
            if j - i != k - j:
                ans += 1

print(ans)

### FIXED CODE ###

N = int(input())
S = input()

R = [i for i in range(N) if S[i] == "R"]
G = [i for i in range(N) if S[i] == "G"]
B = [i for i in range(N) if S[i] == "B"]

ans = len(R) * len(G) * len(B)
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        k = 2 * j - i
        if k < N and S[i] != S[j] and S[j] != S[k] and S[i] != S[k]:
             ans -= 1

print(ans)
### BUGGY CODE ###

s = str(input())
k = int(input())

List = []

for i in range(len(s)):
    for j in range(len(s)-i+1):
        List.append(s[i:i+j])

set_List = set(List)
List = list(set_List)
List = sorted(List)
List.remove('')

ans = List[k-1]
print(ans)

### FIXED CODE ###

s = str(input())
k = int(input())

List = []

for i in range(len(s)):
    for j in range(min(len(s)-i+1, k+1)):
        List.append(s[i:i+j])

set_List = set(List)
List = list(set_List)
List = sorted(List)
List.remove('')

ans = List[k-1]
print(ans)
### BUGGY CODE ###

N,a,b = map(int,input().split())
MOD = 10**9+7
def combination(n,r):
    if(r<0) or (n<r):
        return 0
    r = min(r,n-r)
    return fact[n]*factinv[r]*factinv[n-r]%MOD
fact = [1,1]
factinv = [1,1]
inv = [0,1]
for i in range(2,N+1):
    fact.append((fact[-1]*i)%MOD)
    inv.append((-inv[MOD%i]*(MOD//i)%MOD))
    factinv.append((factinv[-1]*inv[-1]%MOD))
result = pow(2,N,MOD) - 1
nashi = combination(N,a) + combination(N,b)
if result - nashi < 0:
    print(result - nashi + MOD)
else:
    print(result - nashi)

### FIXED CODE ###

from functools import reduce
N,a,b = map(int,input().split())
MOD = 10**9+7
def f(r):
    nPr = reduce(lambda x,y: x * y % MOD,range(N,N-r,-1))
    r_fact = reduce(lambda x,y: x * y % MOD,range(1,r+1))
    return nPr * pow(r_fact,MOD-2,MOD) % MOD
result = pow(2,N,MOD) - f(a) - f(b) - 1
result %= MOD
print(result)
### BUGGY CODE ###

S = input()
ans = 0
for i in range(len(S)):
    for j in range(i+1, len(S)+1):
        a = int(S[i:j])
        ans += a%2019 == 0

print(ans)

### FIXED CODE ###

from collections import Counter
S = input()
P = [0] * (len(S)+1)
mod = 2019
d = 1
for i in range(len(S), 0, -1):
    P[i-1] = int(S[i-1])*d + P[i]
    P[i-1] = P[i-1] % mod
    d *= 10
    d = d % mod

P = Counter(P)
ans = 0
for p in P.values():
    ans += p*(p-1)//2
print(ans)
### BUGGY CODE ###

def bisect_left_reverse(a, x):
    '''
    reverseにソートされたlist aに対してxを挿入できるidxを返す。
    xが存在する場合には一番左側のidxとなる。
    '''
    if a[0] <= x:
        return 0
    if x < a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] <= x:
            ok = mid
        else:
            ng = mid
    return ok

def bisect_right_reverse(a, x):
    '''
    reverseにソートされたlist aに対してxを挿入できるidxを返す。
    xが存在する場合には一番右側のidx+1となる。
    '''
    if a[0] < x:
        return 0
    if x <= a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] < x:
            ok = mid
        else:
            ng = mid
    return ok

n = int(input())
llis = list(map(int, input().split()))
lis = sorted(llis, reverse=True)
ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        ans += max(bisect_left_reverse(lis, lis[i]-lis[j]) - j - 1, 0)
print(ans)

### FIXED CODE ###

import bisect
n = int(input())
lis = sorted(list(map(int, input().split())))
ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        ans += max(bisect.bisect_left(lis, lis[j]+lis[i]) - j - 1, 0)
print(ans)
### BUGGY CODE ###

import collections
N = int(input())
A=list(map(int,input().split()))
#print(A)
B=collections.Counter(A)
#print(B)
for i in A:
    tmp=0
    for k,v in B.items():
        if i==k:
            tmp+=int(0.5*(v-1)*(v-2))
            
        else:
            tmp+=int(0.5*(v)*(v-1))
 
    print(tmp)

### FIXED CODE ###

from collections import Counter
N = int(input())
A=list(map(int,input().split()))
B=Counter(A)
tmp=0
for i in B.values():
    tmp+=int(0.5*(i)*(i-1))
    #print(tmp)
for i in A:            
    print(tmp-B[i]+1)
### BUGGY CODE ###

from itertools import product

n = int(input())
def calc(i):
    xs = [a for a in range(1,int(i**0.5))]
    ys = [a for a in range(1,int(i**0.5))]
    zs = [a for a in range(1,int(i**0.5))]
    cnt = 0
    for x,y,z in list(product(xs,ys,zs)):
        if (i % 6 == 0) or (i % 6 == 5) or (i % 6 == 1):
            if x**2+y**2+z**2+x*y+y*z+z*x == i:
                cnt += 1
    print(cnt)






for i in range(1, n+1):
    calc(i)

### FIXED CODE ###

n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v = i*i+j*j+k*k+i*j+j*k+k*i;
            if v<10050:
                ans[v]+=1
for i in range(n):
    print(ans[i+1])
### BUGGY CODE ###

n = int(input())
l = list(map(int, input().split()))

import fractions
from functools import reduce
def lcm_base(x, y):
  return (x * y) // fractions.gcd(x, y)
  
def lcm_list(numbers):
  return reduce(lcm_base, numbers, 1)

x = lcm_list(l)
ans = 0
for i in range(n):
  ans += x//l[i]
  ans %= 10**9+7
  
print(ans)
  
  

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))

def gcd(a, b):
  while b != 0:
    a, b = b, a%b
  return a

def lcm(a, b):
  return (a* b) // gcd(a, b)

t = 1
for i in range(n):
  t = lcm(t, l[i])

ans = 0
for i in range(n):
  ans += t//l[i]
ans %= 10**9+7

print(ans)
### BUGGY CODE ###

def solve():
  L, R = map(int, input().split())
  ans = 2019
  for i in range(L, R + 1):
    if i % 2019 == 0: return 0
    v = i * (i + 1) % 2019
    for j in range(i + 1, R + 1):
      ans = min(ans, v)
      v += i
      v %= 2019
  return ans

print(solve())

### FIXED CODE ###

def solve():
  L, R = map(int, input().split())
  ans = 2019
  for i in range(L, R):
    for j in range(i + 1, R + 1):
      v = i * j % 2019
      if v < ans: ans = v
      if ans == 0: return 0
  return ans

print(solve())
### BUGGY CODE ###

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

setA = list(set(A))

d = {a: A.count(a) for a in setA}


#print(d)
r = 0
for k, v in d.items():
    if v > k:
        r += v - k
    elif k > v:
      	r += v

print(r)

### FIXED CODE ###

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

r = 0
d = {}
pass_list = []
for a in A:
    if a in pass_list:
        r += 1
        continue
    r += 1
    if a in d:
        d[a] += 1
        if d[a] == a:
            r -= a
            pass_list.append(a)
    else:
        d[a] = 1
        if d[a] == a:
          r -= a
          pass_list.append(a)

print(r)
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
import heapq
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, M: int, A: "List[int]", B: "List[int]", C: "List[int]"):
    heapq.heapify(A)

    for b, c in zip(B, C):
        for i in range(b):
            v = heapq.heappop(A)
            if v < c:
                heapq.heappush(A, c)
            else:
                heapq.heappush(A, v)
                break
    return sum(A)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    B = [int()] * (M)  # type: "List[int]" 
    C = [int()] * (M)  # type: "List[int]" 
    for i in range(M):
        B[i] = int(next(tokens))
        C[i] = int(next(tokens))
    result = solve(N, M, A, B, C)
    if isinstance(result, Iterable) and not isinstance(result, str):
        result = '\n'.join([str(v) for v in result])
    print(result)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import heapq
import bisect
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, M: int, A: "List[int]", B: "List[int]", C: "List[int]"):
    ret = sum(A)
    cs = Counter(A)
    for c in C:
        if c not in cs:
            cs[c] = 0
    vs = sorted(cs.keys())

    i = 0
    while cs[vs[i]] == 0:
        i += 1

    for b, c in zip(B, C):
        while 0 < b:
            if c <= vs[i]:
                break
            bb = min(b, cs[vs[i]])
            b -= bb
            cs[vs[i]] -= bb
            cs[c] += bb
            ret += bb * (c - vs[i])
            if cs[vs[i]] == 0:
                i += 1
    return ret


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    B = [int()] * (M)  # type: "List[int]" 
    C = [int()] * (M)  # type: "List[int]" 
    for i in range(M):
        B[i] = int(next(tokens))
        C[i] = int(next(tokens))
    result = solve(N, M, A, B, C)
    if isinstance(result, Iterable) and not isinstance(result, str):
        result = '\n'.join([str(v) for v in result])
    print(result)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

n, q = map(int, input().split())
s = input()
l = [0]*q; r = [0]*q

for i in range(q):
    l[i], r[i] = map(int, input().split())
cum = [0]*n
for i in range(n-1):
    if s[i] == 'A' and s[i+1] == 'C':
        cum[i] = 1
for i in range(q):
    temp = cum[l[i]-1:r[i]]
    cnt = 0
    for j in range(len(temp) - 1):
        if temp[j] == 1 and temp[j+1] == 0:
            cnt += 1
    print(cnt)

### FIXED CODE ###

n, q = map(int, input().split())
s = input()
t = [0]*(n+1)

for i in range(n):
	t[i+1] = t[i] + (1 if s[i:i+2]=='AC' else 0)

for i in range(q):
	l, r = map(int, input().split())
	print(t[r-1] - t[l-1])
### BUGGY CODE ###

if __name__=='__main__':
    n,k,*h=map(int,open(0).read().split())
    dp=[0]
    for i in range(1,n):
        t=h[i]
        d=10**18
        for j in range(k):
            l=i-k+j
            if l<0:continue
            d=min(d,dp[l]+abs(t-h[l]))
        dp.append(d)
    print(dp[-1])

### FIXED CODE ###

n,k,*h=map(int,open(0).read().split())
dp=[0]+[10**18]*~-n
for i in range(1,n):
    for j in range(k):
        if i-k+j<0:continue
        dp[i]=min(dp[i],dp[i-k+j]+abs(h[i]-h[i-k+j]))
print(dp[-1])
### BUGGY CODE ###

member_cnt = int(input())
bosses = input().split(' ')

for i in range(1, member_cnt + 1):
  print(bosses.count(str(i)))

### FIXED CODE ###

import collections


member_cnt = int(input())
bosses = input().split(' ')
boss_dict = collections.Counter(bosses)

for i in range(1, member_cnt + 1):
  print(boss_dict.get(str(i), 0))
### BUGGY CODE ###

#!/usr/bin/env python3

#import numpy as np
#import scipy, scipy.special

# Python 3 modules: https://docs.python.org/3/library/

import sys
import math, itertools, operator
from math import *
from math import factorial as fact
from itertools import permutations, combinations
from functools import reduce
# Use scipy for stats: https://docs.scipy.org/doc/scipy/reference/stats.html
# Before Python 3.5
from fractions import gcd

inf = float('inf')

def lcm(a, b):
    return a * b // gcd(a,b)

def perm(a, b):
    import scipy.special
    return scipy.special.perm(a, b, exact = True)

def comb(a, b):
    import scipy.special
    return scipy.special.comb(a, b, exact = True)

def dfact(n):
    import scipy.special
    return scipy.special.factorial2(n, exact = True)

def prod(l):
    return reduce(operator.mul, l)

def input_ints(inp = input, sep = ' ', conv = int):
    return map(conv, inp().split(sep = sep))

################################################################################

sys.setrecursionlimit(1000000)

N, M = input_ints()

# D[i][j]: Card i has a rel. with card j
D = [[] for i in range(N)]
for i in range(M):
    x, y, z = input_ints()
    x -= 1
    y -= 1
    D[x].append(y)
    D[y].append(x)

visited = [False for i in range(N)]
def dfs(n):
    for idx in D[n]:
        if not visited[idx]:
            visited[idx] = True
            dfs(idx)

cnt = 0
for n in range(N):
    if not visited[n]:
        visited[n] = True
        dfs(n)
        cnt += 1
print(cnt)


### FIXED CODE ###

#!/usr/bin/env python3

import sys

sys.setrecursionlimit(1000000)

N, M = [int(x) for x in input().split()]

# D[i][j]: Card i has a rel. with card j
D = [[] for i in range(N)]
for i in range(M):
    x, y, z = [int(x) for x in input().split()]
    x -= 1
    y -= 1
    D[x].append(y)
    D[y].append(x)

visited = [False for i in range(N)]
def dfs(n):
    for idx in D[n]:
        if not visited[idx]:
            visited[idx] = True
            dfs(idx)

cnt = 0
for n in range(N):
    if not visited[n]:
        visited[n] = True
        dfs(n)
        cnt += 1
print(cnt)