Harryxun/stf_run huggingface dataset:
def find_lcd(A,B):
  if A==B:
    return A
  else:
    return find_lcd(min(A,B), abs(A-B))
  
def find_num_prime(X):
  if X==1:
    return 1
  count = 1 # 1
  i=2
  while X != 1:
    if X%i == 0:
      count += 1
      while X%i == 0:
        #print(str(X)+' '+str(i))
        X = X/i
    i += 1
  return count
  
A,B = map(int, input().split())
lcd=find_lcd(A,B)
#print(lcd)
print(find_num_prime(lcd))

### FIXED CODE ###

def find_lcd(A,B):
  if A==1 or B==1:
    return 1
  if A==B:
    return A
  else:
    return find_lcd(min(A,B), abs(A-B))
  
def find_num_prime(X):
  if X==1:
    return 1
  count = 1 # 1
  i=2
  sqrt_org=int(X**0.5)
  while X != 1:
    if i**2 > X:
      count += 1
      break
    if X%i == 0:
      count += 1
      while X%i == 0:
        #print(str(X)+' '+str(i))
        X = int(X/i)
    if i== 2:
      i += 1
    else:
      i += 2
  return count
  
A,B = map(int, input().split())
lcd=find_lcd(A,B)
#print(lcd)
print(find_num_prime(lcd))
N = int(input())

if N in 7:
    print(Yes)
else:
    print(No)


### FIXED CODE ###

N = input()

if "7" in N:
    print("Yes")
else:
    print("No")
import math
 
a,b,n = map(int,input().split())
 
ans = list()
for x in range(n+1):
    c = math.floor(a*x / b) - a * math.floor(x/b)
    ans.append(c)
 
print(max(ans))

### FIXED CODE ###

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

ans = "NG"

for i in range(b,c+1):
    if i % a == 0:
        ans = "OK"

print(ans)
x, y, a, b, c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
r.sort()
ans = 0
n = x+y
ma = [-1, -1, -1]
for i in range(n):
    if p:
        ma[0] = p[-1]
    if q:
        ma[1] = q[-1]
    if r:
        ma[2] = r[-1]

    if ma.index(max(ma)) == 0:
        if x:
            x -= 1
            ans += p[-1]
            p.pop()
        else:
            if r:
                if q:
                    if r[-1] > q[-1]:
                        y -= 1
                        ans += r[-1]
                        r.pop()
                    else:
                        y -= 1
                        ans += q[-1]
                        q.pop()
                else:
                    y -= 1
                    ans += r[-1]
                    r.pop()
            else:
                y -= 1
                ans += q[-1]
                q.pop()
    elif ma.index(max(ma)) == 1:
        if y:
            y -= 1
            ans += q[-1]
            q.pop()
        else:
            if r:
                if p:
                    if r[-1] > p[-1]:
                        x -= 1
                        ans += r[-1]
                        r.pop()
                    else:
                        x -= 1
                        ans += p[-1]
                        p.pop()
                else:
                    x -= 1
                    ans += r[-1]
                    r.pop()
            else:
                x -= 1
                ans += p[-1]
                p.pop()
    else:
        if p[-1] > q[-1]:
            if y:
                y -= 1
            else:
                x -= 1
        else:
            if x:
                x -= 1
            else:
                y -= 1
        ans += r[-1]
        r.pop()
print(ans)

### FIXED CODE ###

x, y, a, b, c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
p = p[:x]
q = q[:y]
ap = p + q + r
ap.sort(reverse=True)
print(sum(ap[:x+y]))
import sys
input = sys.stdin.readline
n=int(input())
cntm=0
for i in range(1,n+1):
    a=i
    cnt=0
    while a%2==0:
        a//=2
        cnt+=1
    if cntm<cnt:
        ans=i
        cntm=cnt
print(ans)


### FIXED CODE ###


n=int(input())
cntm=0
ans=1
for i in range(1,n+1):
    a=i
    cnt=0
    while a%2==0:
        a//=2
        cnt+=1
    if cntm<cnt:
        ans=i
        cntm=cnt
print(ans)
import math
A,B = (int(i) for i in input().split())
g = math.gcd(A,B)
print(A*B//g)


### FIXED CODE ###

A,B = (int(i) for i in input().split())
def gcd(a,b):
    if a % b == 0:
        return b
    else:
        r = a% b
        return gcd(b,r)
print(A*B//gcd(A,B))
n, w = map(int, input().split())
nums = [list(map(int, input().split())) for _ in range(n)]

total_v = sum(nums[1])
dp = [[float('inf') for _ in range(total_v+1)] for _ in range(n)]
dp[0][0] = 0

for i in range(1, n+1):
  for j in range(total_v+1):
    if j < nums[i-1][1]:
      dp[i][j] = dp[i-1][j]
    else:
      dp[i][j] = min(dp[i-1][j], dp[i-1][j-nums[i-1][1]] + nums[i-1][0])
for i in range(total_v, -1, -1):
  if dp[-1][i] <= w:
    print(i)
    break

### FIXED CODE ###

n, w = map(int, input().split())
nums = []
for _ in range(n):
  nums.append(list(map(int, input().split())))
  
total_v = sum(nums[i][1] for i in range(n))

dp = [[float('inf') for _ in range(total_v+1)] for _ in range(n+1)]
dp[0][0] = 0

for i in range(1, n+1):
  for j in range(total_v+1):
    if j < nums[i-1][1]:
      dp[i][j] = dp[i-1][j]
    else:
      dp[i][j] = min(dp[i-1][j], dp[i-1][j-nums[i-1][1]] + nums[i-1][0])
for i in range(total_v, -1, -1):
  if dp[n][i] != float('inf') and dp[n][i] <= w:
    print(i)
    break
N=int(input())

X=int(N/1.08)
if int(X*1.08)==N:
    print(X)
else
    print(":(")

### FIXED CODE ###

N=int(input())

X=int(N/1.08)
if int(X*1.08)==N:
    print(X)
elif int((X+1)*1.08)==N:
    print(X+1)
else:
    print(":(")
S = list(input())
ans = 0
count = 0
for i in len(S):
    if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
        count += 1
    else:
        if ans < count:
            ans = count
        else:
            pass
        count = 0
print(ans)

### FIXED CODE ###

S = list(input())
ans = 0
count = 0
for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
        count += 1
    else:
        if ans < count:
            ans = count
        else:
            pass
        count = 0
if ans < count:
    ans = count
else:
    pass
print(ans)
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		int[] I = new int[N];
		int D = 0;
		int E = 0;
		int F = 0;
		int G = 0;
		int ans = 0;

		for(int i=0;i<N;i++){
			int a = s.nextInt();
			int b = s.nextInt();
			int c = s.nextInt();

			int n = a + b + c;
			I[i] = n;
		}
		for(int j=0;j<N;j++){
			int d = I[j];
			if(d==9){
				if(D!=1){
					D += 1;
				}else{
					ans += 1;
				}
			}
			if(d==8){
				if(E!=1){
					E += 1;
				}else{
					ans += 1;
				}
			}
			if(d==7){
				if(F!=1){
					F += 1;
				}else{
					ans += 1;
				}
			}
			if(d==6){
				if(G!=1){
					G += 1;
				}else{
					ans += 1;
				}
			}
		}
		System.out.println(ans);
	}
}

### FIXED CODE ###

N = int(input())
l = []
s = set()
for i in range(N):
	a,b,c = map(int,input().split(' '))
	l.append(a)
	l.append(b)
	l.append(c)
	l.sort()
	d = str(l[0])
	e = str(l[1])
	f = str(l[2])
	g = d + e + f
	s.add(g)
	l = []
print(N - len(s))
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append([a-1,b-1])
if n==2:
    print(0)
    exit()


def f(x,y,c):
    c += 1
    for e in edge[x]:
        if e != y:
            #if c > d:
            #used[e] = 1
            f(e,x,c)


if k % 2 == 0:
    d = k//2
    res = []
    for i in range(n):
        used = [0]*n
        f(i,-1,0)
        res.append(sum(used))
    print(min(res))
else:
    d = (k-1)//2
    res = []
    for e1 in alledge:
        nag = [0]*n
        used = [0]*n
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        res.append(sum(used))
    print(min(res))


### FIXED CODE ###

import sys
#input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append((a-1,b-1))

def f(x,y,c):
    global tmp
    c += 1
    for e in edge[x]:
        if e == y:
            continue
        if c > d:
            tmp +=1
        f(e,x,c)

sys.setrecursionlimit(4100000)

if k % 2 == 0:
    d = k//2
    ass = 2001
    for i in range(n):
        tmp = 0
        f(i,-1,0)
        ass = min(ass,tmp)
    print(ass)
else:
    d = (k-1)//2
    ass = 2001
    for e1 in alledge:
        tmp = 0
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        ass = min(ass,tmp)
    print(ass)
n=int(input())
a=int(input())
b=int(input())
print('Hello World' if n==1 else a+b)

### FIXED CODE ###

n=int(input())
if n==1:
  print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)
a,b = map(int,input().split())

print(6-a+b)

### FIXED CODE ###

a = int(input())
b = int(input())

print(6-(a+b))
import sys

sys.setrecursionlimit(20000000)


a,b=[int(i) for i in input().split()]
import math
print(a*b//math.gcd(a,b))

### FIXED CODE ###

import sys
sys.setrecursionlimit(20000000)
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

a,b=[int(i) for i in input().split()]

print(a*b//gcd(a,b))
T = input()

if T >= 30:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

T = int(input())
if T >= 30:
    print("Yes")
else:
    print("No")
while True:
    try:
        b = input()
    except:
        break
    if 'the' in c or 'this' in c or 'that' in b:
        print(c)
    for i in range(1,26):
        c = ''
        for j in b:
            if(j == 'z'):
                c += ('a')
            elif(str.isalpha(j) == 1):
                c += (chr(ord(j) + 1))
            else:
                c += j
        if 'the' in c or 'this' in c or 'that' in c:
            print(c)
            break
        b = c

### FIXED CODE ###

while True:
    try:
        b = input()
    except:
        break
    if 'the' in b or 'this' in b or 'that' in b:
        print(b)
    for i in range(1,26):
        c = ''
        for j in b:
            if(j == 'z'):
                c += ('a')
            elif(str.isalpha(j) == 1):
                c += (chr(ord(j) + 1))
            else:
                c += j
        if 'the' in c or 'this' in c or 'that' in c:
            print(c)
            break
        b = c
import math
t = input().split()
t = [int(i) for i in t]
r = math.sqrt(t[0]*t[0]+ t[1]*t[1])
h = t[2]
m = t[3]
if (h == 12):
    h = 0
if (m == 60):
    m = 0
hour_angle = 0.5 * (h * 60 + m) 
minute_angle = 6 * m 
angle = abs(hour_angle - minute_angle) 
angle = min(360 - angle, angle)
print(math.sqrt(r*r - 2*t[0]*t[1]*math.cos(angle(2*math.pi/360))))

### FIXED CODE ###

import math
t = input().split()
t = [int(i) for i in t]
r = math.sqrt(t[0]*t[0]+ t[1]*t[1])
h = t[2]
m = t[3]
if (h == 12):
    h = 0
if (m == 60):
    m = 0
hour_angle = 0.5 * (h * 60 + m) 
minute_angle = 6 * m 
angle = abs(hour_angle - minute_angle) 
angle = min(360 - angle, angle)
print(math.sqrt(r*r - 2*t[0]*t[1]*math.cos(angle*(2*math.pi/360))))
a,b,c = map(int,input().split)
P = set([a,b,c])
if len(P) == 2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c = map(int,input().split())
P = set([a,b,c])
if len(P) == 2:
  print('Yes')
else:
  print('No')
a = int(input())
b = int(input())

x = a * b
if x % 2 == 0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

i = list(map(int, input().split()))

x = i[0] * i[1]
if x % 2 == 0:
  print("Even")
else:
  print("Odd")
N, M = map(int, input().split())
s1 = set()
s2 = set()

for _ in range(M):
    a, b = map(int, input().split())
    if a == 1:
        s1.add(b)
    if b == N:
        s2.add(a)

for x in s1:
    if s2.count(x) >= 1:
        print("POSSIBLE")
        exit()

print("IMPOSSIBLE")


### FIXED CODE ###

N, M = map(int, input().split())
s1 = set()
s2 = set()

for _ in range(M):
    a, b = map(int, input().split())
    if a == 1:
        s1.add(b)
    if b == N:
        s2.add(a)

if len(s1.intersection(s2)) > 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
N,M,X=map(int,input().split())
A+=list(input())
s=0
z=0
for j in range(M):
  if A[j]>X:
    s+=1
  elif A[j]<X:
    z+=1
print(min(s,z))



### FIXED CODE ###

N,M,X=map(int,input().split())
A=[]
A+=list(map(int,input().split()))
s=0
z=0
for j in range(M):
    if A[j]>X:
        s+=1
    elif A[j]<X:
        z+=1
print(min(s,z))
if __name__="__main__":
 print(x**3)

### FIXED CODE ###

x=int(input())
print(x**3)
h,w,m = map(int,input().split())
hli = [0]*h
wli = [0]*w
li = []
for i in range(m):
    a,b = map(int,input().split())
    li.append([a,b])
    hli[a-1] += 1
    wli[b-1] += 1
a = max(hli)
b = max(wli)
hli2 = []
wli2 = []
for i in range(h):
    if hli[i] == a:
        hli2.append(i+1)
for i in range(w):
    if wli[i] == b:
        wli2.append(i+1)
for i in hli2:
    for j in wli2:
        if [i,j] not in li:
            print(a + b)
            exit()
print(a + b - 1)

### FIXED CODE ###

n,x,t = map(int,input().split())
if n % x == 0:
    print(n//x*t)
else:
    print((n//x+1)*t)
def get_cubic(x):
    return x ** 3

if __name__ == '__main__':
    x = int(input())
    print(x_cubic(x))



### FIXED CODE ###

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

if V <= W:
	print("NO")
else:
	if (B-A)/(W-T) <= 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")
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (1/(4*M))*N
F = m.split(' ')
X = []
for item in f:
	votes = int(item)
	X.append(votes)
X.sort(reverse = True)
print("No")
for i in range(M):
	if X[i]<C:
		print("No")
		return
print("Yes")

### FIXED CODE ###

l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
F = m.split(' ')
X = []
 
for item in F:
  votes = int(item)
  X.append(votes)

S = sum(X)
C = (S/(4*M))
X.sort(reverse=True)
if X[M-1]<C:
  print("No")
else:
  print("Yes")
MOD=998244353
n,s=map(int,input().split())
a=list(map(int,input().split()))
al=sum(a)
dp=[[0]*(al+1) for i in range(n+1)]
dp[0][0]=1
for i in range(n):
    for j in range(al+1):
        if j==0:
            dp[i+1][j]=pow(2,i+1,MOD)
            continue
        dp[i+1][j]=(dp[i+1][j]+(dp[i][j]*2%MOD))%MOD
        if j-a[i]>=0:
            dp[i+1][j]=(dp[i+1][j]+dp[i][j-a[i]])%MOD
print(dp[n][s])

### FIXED CODE ###

MOD=998244353
n,s=map(int,input().split())
a=list(map(int,input().split()))
al=sum(a)
dp=[[0]*3001 for i in range(n+1)]
dp[0][0]=1
for i in range(n):
    for j in range(3001):
        if j==0:
            dp[i+1][j]=pow(2,i+1,MOD)
            continue
        dp[i+1][j]=(dp[i+1][j]+(dp[i][j]*2%MOD))%MOD
        if j-a[i]>=0:
            dp[i+1][j]=(dp[i+1][j]+dp[i][j-a[i]])%MOD
print(dp[n][s])
n=int()
array=list(map(int,n))
a=sum(array)
if a%9==0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n=input()
array=list(map(int,n))
a=sum(array)
if a%9==0:
  print('Yes')
else:
  print('No')
N = int(input())
ans = ''
    for i in range(1, 99):
	    if N <= 26 ** i:
		    N -= 1
		    for j in range(i):
			    ans += chr(ord('a') + N % 26)
			    N //= 26
			break
	else:
		N -= 26 ** i
print(ans[::-1]) 


### FIXED CODE ###

N = int(input())
ans = ''
for i in range(1, 99):
    if N <= 26 ** i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a') + N % 26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])
n,t = map(int,input().split())
cost = []
time = []
ncost = []
for i in range(n):
    c,T = input().split()
    cost.append(int(c))
    time.append(int(T))

    
for i in range(n):
    if time[i] <= t:
        ncost.append(cost[i])
    elif all(time) > t:
        print('TLE')
    else:
        pass
    
print(min(ncost))
    


### FIXED CODE ###

n,t = map(int,input().split())
cost = []
time = []
ncost = []
f = 0
e = 0
for i in range(n):
    c,T = input().split()
    cost.append(int(c))
    time.append(int(T))

for i in time:
    if i > t:
        e += 1
    
if e == n:
    print('TLE')
    
for i in range(n):
    if time[i] <= t:
        ncost.append(cost[i])
        f = 1
    else:
        pass
if  f == 1:
    print(min(ncost))
a,b = map(int,input().split())
if a>=13:
  print(b)
elif a>=6 and a<=12
  print(b/2)
else 
  print(0)
    

### FIXED CODE ###

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

if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print(0)
import math

def solve(N, A):
    max_gcd = 0
    for i in range(N):
        lst = A[0:i]
        lst.extend(A[i + 1: N])
        gcd = lst[0]
        for j in range(1, len(lst)):
            gcd = math.gcd(gcd, lst[j])
        if gcd > max_gcd:
            max_gcd = gcd
    return max_gcd


N = int(input())
A = list(map(int, input().split()))
print(solve(N, A))

### FIXED CODE ###

from fractions import gcd


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

# l[i] := [0, i]の数のGCDメモ
l = [None for _ in range(N)]
l[0] = A[0]
for i in range(1, N):
    l[i] = gcd(l[i - 1], A[i])

# r[i] := [i, N - 1]の数のGCDメモ
r = [None for _ in range(N)]
r[N - 1] = A[N - 1]
for i in reversed(range(N - 1)):
    r[i] = gcd(r[i + 1], A[i])

ans = 0
for i in range(N):
    if i == 0:
        ans = max(ans, r[1])
    elif i == N - 1:
        ans = max(ans, l[N - 2])
    else:
        ans = max(ans, gcd(l[i - 1], r[i + 1]))
print(ans)
from collections import*
from heapq import*
(n,m),a,*q=[[*map(int,o.split())]for o in open(0)]
t=[-1]*n
def r(x):
 while t[x]>=0:x=t[x]
 return x
def u(x,y):
 x,y=r(x),r(y)
 if x!=y:
  if t[x]>t[y]:x,y=y,x
  t[x]+=t[y];t[y]=x
d=defaultdict(list)
for x,y in q:u(x,y)
i=c=0;b=[];k=(n+~m)*2;p=print
for v in a:d[r(i)]+=v,;i+=1
if k<1:p(0)
elif k>n:p('Impossible')
else:
 for r,p in d.items():p.sort();c+=p.pop(0);b+=p;k-=1
 p(c+sum(sorted(b)[:k]))

### FIXED CODE ###

#!/usr/bin/env python3
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

(n, m), a, *q = [[*map(int,o.split())] for o in open(0)]
UF = UnionFind(n)
k = (n - m - 1) * 2
if k > n:
    exit(print("Impossible"))
if not k:
    exit(print(0))

for c, f in q:
    UF.union(c, f)

from collections import*
d = defaultdict(list)
for e, i in enumerate(a):
    d[UF.find(e)] += i,

ans, b = 0, []
for r, p in d.items():
    p.sort()
    ans += p.pop(0)
    b += p
    k -= 1
b.sort()
print(ans + sum(b[:k]))
import math
A,B,N = map(int,input().split())
maxn = 0
sec =False
for x in range(1,N+1):
    tmp = math.floor((A*x)/B)-A*(math.floor(x/B))
    if maxn < tmp:
        maxn = tmp
    if tmp == 0:
        if sec ==True:
            break
        else:
            sec =True
    
print(maxn)

### FIXED CODE ###

#A
N = int(input())
A,B = map(int,input().split())
ans =0

for x in range(A,B+1):
    if x%N ==0:
        ans =1
        break
if ans ==1:
    print("OK")
else:
    print("NG")
def Warshall_Floyd(edges,N):
  for k in range(N):
    for i in range(N):
      for j in range(N):
        edges[i][j]=min(edges[i][j],edges[i][k]+edges[k][j])
  return edges

import itertools
N, M, R = map(int,input().split())
r = list(map(int,input().split()))
A=[[float("inf") for i in range(N)] for j in range(N)]
for m in range(M):
  a, b, c = map(int,input().split())
  A[a-1][b-1] = c
  A[b-1][a-1] = c

ans = float("inf")
for road in list(itertools.permutations(r)):
  length = 0
  for i in range(R-1):
    length += A[road[i]-1][road[i+1]-1]
  ans = min(ans, length)
print(ans)

### FIXED CODE ###

N=str(input())
if N[0]=="9" or N[1]=="9":
  print("Yes")
else:
  print("No")
#coding:utf-8

n = int(input())
minv = pri_list[0]
maxv = -10000000000
for i in range(1,n-1):
    price = int(input())
    maxv = max([maxv, price - minv])
    minv = min([minv, price])

print(maxv)



### FIXED CODE ###

#coding:utf-8

n = int(input())
minv = int(input())
maxv = -10000000000
for i in range(n-1):
    price = int(input())
    maxv = max([maxv, price - minv])
    minv = min([minv, price])

print(maxv)
import sys
input = sys.stdin.readline
class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        if i == 0:
            return 0
        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
aas = "abcdefghijklmnopqrstuvwxyz"
N = int(input().strip())
S = list(input().strip())
Q = int(input().strip())
cbt = dict()
MX = 10**5 + 2
for c in aas:
    cbt[c] = Bit(MX)
    for i, a in enumerate(S):
        if a == c:
            cbt[c].add(i+1, 1)

for _ in range(Q):
    t, i, c = input().split()
    t = int(t)
    if t == 1:
        i = int(i)
        if S[i-1] != c:
            cbt[S[i-1]].add(i, -1)
            cbt[c].add(i, 1)
            S[i-1] = c
    else:
#        print(S)
        l, r = int(i), int(c)
#        print(l, r)
        s = 0
        for a in aas:
            bt = cbt[a]
#            print(a, bt.sum(r),bt.sum(l-1))
            s += (bt.sum(r)-bt.sum(l-1)>0)
        print(s)


### FIXED CODE ###

import sys
input = sys.stdin.readline
class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        if i == 0:
            return 0
        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
aas = "abcdefghijklmnopqrstuvwxyz"
N = int(input().strip())
S = list(input().strip())
Q = int(input().strip())
cbt = dict()
MX = 5 * 10**5 + 2
for c in aas:
    cbt[c] = Bit(MX)
    for i, a in enumerate(S):
        if a == c:
            cbt[c].add(i+1, 1)

for _ in range(Q):
    t, i, c = input().split()
    t = int(t)
    if t == 1:
        i = int(i)
        if S[i-1] != c:
            cbt[S[i-1]].add(i, -1)
            cbt[c].add(i, 1)
            S[i-1] = c
    else:
#        print(S)
        l, r = int(i), int(c)
#        print(l, r)
        s = 0
        for a in aas:
            bt = cbt[a]
#            print(a, bt.sum(r),bt.sum(l-1))
            s += (bt.sum(r)-bt.sum(l-1)>0)
        print(s)
lis=input().split()
string_list=[input() for i in range(int(lis[0]))]
stringlist.sort()
print(''.join(stringlist))

### FIXED CODE ###

lis=input().split()
string_list=[input() for i in range(int(lis[0]))]
string_list.sort()
print(''.join(string_list))