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

import sys
from collections import deque

#n, q = map(int, input().split())
n = int(input())
tasks = {
    "insert": "appendleft",
    "delete": "remove",
    "deleteFirst": "pop",
    "deleteLast": "popleft"
}

a = deque()

for i in range(n):
    input_line = input()
    if input_line in tasks:
        #deleteFirst,deleteLast
        task = input_line
        eval("a.{}()".format(tasks[task]))
    else:
        #insert,delete
        task, item = input_line.split()
        eval("a.{}({})".format(tasks[task], item))

print(*a)

### FIXED CODE ###

# coding: utf-8

import sys
from collections import deque

n = int(input())

task_name = (
    "insert",
    "delete",
    "deleteFirst",
    "deleteLast",
)

a = deque()

for task in map(lambda x: [x] if x in task_name else x.split(), sys.stdin.readlines()):
    #deleteFirst,deleteLast
    if len(task) == 1:
        if task[0] == "deleteFirst":
            a.popleft()
        else:
            a.pop()

    #insert,delete
    else:
        if task[0] == "insert":
            a.appendleft(task[1])
        elif task[1] in a:
            a.remove(task[1])

print(*a)
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
for index, x in enumerate(h):
  if x == k:
    print(n - index)
    break

### FIXED CODE ###

N = float(input())
if N % 2 == 0:
  print(1/2)
else:
  print((N+1)/(2*N))
def resolve():
    N, R = map(int, input().split())  

    if N >= 10:
        print(R)
    else:
        R = R - 100 * (10 - K)
        print(R)
 
if __name__ == "__main__":
    resolve()

### FIXED CODE ###

def resolve():
    N, R = map(int, input().split())  

    if N >= 10:
        print(R)
    else:
        R = R + 100 * (10 - N)
        print(R)
 
if __name__ == "__main__":
    resolve()
s = input()
a = int(s)%2019
mod_N = [0]*2019
mod_N[a] += 1
r = 10**(len(s)-1)
for i in range(len(s)):
  a = (a-int(s[i])*10**d)%2019
  d = d//10
  mod_N[a] += 1
ans = 0
for i in mod_N:
  ans += i*(i-1)//2
print(ans)

### FIXED CODE ###

s = input()
a = 0
mods = [0]*2019
mods[a] += 1
r = 1
for i in s[::-1]:
  a = (a+int(i)*r)%2019
  r = r*10%2019
  mods[a] += 1
ans = 0
for i in mods:
  ans += i*(i-1)//2
print(ans)
n = int(input())
x = input()
one_num = x.count('1')

ans_reduce,ans_add = 0,0
for i in range(n):
    if(one_num>1):
        ans_reduce = (ans_reduce+pow(2,n-i-1,one_num-1)*(1 if x[i] == '1' else 0))%(one_num-1)
    ans_add = (ans_add+pow(2,n-i-1,one_num+1)*(1 if x[i] == '1' else 0))%(1+one_num)

for i in range(n):
    now_one = one_num + (-1 if x[i] == '1' else 1)
    num = ((ans_reduce if x[i] == '1' else ans_add) + pow(2,n-i-1,now_one)*(-1 if x[i] == '1' else 1))%now_one
    ans = 1
    while(num!=0):
        ans += 1
        num = num % bin(num).count('1')
    print(ans)


### FIXED CODE ###

n = int(input())
x = input()
one_num = x.count('1')

ans_reduce,ans_add = 0,0
for i in range(n):
    if(one_num>1):
        ans_reduce = (ans_reduce+pow(2,n-i-1,one_num-1)*(1 if x[i] == '1' else 0))%(one_num-1)
    ans_add = (ans_add+pow(2,n-i-1,one_num+1)*(1 if x[i] == '1' else 0))%(1+one_num)

for i in range(n):
    now_one = one_num + (-1 if x[i] == '1' else 1)
    if(now_one == 0):
        print(0)
        continue
    num = ((ans_reduce if x[i] == '1' else ans_add) + pow(2,n-i-1,now_one)*(-1 if x[i] == '1' else 1))%now_one
    ans = 1
    while(num!=0):
        ans += 1
        num = num % bin(num).count('1')
    print(ans)
def main():
        N,Q = map(int,input().split())
        ab = [list(map(int,input().split())) for _ in range(N - 1)]
        px = [list(map(int,input().split())) for _ in range(Q)]
        ab.sort()
        
        plus = [0 for _ in range(N)]
        for _ in range(Q):
        	p,x = map(int,input().split())
        	plus[p - 1] += x 

        for a,b in ab:
                plus[b - 1] += plus[a - 1]
        for p in plus:
                print(p)

if __name__ == '__main__':
        main()


### FIXED CODE ###

def main():
        N,Q = map(int,input().split())
        ab = [list(map(int,input().split())) for _ in range(N - 1)]
        px = [list(map(int,input().split())) for _ in range(Q)]
        ab.sort()
        # px.sort()
        plus = [0 for _ in range(N)]

        for p,x in px:
                plus[p - 1] += x 

        for a,b in ab:
                plus[b - 1] += plus[a - 1]
        for p in plus:
                print(p)

if __name__ == '__main__':
        main()
n = input()
j = 0
for i in range(n):
  j += i
  
print(j)

### FIXED CODE ###

n = int(input())
j = 0
for i in range(n+1):
  j = j + i
  
print(j)
A, P = map(int, input().split())

print((3A + P)//2)

### FIXED CODE ###

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

print((3*A + P)//2)
x,y,z,K = map(int, input().split())

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

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


memo = {}

def next_step(i,j,k):
    cand = []
    for dx, dy, dz in ((1,0,0),
                       (0,1,0),
                       (0,0,1),
                       (1,-1,0),
                       (-1,1,0),
                       (0,1,-1),
                       (0,-1,1),
                       (1,0,-1),
                       (-1,0,1),
                       (2,-1,0),
                       (-1,2,0),
                       (0,-1,2),
                       (0,2,-1),
                       (2,0,-1),
                       (-1,0,2),
                       (1,-2,0),
                       (-2,1,0),
                       (0,-2,1),
                       (0,1,-2),
                       (1,0,-2),
                       (-2,0,1),
                       (2,-2,0),
                       (-2,2,0),
                       (0,-2,2),
                       (0,2,-2),
                       (2,0,-2),
                       (-2,0,2)):
        if 0<=i+dx and i+dx<x\
        and 0<=j+dy and j+dy<y\
        and 0<=k+dz and k+dz<z\
        and not (i+dx,j+dy,k+dz) in memo:
            cand.append([-(a[i+dx]+b[j+dy]+c[k+dz]), [i+dx,j+dy,k+dz]])
    cand.sort()
    return cand[0][1]

i = j = k = 0
print(a[i]+b[j]+c[k])
#print(i,j,k)
memo[(i,j,k)] = 0

for _ in range(K-1):
    i,j,k = next_step(i,j,k)
    memo[(i,j,k)] = 0
#    print(i,j,k)
    print(a[i]+b[j]+c[k])



### FIXED CODE ###

import heapq

x,y,z,K = map(int, input().split())

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

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


memo = {}
i = j = k = 0

h = []
heapq.heappush(h, (-(a[i]+b[j]+c[k]), i,j,k))
for _ in range(K):
    cost, i, j, k = heapq.heappop(h)
    print(-cost)
    for dx, dy, dz in ((1,0,0), (0,1,0), (0,0,1)):
        if (i+dx, j+dy, k+dz) in memo:
            continue
        if i+dx<x and j+dy<y and k+dz<z:
            heapq.heappush(h, (-(a[i+dx]+b[j+dy]+c[k+dz]), i+dx, j+dy, k+dz))
            memo[(i+dx,j+dy,k+dz)] = 1
def main(p1,p2):
    print(p1)
    print(p2)
    L_np = np.sort(np.array(p2))
    x_total = 0
    for i in range(p1):
        x_total += L_np[2*i]
    print(x_total)

if __name__ == "__main__":
    #a = [int(input()) for i in range(5)]
    N = int(input())
    L = [int(item) for item in input().split()]
    main(N,L)

### FIXED CODE ###

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

import numpy as np

def main(p1,p2):
    L_np = np.sort(np.array(p2))
    x_total = 0
    for i in range(p1):
        x_total += L_np[2*i]
    print(x_total)

if __name__ == "__main__":
    #a = [int(input()) for i in range(5)]
    N = int(input())
    L = [int(item) for item in input().split()]
    main(N,L)
from collections import defaultdict as dd
import heapq

n,k=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(n)]
l.sort(key=lambda x:-x[1])

sushi_types = set()
sushies = []
v=0

for i in range(k):
    t,d=l[i]
    v+=d
    if t in sushi_types:
        heapq.heappush(sushies,d)
    else:
        sushi_types.add(t)

remaining_sushi=dd(list)
for i in range(k,n):
    t,d=l[i]
    if not t in sushi_types:
        heapq.heappush(remaining_sushi[t],-d)

l=[0]*(k+1)
current_types=len(sushi_types)
l[current_types]=v+current_types**2
ans=l[current_types]

for i in range(len(sushi_types)+1,k+1):
    t,add_target=min(remaining_sushi.items(),key=lambda x:x[1][0])
    sushi_types.add(t)
    remove_target=heapq.heappop(sushies)
    l[i]=l[i-1]-(i-1)**2-add_target[0]-remove_target+i**2
    ans=max(ans,l[i])
    del remaining_sushi[t]

print(ans)

### FIXED CODE ###

from collections import defaultdict as dd
import heapq

n,k=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(n)]
l.sort(key=lambda x:-x[1])

sushi_types = set()
sushies = []
v=0

for i in range(k):
    t,d=l[i]
    v+=d
    if t in sushi_types:
        heapq.heappush(sushies,d)
    else:
        sushi_types.add(t)

remaining_sushi=dd(list)
for i in range(k,n):
    t,d=l[i]
    if not t in sushi_types:
        heapq.heappush(remaining_sushi[t],-d)

eat_candidate_sushi = []
for i in remaining_sushi.keys():
    if not i in sushi_types:
        heapq.heappush(eat_candidate_sushi,remaining_sushi[i][0])

sushi_kinds=len(sushi_types)
val=v
ans=v+sushi_kinds**2

for i in range(sushi_kinds+1,k+1):
    if sushies and eat_candidate_sushi:
        v-=heapq.heappop(sushies)
        v-=heapq.heappop(eat_candidate_sushi)
        ans=max(ans,v+i**2)
    else:
        break

print(ans)
import heapq

N, M = map(int, input().split())
AB = [[] for i in range(10*5+1)]

for i in range(N):
    A, B = map(int, input().split())
    AB[A].append(-B)

hq = []
heapq.heapify(hq)

ans = 0
for i in range(1, M+1):
    for a in AB[i]:
        heapq.heappush(hq, a)

    if len(hq) > 0:
        ans += abs(heapq.heappop(hq))

print(ans)


### FIXED CODE ###

import heapq

N, M = map(int, input().split())
AB = [[] for i in range(10**5+1)]

for i in range(N):
    A, B = map(int, input().split())
    AB[A].append(-B)

hq = []
heapq.heapify(hq)

ans = 0
for i in range(1, M+1):
    for b in AB[i]:
        heapq.heappush(hq, b)

    if len(hq) > 0:
        ans += -heapq.heappop(hq)

print(ans)
def dfs(v, tm):
    dts[v] = est[v] = tm
    child = 0

    for i in range(nv):
        if adj[v][i]:
            if parents[i] is None:
                child += 1
                parents[i] = v
                dfs(i, tm + 1)
                est[v] = min(est[v], est[i])

                if parents[v] is None and child > 1: aps[v] = True
                if parents[v] is not None and est[i] >= dts[v]: aps[v] = True

            elif parents[v] != i:
                est[v] = min(est[v], dts[i])

nv, ne = map(int, input().split(' '))
adj = [[False] * nv for _ in range(nv)]
est = [float('inf')] * nv
parents = [None] * nv
aps = [False] * nv
dts = [0] * nv

for _ in range(ne):
    s, t = map(int, input().split(' '))
    adj[s][t] = adj[t][s] = True

dfs(0, 0)
[print(i) if aps[i] else _ for i in range(nv)]

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def dfs(v, tm):
    dts[v] = est[v] = tm + 1
    child = 0

    for i in adj[v]:
        if est[i] == float('inf'):
            child += 1
            parents[i] = v
            dfs(i, tm + 1)
            est[v] = min(est[v], est[i])

            if parents[v] is None and child > 1: aps[v] = True
            if parents[v] is not None and est[i] >= dts[v]: aps[v] = True

        elif parents[v] != i:
            est[v] = min(est[v], dts[i])

nv, ne = map(int, input().split(' '))
adj = [[] for _ in range(nv)]
est = [float('inf')] * nv
parents = [None] * nv
aps = [False] * nv
dts = [0] * nv

for _ in range(ne):
    s, t = map(int, input().split(' '))
    adj[s].append(t)
    adj[t].append(s)

dfs(0, 0)

for i in range(nv):
    if aps[i]:
        print(i)
# coding: utf-8
import os
import time
import re
import math


def main():
    global N,M,A,mod,memo
    N,M=map(int,input().split())
    A=[int(input()) for  a in range(M)] #a (1段~N-1段)
    start=time.time();#
    memo=[-1]*(N+1)
    
    mod=10**9+7
    print(dp(0))
    #print("{}ms".format(math.floor(time.time()*1000-start*1000)))#

def dp(index):
    global N,M,A,mod,memo
    if(index>N):return 0
    if(index==N):return 1
    if(A.count(index)>0):return 0
    if memo[index]==-1:
        memo[index]=(dp(index+1)+dp(index+2))%mod
    return memo[index]

main()


### FIXED CODE ###

# coding: utf-8
import os
import time
import re
import math


def main():
    N,M=map(int,input().split())
    A=[int(input()) for  a in range(M)] #a (1段~N-1段)
    start=time.time();#
    memo=[0]*(N+1)
    memo[0]=1
    ban=[False]*(N+1)
    for a in A:
        ban[a]=True
    mod=1000000007
    for a in range(1,N+1):
        if ban[a]:
            memo[a]=0
        else:
            if a>1:
                memo[a]=(memo[a-1]+memo[a-2])%mod
            else:
                memo[a]=1



    print(memo[-1]%mod)
    #print("{}ms".format(math.floor(time.time()*1000-start*1000)))#


main()
n=int(intpu())
m=int(input())
if n==m:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

arr=list(map(int,input().split()))
n=arr[0]
m=arr[1]
if n==m:
  print("Yes")
else:
  print("No")
from fractions import gcd

n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7

divisor = a[0]
multiple = a[0]
for i in range(1, n):
  divisor = gcd(divisor, a[i])
  inv_divisor = pow(divisor, mod - 2, mod)
  multiple = (multiple * a[i] * inv_divisor) % mod

sum_b = 0
for i in range(n):
  sum_b = (sum_b + multiple * inv_divisor) % mod
print(sum_b)

### FIXED CODE ###

from fractions import gcd

n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7

lcm = 1
for i in range(n):
  lcm = lcm * a[i] // gcd(lcm, a[i])
lcm %= mod

sum_b = 0
for i in range(n):
  sum_b = (sum_b + lcm * pow(a[i], mod - 2, mod)) % mod
print(sum_b)
n = input()
a = n / 1.08
if float(n%1.08):
      x = int(a)
else:
      x = int(a) + 1
v = int(x * 1.08)
if v == n:
  print(x)
else:
  print(":(")

### FIXED CODE ###

n=int(input())
a = n / 1.08
if a-int(a) == 0.00:
      x = int(a)
else:
      x = int(a) + 1
v = int(x * 1.08)
if v == n:
  print(x)
else:
  print(":(")
n,k,*a=map(int,open(0).read().split())
d=[2*k]*n
s=0
while k:k-=1;k%=d[s:=a[s]-1]-k;d[s]=k
print(s)

### FIXED CODE ###

n,k,*a=map(int,open(0).read().split())
d=[0]+[-1]*n
s=0
for i in range(k):
  s=a[s]-1
  if(j:=d[s])>-1:
    exec((k-j)%(i+1-j)*'s=a[s]-1;')
    exit(print(s+1))
  d[s]=i+1
print(s+1)
d, t, s = map(int,input())
print('Yes' if t*s >=d else 'No')

### FIXED CODE ###

d, t, s = map(int,input().split())
print('Yes' if t*s >=d else 'No')
n = int(input())
x = input()

x_1 = x.count('1')
flag = 0
if(x_1 == 0):
    flag = 1
if(x_1 == 1):
    flag = 2

data = [0 for i in range(n+1)]
data[0] = 0
for i in range(1,n+1):
    i_str = format(i,'b')
    ne = i % (i_str.count('1'))
    data[i] = data[ne] + 1

print(data)

up = [0 for i in range(n)]
do = [0 for i in range(n)]

d = 1
for i in range(n):
    up[i] = d % (x_1 + 1)
    d *= 2
d = 1
if(flag == 0):
    for i in range(n):
        do[i] = d % (x_1 - 1)
        d *= 2

upp = 0
dow = 0

for i in range(n):
    if(x[n-i-1] == '1'):
        upp += up[i]
        upp %= (x_1+1)
        dow += do[i]
        dow %= (x_1-1)



for i in range(n):
    if(x[i] == '0'):
        sam = upp + up[n-i-1]
        sam %= (x_1+1)
        print(data[sam]+1)
    elif(flag == 0):
        sam = dow - do[n-i-1]
        sam %= (x_1-1)
        print(data[sam]+1)
    elif(flag == 2):
        print('0')

### FIXED CODE ###

n = int(input())
x = input()

x_1 = x.count('1')
flag = 0
if(x_1 == 0):
    flag = 1
if(x_1 == 1):
    flag = 2

data = [0 for i in range(n+1)]
data[0] = 0
for i in range(1,n+1):
    i_str = format(i,'b')
    ne = i % (i_str.count('1'))
    data[i] = data[ne] + 1

up = [0 for i in range(n)]
do = [0 for i in range(n)]

d = 1
upp = 0
for i in range(n):
    up[i] = d
    if(x[n-i-1] == '1'):
        upp += d
        upp %= (x_1+1)
    d *= 2
    d %= (x_1 + 1)
d = 1
dow = 0
if(flag == 0):
    for i in range(n):
        do[i] = d
        if(x[n-i-1] == '1'):
            dow += d
            dow %= (x_1-1)
        d *= 2
        d %= (x_1 - 1)


for i in range(n):
    if(x[i] == '0'):
        sam = upp + up[n-i-1]
        sam %= (x_1+1)
        print(data[sam]+1)
    elif(flag == 0):
        sam = dow - do[n-i-1]
        sam %= (x_1-1)
        print(data[sam]+1)
    elif(flag == 2):
        print('0')
def exchange(btc):
  return 380000.0 / btc

n = int(input())
sum = 0.0
for i in range(n):
  a, b = input().split()
  if "JPY" in b:
    sum += float(a)
  else:
    sum += exchange(int(a))

print(sum)

### FIXED CODE ###

def exchange(btc):
  return 380000.0 * btc
 
n = int(input())
sum = 0.0
for i in range(n):
  a, b = input().split()
  if "JPY" in b:
    sum += float(a)
  else:
    sum += exchange(float(a))
 
print(sum)
from functools import reduce
import math
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
 
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
 
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
N = int(input().rstrip())
As = input().rstrip().split(" ")
As = [int(p) for p in As]
 
cand = lcm_list(As)
 
sum = 0
 
for num in As:
    sum = sum + cand // num
 
print(sum % (10**9 + 7))
from functools import reduce
import math
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
 
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
 
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
N = int(input().rstrip())
As = input().rstrip().split(" ")
As = [int(p) for p in As]
 
cand = lcm_list(As)
 
sum = 0
 
for num in As:
    sum = sum + cand // num
 
print(sum % int(1e9+7) )


### FIXED CODE ###

from functools import reduce
import fractions

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input().rstrip())
As = input().rstrip().split(" ")
As = [int(p) for p in As]

cand = lcm_list(As)

sum = 0

for num in As:
    sum = sum + cand // num

print(sum % int(1e9+7) )
n,k=map(int,input().split())
a=n//k
b=n%k
print(a+b)-a

### FIXED CODE ###

n,k=map(int,input().split())
if n%k!=0:
  print("1")
else:
  print("0")
N,A,B=list(map(int,inout().split()))
print(min(A*T, B))

### FIXED CODE ###

N,A,B=list(map(int,input().split()))
print(min(N*A, B))
N = int(input())
A = list(map(int, input().split()))
bottom = sum(A)

ret = 1
children = 1 - A[0]
bottom -= A[0]

for i in range(N):
    children = children * 2 - A[i+1]
    if children <= -1:
      ret = -1
      break
    
    bottom -= A[i+1]
    if children >= bottom:
      children = bottom
    ret += children + A[i+1]
print(ret)


### FIXED CODE ###

h1, m1, h2, m2, k=map(int, input().split())

print((h2-h1)*60+(m2-m1)-k)
N,M=map(int,input().split())
C={i for i in range(1,N+1)}

for _ in range(M):
    LR=list(map(int,input().split()))
    C=C&{k for k in range(max(LR[0],min(C)),min(LR[1]+1,max(C)+1))}
print(len(C))

### FIXED CODE ###

N,M=map(int,input().split())
LR=list(list(map(int,input().split())) for _ in range(M))
L=1
R=N
for i in range(M):
    L=max(L,LR[i][0])
    R=min(R,LR[i][1])
print(R-L+1 if L<=R else 0)
n = int(input())
a = map(int, input().split())
a = list(sorted(a))
big = a[n-1]
mark = [0]*big
for x in a:
  mark[x] += 1
  if mark[x] > 1:
    continue
  for j in range(x*2, big+1, x):
    mark[j] += 1

ans = 0
for x in a:
  if mark[x] == 1:
    ans += 1

print(ans)

### FIXED CODE ###

n = int(input())
a = map(int, input().split())
a = list(sorted(a))
big = a[n-1]
mark = [0]*(big+1)
for x in a:
    mark[x] += 1
    if mark[x] > 1:
        continue
    for j in range(x*2, big+1, x):
        mark[j] += 1

ans = 0
for x in a:
    if mark[x] == 1:
        ans += 1

print(ans)
h,w = map(int,input().split())
edges = '#' * (W+2)
ans = [edges]
for i in range(h):
  ans.append('#' + input() + '#')
ans.append(edges)
[print(i) for i in ans]

### FIXED CODE ###

h,w = map(int,input().split())
edges = '#' * (w+2)
ans = [edges]
for i in range(h):
  ans.append('#' + input() + '#')
ans.append(edges)
[print(i) for i in ans]
def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0
    
n, m=map(int, input().split(" "))
par = list(range(n + 1)) + [0 for i in range(200000)]
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 200000)]
#print(len(countpar), len(par))
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))


### FIXED CODE ###

import sys
import resource

def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0

sys.setrecursionlimit(10 ** 6)
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 1)]
#print(len(countpar), len(par))
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))
#print(countpar, par)
N = int(input())
A =map(int,input().split())
sum=0
for i in range(N):
  sum+=1/A[i]
print(1/sum)
  

### FIXED CODE ###

N = int(input())
A = input().split()
sum=0
for i in range(N):
  sum+=1/int(A[i])
print(1/sum)
from collections import deque
N,M = map(int, input().split())
edges = [[] for _ in range(N)]
c_max = 0
for i in range(M):
	p,q,c = map(int, input().split())
	c_max = max(c, c_max)
	edges[p-1] += [[q-1, c]]
	edges[q-1] += [[p-1, c]]
distance = [[float('inf')]*(c+1) for _ in range(N)]
distance[0][0] = 0
Q = deque([[0,0]])


flag = False
while Q:
	s_now,c_now = Q.popleft()
	for t, c in edges[s_now]:
		t_dist = min(distance[t])
		if t_dist > distance[s_now][c_now] + (c_now != c):
			distance[t][c] = distance[s_now][c_now] + (c_now != c)
			if c_now == c:
				Q.appendleft([t, c])
				continue
			Q.append([t, c])
d = min(distance[N-1])
print(d if d != float('inf') else -1)

### FIXED CODE ###

from collections import deque
N, M = map(int, input().split())
F_C_of_S = [{} for i in range(N)]
#Companies of Station
C_of_S = {}

#def Union-find
parent = [-1]*M
def root(x):
	if (parent[x] < 0): return x
	else:
		parent[x] = y = root(parent[x])
		return y

def unite(x, y):
	px = root(x)
	py = root(y)
	if (px == py): return False
	if (parent[px] > parent[py]):
		px = root(y)
		py = root(x)
	parent[px] += parent[py]
	parent[py] = px
	return True


#Union-find
pqcs = []
for i in range(M):
	p, q, c = map(int, input().split())
	p -= 1; q -= 1;
	pqcs += [(p, q, c)]
	
	#The first
	if not c in F_C_of_S[p]: F_C_of_S[p][c] = i
	#else
	else: unite(F_C_of_S[p][c], i)
	C_of_S.setdefault(p, set()).add(c)
	
	#The first
	if not (c in F_C_of_S[q]):F_C_of_S[q][c] = i
	#else
	else: unite(F_C_of_S[q][c], i)
	C_of_S.setdefault(q, set()).add(c)

#stations of company
S_of_C = {}
for i in range(M):
	p, q, c = pqcs[i]
	c_set = S_of_C.setdefault(root(i), set())
	c_set.add(p)
	c_set.add(q)


Q = deque([(0, 0, 0)])
#cost to go to the stations from station_0
dist = [float('inf')]*N
dist[0] = 0

gdist = [float('inf')]*M

while Q:
	cost, v, flag = Q.popleft()
	
	if not (flag):#(flag == 0) then gdist_update
		if (dist[v] < cost) or (v not in C_of_S):
			continue
		for l in F_C_of_S[v].values():
			l = root(l)
			if (cost < gdist[l]):
				gdist[l] = cost
				Q.appendleft((cost, l, 1))
	
	else:#(flag == 1) then dist_update
		if (gdist[v] < cost) or (v not in S_of_C):
			continue
		for s in S_of_C[v]:
			if (cost+1 < dist[s]):
				dist[s] = cost+1
				Q.append((cost+1, s, 0))

print(dist[N - 1] if dist[N - 1] < float('inf') else -1)
l, r = map(int, input().split())
num = list(range(l, r+1))
num_map = list(map(lambda j: j % 2019, num)) 
num_map.sort()
print(num_map[0]*num_map[1])

### FIXED CODE ###

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

ans = 2019
for i in range(l, r):
    for j in range(i+1, r+1):
        tmp = i*j % 2019
        if ans > tmp:
            ans = tmp
        if ans == 0:
            print(ans)
            exit(0)
print(ans)