Harryxun/stf_run huggingface dataset:
import numpy as np
s=input()
t=input()

ns=len(s)
nt=len(t)
dp=np.zeros((ns+1,nt+1),np.int64)
pp=np.full((ns+1,nt+1),'')
ppd={0:'c',1:'l',2:'u'}
for i in range(ns):
  for j in range(nt):
    a=np.array([dp[i][j]+1 if s[i]==t[j] else -1,dp[i+1][j],dp[i][j+1]])
    dp[i+1][j+1]=np.max(a)
    pp[i+1][j+1]=ppd[np.argmax(a)]

i=ns
j=nt
ans=[]
while i>0 and j>0:
  sw=pp[i][j]
  if sw=='c':
        i-=1
        j-=1
        ans.append(s[i])
  elif sw=='l':
        j-=1
  elif sw=='u':
        i-=1
ans1=''
for _ in range(len(ans)):
      ans1+=ans.pop()
print(ans1)


### FIXED CODE ###

import numpy as np
s=np.array(list(input()))
t=np.array(list(input()))
is_eq=np.array(s[:,None]==t[None,])
# is_eq[i][j]:sのi文字目とtのj文字目が等しいかどうか
# print(is_eq)
ns=len(s)
nt=len(t)
dp=np.zeros((ns+1,nt+1),np.int64)

# dp[i+1][j+1]:sのi文字目までとtのj文字目までで最長の部分列
# dp[0][j]=0,dp[i][0]=0,dp[n+1][w+1]の値がsとtで最長の部分列の長さ
for i in range(ns): #sのi文字目までの文字列で調査
    dp[i+1][1:]=np.maximum(dp[i][:-1]+is_eq[i],dp[i][1:])#左上からの更新、真上からの更新
    dp[i+1]=np.maximum.accumulate(dp[i+1])#左からの更新
i=ns
j=nt
ans=['']
while i>0 and j>0:
      if dp[i][j]==dp[i-1][j]:
            i-=1
      elif dp[i][j]==dp[i][j-1]:
            j-=1
      else:
            ans.append(s[i-1])
            i-=1
            j-=1
a=''
for _ in range(len(ans)):
      a+=ans.pop()
print(a)
s = input()
w = input()
print('safe' if s > w else 'unsafe')

### FIXED CODE ###

num = map(int,input().split())
a = []
for i in num:
    a.append(i)
if a[0]<a[1]:
    print('unsafe')
elif a[0]>a[1]:
    print('safe')
else:
    print('unsafe')
import bisect
inpl = lambda: list(map(int,input().split()))
N, K = inpl()
x = inpl()

infty = 10**9
c = bisect.bisect_left(x,0)
if x[c] > 0:
    K += 1
    N += 1
    x.insert(c,0)

if c >= K-1:
    turn = c-(K-1)
    ans = -x[turn]
    turn += 1
else:
    turn = 0
    ans = infty

while turn <= c and turn + K <= N:
    L = -x[turn]
    R = x[turn + K - 1]
    cur = L + R + min(L,R)
    if cur < ans:
        ans = cur
    turn += 1

print(ans)

### FIXED CODE ###

import bisect
inpl = lambda: list(map(int,input().split()))
N, K = inpl()
x = inpl()

infty = 10**9
c = bisect.bisect_left(x,0)
if c == N:
    print(-x[-K])
    exit()
elif x[c] > 0:
    K += 1
    N += 1
    x.insert(c,0)

if c >= K-1:
    turn = c-(K-1)
else:
    turn = 0

ans = infty
while turn <= c and turn + K <= N:
    L = -x[turn]
    R = x[turn + K - 1]
    cur = L + R + min(L,R)
    if cur < ans:
        ans = cur
    turn += 1

print(ans)
N,M=map(int,input().split())
P=10**9+7
def egcd(a, b):
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return (lastx, lasty, a)
def inv(x):
    return egcd(x,P)[0]
Fact=[0 for i in range(2*N+1)]
Finv=[0 for i in range(2*N+1)]
Fact[0]=1
Finv[0]=1
for i in range(2*N):
    Fact[i+1]=(Fact[i]*(i+1))%P
    Finv[i+1]=inv(Fact[i+1])%P
def C(n,k):
    return (Fact[n]*(Finv[k]*Finv[n-k])%P)%P
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
D=factorize(M)
ans=1
for seq in D:
    k=seq[1]
    ans=ans*C(k+N-1,N-1)
    ans=ans%P
print(ans)


### FIXED CODE ###

#http://nihaoshijie.hatenadiary.jp/entry/2018/02/03/115759
N,M=map(int,input().split())
P=10**9+7
def egcd(a, b):
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return (lastx, lasty, a)
def inv(x):
    return egcd(x,P)[0]
Z=2*10**5
Fact=[0 for i in range(Z+1)]
Finv=[0 for i in range(Z+1)]
Fact[0]=1
Finv[0]=1
for i in range(Z):
    Fact[i+1]=(Fact[i]*(i+1))%P
    Finv[i+1]=inv(Fact[i+1])%P
def C(n,k):
    return (Fact[n]*(Finv[k]*Finv[n-k])%P)%P
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
D=factorize(M)
ans=1
for seq in D:
    k=seq[1]
    ans=ans*C(k+N-1,N-1)
    ans=ans%P
print(ans)
x = int(input())
ans = 1
for b in range(1,x+1):
    for p in range(2,x+1):
        a = pow(b,p)
        if a > ans and a <= x:
            ans = a
        if a>x:
            break
    if a > x:
        continue
print(ans)

### FIXED CODE ###

x = int(input())
ans = 1
for b in range(1,x):
    for p in range(2,x):
        a = b**p
        if a == a // 1 and a > ans and a <= x:
            ans = a
        if a>x:
            break
    if a > x:
        continue
print(ans)
X = int(input())

y = int((X**0.2)//1 + 1)

def array(y):
    a = [0]
    for i in range(1,y+1):
        a.append(i**5)
        a.append(-i**5)
    a.sort()
    return a

a = array(y)

N = len(a)
for i in range(N-1):
    for j in range(i+1,N):
        if a[j] - a[i] == X:
            A,B = -y+j, -y+i

print(A,B)

### FIXED CODE ###

X = int(input())

y = int((X**0.2) //1 + 1)

def array(y):
    a = [0]
    for i in range(1,y+1):
        a.append(i**5)
        a.append(-i**5)
    a.sort()
    return a

y = y*2
a = array(y)

N = len(a)
for i in range(N-1):
    for j in range(i+1,N):
        if a[j] - a[i] == X:
            A,B = -y+j, -y+i

print(A,B)
mod = 998244353
N = int(input())
A = list(map(int,input().split()))
D = [1 for _ in range(max(A)+1)]
if N == 1:
    if A[0] == 0:
        print(1)
        exit()
    else:
        print(0)
        exit()

D[1] = A.count(1)
ans = 1
if A[0] > 0 or D[0] > 1:
    print(0)
else:
    for i in range(2,max(A)+1):
        D[i] = A.count(i)
        ans *= (D[i-1]**D[i])%mod
    print(ans)

### FIXED CODE ###

N = int(input())
if N%2 == 0:
    print(N//2 - 1)
else:
    print(N//2)
N=int(input())
a=[list(map(int,input().split())) for i in range(N)]
flag=False
for cx in range(101):
    if flag:
        break
    for cy in range(101):
        if flag:
            break
        for i in range(N):
            if a[i][0]!=0:
                if i==0:
                    H=a[i][2]+abs(cx-a[i][0])+abs(cy-a[i][1])
                if H!=a[i][2]+abs(cx-a[i][0])+abs(cy-a[i][1]):
                    break
            if i==N-1:
                x=cx
                y=cy
                flag=True
print(x,y,H)

### FIXED CODE ###

N=int(input())
a=[list(map(int,input().split())) for i in range(N)]
flag=False
for cx in range(101):
    if flag:
        break
    for cy in range(101):
        count=0
        if flag:
            break
        for i in range(N):
            if a[i][2]!=0:
                if count==0:
                    H=a[i][2]+abs(cx-a[i][0])+abs(cy-a[i][1])
                    count+=1
                if H!=a[i][2]+abs(cx-a[i][0])+abs(cy-a[i][1]):
                    break
            if i==N-1:
                x=cx
                y=cy
                flag=True
                for k in range(N):
                    if a[k][2]!=max(H-abs(x-a[k][0])-abs(y-a[k][1]),0):
                        flag=False
print(x,y,H)
N = int(input())
A = list(map(int, input().split()))
List = [0]*N


for i, a in enumerate(A):
  ret[int(a)-1] = str(i+1)

  
print(" ".join(ret))





### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
List = [0]*N


for i, a in enumerate(A):
  List[int(a)-1] = str(i+1)

  
print(" ".join(List))
n, q = map(int, input().split())
S = input()
 
counts = [0 for i in range(n)]
cnt = 0
 
for i in range(n):
  if (S[i-1:i+1] == "AC":)
    cnt += 1
    counts[i] = cnt
    
for i in range(q):
    l, r = map(int, input().split())
    print(counts[r-1] - counts[l-1])

### FIXED CODE ###

n, q = map(int, input().split())
S = input()
 
counts = [0 for i in range(n)]
cnt = 0
 
for i in range(n):
  if S[i-1:i+1] == "AC":
    cnt += 1
  counts[i] = cnt
    
for i in range(q):
    l, r = map(int, input().split())
    print(counts[r-1] - counts[l-1])
A,V = map(int,input().split())
1 2
B,W = map(int,input().split())
3 1
T = int(input())
3

if V <= W:
	print("NO")
else:
	if abs((B-A))/(V-W) <= T:
		print("YES")
	else:
		print("NO")

### FIXED CODE ###

A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if V <= W:
	print("NO")
else:
	if abs((B-A))/(V-W) <= T:
		print("YES")
	else:
		print("NO")
N = int(input())

import math
print(math.factorial(N) % big)

### FIXED CODE ###

N = int(input())
big = 10 ** 9 + 7
import math
print(math.factorial(N) % big)
a= list(map(int, input().split()))
if a[0]<10:
  print(a[1]-100*(10-a[0])
else:
  print(a[1])

### FIXED CODE ###

a = list(map(int, input().split()))
if a[0]< 10:
    print (a[1]+100*(10-a[0]))
else:
    print (a[1])
import sys
a = input()
print(a+a^2+a^3)

### FIXED CODE ###

a = int(input())
print(a+a**2+a**3)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, m = map(int, readline().split())
#n, m = map(int, input().split())

acCount = 0
waCount = 0
check = [0] * n
waCheck = [0] * n

for i in range(m):
    p, s = map(str, input().split())
    # print(p,s)
    p = int(p)
    if (check[p - 1] == 0):
        if (s == 'WA'):
            waCheck[p - 1] += 1

        else:
            acCount += 1
            waCheck += waCheck[p - 1]

            check[p - 1] = 1
    else:
        continue

print(acCount, waCount)


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, m = map(int, readline().split())
#n, m = map(int, input().split())

acCount = 0
waCount = 0
check = [0] * n
waCheck = [0] * n

for i in range(m):
    p, s = map(str, input().split())
    # print(p,s)
    p = int(p)
    if (check[p - 1] == 0):
        if (s == 'WA'):
            waCheck[p - 1] += 1

        else:
            acCount += 1
            waCount += waCheck[p - 1]

            check[p - 1] = 1
    else:
        continue

print(acCount, waCount)
(a, b, c) = [int(i) for i in input().split()]
cnt = 0
for i in range(a, b + 1):
    if (c % i) == 0:
        cnt = cnt + 1
print(cnt)

### FIXED CODE ###

while True:
    (x, y) = [int(i) for i in input().split()]

    if x == 0 and y == 0:
        break
    if x >= y:
        print(y, x)
    else:
        print(x, y)
A, B, K = input().split()

Takahashi = int(A)
Aoki = int(B)
count = int(K)

t = 0

for i in range(count):
    Takahashi = Takahashi-1
    t = t+1
    if t == count:
        break
    elif Takahashi < 0:
        Takahashi = 0
        Aoki = Aoki-1
        t = t+1
        if Aoki == 0:
            print(Takahashi, Aoki)
            break
    else:
        continue


print(Takahashi, Aoki)

### FIXED CODE ###

word1, word2 = input().split()

print(word2 + word1)
x, y = map(int, input().split(' '))
print('{} {}'.format(a*b, 2(a+b)))

### FIXED CODE ###

a, b = map(int, input().split(' '))
print('{} {}'.format(a*b, 2*(a+b)))
S = int(input())
W = int(input())
if W >= S :
    print('unsafe')
else :
    print('safe')

### FIXED CODE ###

S,W = map(int,input().split(' '))
if W >= S :
    print('unsafe')
else :
    print('safe')
import numpy as np

r = float(input())
print(2*r*np.pi, (r**2)*np.pi)


### FIXED CODE ###

r = float(input())

pi = 3.141592653589793
print(pi*r**2, 2*pi*r)
a,b,c=input().split()
print(a[0]+b[0]+c[0].upper)

### FIXED CODE ###

a,b,c=input().split()
print((a[0]+b[0]+c[0]).upper())
a , b = map(int, input().split())
c= a*b 
c=c%2
if c==1:
  print(Odd)
else:
  print(Even)
  

### FIXED CODE ###

a , b = map(int, input().split())
c= a*b 
c=c%2
if c==1:
  print("Odd")
else:
  print("Even")
h,w= map(int, input().split())
a = []
for i in range(h):
    li = input()
    a.append(li)
t = []
for i in range(h):
    t.append([-1]*w)
x = []
for i in range(h):
    for j in range(w):
        if a[i][j] == '#':
            t[i][j] = 0
            x.append((i,j))
ans = 0
y = ans
while True:
    # print("ans"+str(ans))
    y += 1
    xx = []
    for p in x:
        pp = [(p[0]-1, p[1]), (p[0]+1, p[1]), (p[0], p[1]-1), (p[0], p[1]+1)]
        for ppp in pp:
            if (0 <= ppp[0] < w) and (0 <= ppp[1] < h):
                if t[ppp[0]][ppp[1]] == -1:
                    t[ppp[0]][ppp[1]] = ans
                    xx.append((ppp[0], ppp[1]))
    x = xx
    if len(x) == 0:
        break
    ans += 1
    # print(x)
print(ans)

### FIXED CODE ###

h,w= map(int, input().split())
a = []
x = []
for i in range(h):
    li = input()
    aa = []
    for j in range(w):
        aa.append(li[j])
        if aa[j] == '#':
            x.append((i, j))
    a.append(aa)
ans = 0
while True:
    xx = []
    for p in x:
        pp = [(p[0]-1, p[1]), (p[0]+1, p[1]), (p[0], p[1]-1), (p[0], p[1]+1)]
        for ppp in pp:
            if (0 <= ppp[0] < h) and (0 <= ppp[1] < w):
                if a[ppp[0]][ppp[1]] == '.':
                    a[ppp[0]][ppp[1]] = '#'
                    xx.append((ppp[0], ppp[1]))
    x = xx
    if len(x) == 0:
        break
    ans += 1
    # print(x)
print(ans)
a= input()
b = input().split()
s = 0
for i in range(0,len(b)):
               s+=int(b[i])
if s-max(b)>max(b):
  print("Yes")
else:
  print("No)

### FIXED CODE ###

a= input()
b = input().split()
b = [int(s) for s in b]
s = 0
for i in range(0,len(b)):
    s+=int(b[i])
if s-int(max(b))>int(max(b)):
    print("Yes")
else:
    print("No")
a, b, k = map(int, input().split())

s = []

for i in range(1, max(a, b)):
    if a % i == 0 and b % i == 0:
        s.append(i)

sorted(s)

print(s[len(s) - k])


### FIXED CODE ###

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

s = []

for i in range(1, max(a, b)+1):
    if a % i == 0 and b % i == 0:
        s.append(i)

sorted(s)

s = s[::-1]

print(s[k-1])
S = input()
assert S == ("ABC" or "ARC"), "Sは、ABCまたはARCです"
if S == "ABC":
    print("ARC")
else:
    print("ABC")

### FIXED CODE ###

S = input()
assert S == "ABC" or "ARC", "Sは、ABCまたはARCです"
if S == "ABC":
    print("ARC")
else:
    print("ABC")
import numpy as np
from scipy.sparse import csgraph
H, W = map(int, input().split())
maze = np.array([c == "." for c in "".join(input() for _ in range(H))], dtype=np.bool)
array = np.zeros((H * W, H * W), dtype=np.bool)
N = np.arange(H * W)
R, C = np.divmod(N, W)
c_i = N[maze[N] & (C > 0) & maze[N - 1]]
r_i = N[maze[N] & (R > 0) & maze[N - W]]
array[c_i, c_i - 1] = 1
array[c_i - 1, c_i] = 1
array[r_i, r_i - W] = 1
array[r_i - W, r_i] = 1
dist = csgraph.shortest_path(array)
print(int(dist[dist < 401].max()))


### FIXED CODE ###

import numpy as np
from scipy.sparse import csgraph
H, W = map(int, input().split())
maze = "".join(input() for _ in range(H))
array = np.zeros((H * W, H * W), dtype=np.bool)
for n in range(H * W):
    if maze[n] == "#":
        continue
    r, c = divmod(n, W)
    if c and maze[n - 1] == ".":
        array[n][n - 1] = 1
    if c != W - 1 and maze[n + 1] == ".":
        array[n][n + 1] = 1
    if r and maze[n - W] == ".":
        array[n][n - W] = 1
    if r != H - 1 and maze[n + W] == ".":
        array[n][n + W] = 1
dist = csgraph.shortest_path(array, directed=False)
print(int(dist[dist < 401].max()))
import sys
S = input()
K = int(input())
result = [0,0]
for i in len(s):
  if S[i] != 1:
    result[0] = i+1
    result[1] = S[i]
print(1 if K<result[0] else result[1] )


### FIXED CODE ###

import sys
S = input()
K = int(input())
result = [0,""]
for i in S:
  if i != "1":
    result[1] = i
    break
  else:
    result[0] += 1
print(1 if K<=result[0] else result[1] )
X = int(input())
tab = set([])
for i in range(1,X+1):
    for j in range(2,X+1):
        if i**j <= X:
            tab.add(i**j)
        else:
            break
print(max([i for i in tab]))

### FIXED CODE ###

X = int(input())
tab = set([])
for i in range(1,1000):
    for j in range(2,1000):
        if i**j <= 1000:
            tab.add(i**j)
        else:
            break

print(max([i for i in tab if i <= X]))
import sys
from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

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

# cl = [0 for i in range(n)]
cl = []
ll = [x for x in set(l) if l.count(x) > 1]

# print(ll)

if not ll:
    for i in range(n):
        print(0)
    sys.exit()

sum = 0
for i in ll:
    m = l.count(i)
    nc = combinations_count(m, 2)
    sum += nc
    # print(nc)
    # cl[i-1] = nc - int(nc*(m-2)/m)
    cl.append(nc - int(nc * (m - 2) / m))

# print(sum)
# print(cl)
for i in l:
    # print(sum - cl[i-1])
    print(sum - cl[ll.index(i)])


### FIXED CODE ###

import collections

def combinations_count(n, r):
    return n * (n-1) // r


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

l1 = []
l2 = []
c = collections.Counter(l)

total = sum([combinations_count(i, 2) for i in c.values()])

for a in l:
    print(total-combinations_count(c[a], 2)+combinations_count(c[a]-1, 2))
n, k, x, y = int(input())

if n > k :
  print(k*x+(n-k)*y)
else:
  print(n*x)


### FIXED CODE ###

n = int(input())
k = int(input())
x = int(input())
y = int(input())
 
if n <= k :
  print(n * x)
else :
  print(k * x + (n - k) * y)
import numpy as np
H,W = map(int,input().split())
table = [["."]*(W+2),]
for _ in range(H):
    table.append([".",]+list(input())+[".",])
table.append(["."]*(W+2))
table = np.array(table)
ans = []
#print(table)
for h in range(H):
    for w in range(W):
        mawari = table[h:h+3,w:w+3]
        #print(mawari)
        if mawari[1,1] == ".":
            ans.append(np.count_nonzero(mawari=="#"))
        else:
            ans.append("#")
ans = np.array(ans).reshape(H,W)
#print(ans)
for i in ans:
    print("".join(i))


### FIXED CODE ###

import numpy as np
H,W = map(int,input().split())
table = [["."]*(W+2),]
for _ in range(H):
    table.append([".",]+list(input())+[".",])
table.append(["."]*(W+2))
table = np.array(table)
ans = []
#print(table)
for h in range(H):
    for w in range(W):
        mawari = table[h:h+3,w:w+3]
        #print(mawari)
        if mawari[1,1] == ".":
            ans.append(np.count_nonzero(mawari=="#"))
        else:
            ans.append("#")
ans = np.array(ans).reshape(H,W).astype(np.unicode)
for i in ans:
    print("".join(i))
import fractions


def main():
    a = list(map(int, input().split()))
    b = fractions.gcd(a[0], a[1])
    c = b
    for i in range(a[2]-1):
        while True:
            c -= 1
            if b % c == 0:
                break
    print(c)


main()

### FIXED CODE ###

a = list(map(int, input().split()))
b = a[1]//a[0]
print(b if b < a[2] else a[2])
a = list(input())
b = list(input())
ar = []
if len(a) == len(b):
	for i in range(len(a)):
      ar.append(a[i])
      ar.append(b[i])
else:
  	for i in range(len(b)):
      ar.append(a[i])
      ar.append(a[i])
    ar.append(a[len(a)-1])
print("".join(ar))
   

### FIXED CODE ###

a = list(input())
b = list(input())
ar = []
if len(a) == len(b):
    for i in range(len(a)):
        ar.append(a[i])
        ar.append(b[i])
else:
    for i in range(len(b)):
        ar.append(a[i])
        ar.append(b[i])
    ar.append(a[len(a)-1])
print("".join(ar))
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split))
ans = 0
temp1 = t - h[0] * 0.006
for i in range(a,n):
    temp2 = t - h[i] * 0.006
    if abs(temp1-a) > abs(temp2-a):
        ans = i
        temp1 = temp2
print(ans)

### FIXED CODE ###

n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = 1
temp1 = t - h[0] * 0.006
for i in range(1,n):
    temp2 = t - h[i] * 0.006
    if abs(temp1-a) > abs(temp2-a):
        ans = i + 1
        temp1 = temp2
print(ans)
n,y=map(int,input().split())
y=y/1000
count=0
for i in range(y/10):
    for j in range(int(y-10*i)):
        for k in range(int(y-10*i-5*j)):
            if i+5*j+10*k==y:
                print(str(k)+" "+str(j)+" "+str(i))
                count=1
                break
        if count==1:
            break
    if count==1:
        break
if count==0:
    print("-1 -1 -1")

### FIXED CODE ###

n,y=map(int,input().split())
y=y/1000
count=0
for i in range(min(int(y/10),n)+1):
    for j in range(min(int((y-10*i)/5),n-i)+1):
        if 10*i+5*j+n-i-j==y:
            print(str(i)+" "+str(j)+" "+str(n-i-j))
            count=1
            break
        elif 10*i+5*j+n-i-j>y:
            break
    if count==1:
        break
if count==0:
    print("-1 -1 -1")
import numpy as np

n, m = map(int, input().split())
edge_l = []
edge_r = []
edge_c = []
for _ in range(m):
  l, r, c = map(int, input().split())
  edge_l.append(l - 1)
  edge_r.append(r - 1)
  edge_c.append(c)
l = np.array(edge_l, dtype=np.int)
r = np.array(edge_r, dtype=np.int)
c = np.array(edge_c, dtype=np.int)

dp = np.ones(n, dtype=np.int) * (c.sum() + 1)
dp[0] = 0
active = np.zeros(n, dtype=np.bool)
active[0] = True
while np.any(active):
  act = np.argmax(active)
  use = (l <= act) * (r > act)
  dp[r] = np.minimum(np.min(dp[r[use]] + c[use]), dp[r])
  active[act] = False
  
if dp[-1] > c.sum():
  print(-1)
else:
  print(dp[-1])

### FIXED CODE ###

import heapq

n, m = map(int, input().split())
edge = [[]] + [[(0, i)] for i in range(n-1)]
for _ in range(m):
  l, r, c = map(int, input().split())
  edge[l-1].append((c, r-1))

inf = 1 << 60
dp = [0] + [inf] * (n - 1)
queue = [(0, 0)]
check = [False] * n
while queue and not check[-1]:
  dist, act = heapq.heappop(queue)
  check[act] = True
  for cost, vertex in edge[act]:
    if check[vertex]:
      continue
    d = dist + cost
    if dp[vertex] > d:
      heapq.heappush(queue, (d, vertex))
      dp[vertex] = d
if dp[-1] < inf:
  print(dp[-1])
else:
  print(-1)
N = int(raw_input())

h = N / 3600
m = N - 3600*h
s = m % 60
m = m - s

N = str(h) + ???:??? + str(m) + ???:??? + str(s)
print N

### FIXED CODE ###

S = int(raw_input())

h = S / 3600
m = S - 3600*h
s = m % 60
m = (m - s)/60

print str(h) + ":" + str(m) + ":" + str(s)
class BIT:
    def __init__(self, N):
        self.size = N
        self.tree = [0] * (N + 1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

    def __str__(self):
        return "BIT: [{}]".format(
            ", ".join(str(self.sum(i + 1) - self.sum(i))
                      for i in range(self.size))
        )

    def bisect_left(self, r):
        bit = self.tree

        if r == 0:
            return 0

        l = 1 << (r.bit_length() - 1)
        if r == l:
            l //= 2

        k = l // 2
        while r - l >= 1:
            if bit[r] > bit[l]:
                l += max(1, k)
            else:
                r = l
                l //= 2
            k //= 2

        return r if bit[r] > bit[l] else l


N, *A = map(int, open(0))

memo = {a: i for i, a in enumerate(sorted(set(A)), 1)}
B = [memo[a] for a in A]
M = len(memo)
bit = BIT(M)
for b in B:
    i = bit.bisect_left(b - 1)
    if i != 0:
        bit.add(i, -1)
    bit.add(b, 1)

print(bit.sum(M))


### FIXED CODE ###

from bisect import bisect_right

N = int(input())
A = [int(input()) for _ in range(N)]
A.reverse()

L = [A[0]]
for a in A[1:]:
    if a >= L[-1]:
        L.append(a)
    else:
        L[bisect_right(L, a)] = a

print(len(L))
s=("sunny","cloudy","rainy")
print(s[(s.index(input())+1)%3])

### FIXED CODE ###

s=("Sunny","Cloudy","Rainy")
print(s[(s.index(input())+1)%3])
a, b = gets.chomp.split(" ").to_i
if a < b
    puts "a < b"
elif a > b
    puts "a > b"
else
    puts "a == b"

### FIXED CODE ###

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

if a > b:
    print "a > b"
elif a < b:
    print "a < b"
else:
    print "a == b"