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

n = int(input()) 
t = sorted([int(input()) for i in range(n)])

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a
	
def lcm(a, b):
  return a * b // gcd(a, b)
	
def nlcm(list):
  if len(list) > 2:
  	lcm_num = lcm(list[0], list[1])
    for i in range(2, len(list)):
      lcm_num = lcm(lcm_num, list[i])
    print(lcm_num)
  elif len(list) == 2:
    print(lcm(list[0], list[1]))
  else:
  	print(list[-1])

nlcm(t)


### FIXED CODE ###

# coding: utf-8

n = int(input()) 
t = sorted([int(input()) for i in range(n)])

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a
	
def lcm(a, b):
  return a * b // gcd(a, b)
	
def nlcm(list):
  if len(list) > 2:
    lcm_num = lcm(list[0], list[1])
    for i in range(2, len(list)):
      lcm_num = lcm(lcm_num, list[i])
    
    print(lcm_num)
  elif len(list) == 2:
    print(lcm(list[0], list[1]))
  else:
  	print(list[-1])

nlcm(t)
from itertools import combinations

N = int(input())
d = map(int(input().split()))

score = 0
for i,j in combinations(range(N), 2):
  score += d[i] * d[j]

print(score)
  

### FIXED CODE ###

from itertools import combinations
 
N = int(input())
d = list(map(int, input().split()))
 
score = 0
for i,j in combinations(range(N), 2):
  score += d[i] * d[j]
print(score)
N, Q = map(int, input().split())
S = input()
L = len(S)
target = 'AC'
shiftID = len(target) - 1

found_id = []

for i in range(L-shiftID):
    if S[i:i+len(target)] == target:
        found_id.append(i)


for _ in range(Q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1

    ans = 0
    for i in found_id:

        if l <= i and i+shiftID <= r:
            ans += 1
        elif r < i + shiftID:
            break

    print(ans)


### FIXED CODE ###

d = {'A':'T', 'T':'A', 'G':'C', 'C':'G'}

print(d[input()])
l,r = map(int,input().split())
L = l%2019
R = r%2019  #2019 = 3*673
N = r-l+1

if N >= 2019 or L>R:
    print(0)
else:
    ans = l*(l+1)%2019
    for i in range(L,R):  #この時点でL<Rは決定済み
        for j in range(i+1,R+1):
            ans = min(ans,(j*i)%2019)
        if ans == 0:
            break

print(ans)

### FIXED CODE ###

l,r = map(int,input().split())
L = l%2019
R = r%2019  #2019 = 3*673
N = r-l+1

if N >= 2019 or L>R:
    print(0)
else:
    ans = l*(l+1)%2019
    for i in range(L,R):  #この時点でL<Rは決定済み
        for j in range(i+1,R+1):
            ans = min(ans,(j*i)%2019)
        if ans == 0:
            break
    print(ans)
from sys import stdin

n = int(stdin.readline().rstrip())
data=[]
for i in range(0, n):
    data.append(int(stdin.readline().rstrip()))

if n == 1:
    print(1)
    exit

pos=0
max_layer = 1

prev = data[pos]
pos = pos + 1
curr = data[pos]

num_layer = 1

while True:
    if curr < prev:
        num_layer = num_layer + 1
        if max_layer < num_layer:
            max_layer = num_layer
        pos = pos + 1
    elif curr == prev:
        pos = pos + 1
    else:
        pos = pos + 1
        num_layer = 1

    if pos >= n:
        break

    prev = curr
    curr = data[pos]

print(max_layer)


### FIXED CODE ###

from sys import stdin

n = int(stdin.readline().rstrip())
data=[]
for i in range(0, n):
    data.append(int(stdin.readline().rstrip()))

print(len(set(data)))
a=list(input())
if a[0]=a[1]=a[2] or a[1]=a[2]=a[3]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a=list(input())
if a[0]==a[1]==a[2] or a[1]==a[2]==a[3]:
    print("Yes")
else:
    print("No")
l = []
while True:
	try:
		train = int(raw_input())
		if train == 0:
			print(l.pop())
		else:
			l.append(train)
	except EOFError:
		break

### FIXED CODE ###

l = []
while True:
	try:
		train = raw_input()
		if train == '0':
			print(l.pop())
		else:
			l.append(train)
	except EOFError:
		break
a=input(int)
b=input(int)
c=input(int)
d=input(int)
e=input(int)
k=input(int)
if (a-e) < k :
  print("Yay!")
else:
  print(":(")

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if ( e - a ) <= k :
  print("Yay!")
else:
  print(":(")
# AtCorder

s = input()

a = ["A","C","G","T"]
ans = []
v = 0
for i in s:
    if i in a:
        v += 1
    else:
        ans.append(v)
        v = 0

print(max(ans))

### FIXED CODE ###

# AtCorder

s = input()

a = "ACGT"
v = 0
ans = 0

for i in s:
    if i in a:
        v += 1
        ans = max(ans, v)
    else:
        v = 0

print(ans)
import numpy as np
import sys
x, y = map(int, input().split())

if (x + y) % 3 != 0 or x > 2 * y or y > 2 * x:
    print(0)
    sys.exit()

# 手数
n = (x + y) // 3
x -= n
y -= n


MOD = 10**9 + 7


def prepare(n, MOD):
    f = 1
    for m in range(1, n + 1):
        f *= m
        f %= MOD
    fn = f

    inv = pow(f, MOD - 2, MOD)
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv *= m
        inv %= MOD
        invs[m - 1] = inv


fact, invs = prepare(n, MOD)

print(fact * invs[x] * invs[y] % MOD)

### FIXED CODE ###

import sys
import math
x, y = map(int, input().split())

if (x + y) % 3 != 0 or x > 2 * y or y > 2 * x:
    print(0)
    sys.exit()

# 手数
n = (x + y) // 3
x -= n
y -= n


def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p


MOD = 10**9 + 7
N = 10**6
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)

print(cmb(x + y, x, MOD))
l=0
l=l+int(input)
l=l+int(input)
print(6-l)


### FIXED CODE ###

a=0
for i in range(2):
  a=a+int(input())
print(int(6-a))
import math


def combinations_with_replacement_count(n, r):
    return math.factorial(n + r - 1) // (math.factorial(n - 1) * math.factorial(r))


nm = list(map(int, input().split()))
n = nm[0]
m = nm[1]
fact = list()
i = 2
while m != 1:
    while m % i == 0:
        m = m // i
        fact.append(i)
    i += 1
j = 2
ans = 1
fact_c = list()
while j <= fact[-1]:
    fact_c.append(fact.count(j))
    j += 1
for k in fact_c:
    ans = ans * combinations_with_replacement_count(n, k)
print(ans % (10 ** 9 + 7))

### FIXED CODE ###

import math


def combinations_with_replacement_count(n, r):
    return math.factorial(n + r - 1) // (math.factorial(n - 1) * math.factorial(r))


nm = list(map(int, input().split()))
n = nm[0]
m = nm[1]
fact = {}
i = 2
while i * i <= m:
    while m % i == 0:
        m = m // i
        if i in fact:
            fact[i] += 1
        else:
            fact[i] = 1
    i += 1
if m > 1:
    fact[m] = 1
j = 2
ans = 1
for k in fact:
    ans = ans * combinations_with_replacement_count(n, fact[k])
print(ans % (10 ** 9 + 7))
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

v = a * a * b
s = x / a

import math

try:
    if x < v / 2:
        # print(math.degrees(math.atan(2 * s / b / b)))
        print(90 - math.degrees(math.atan(2 * s / b / b)))
    else:
        print(90 - math.degrees(math.atan(a / (b - (2 * s / a - b)))))
except expression as identifier:
    print(90)



### FIXED CODE ###

import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b, x = map(int, readline().split())

v = a * a * b
s = x / a

if x == v:
    print(0)
    exit()

if x <= v / 2:
    # print(math.degrees(math.atan(2 * s / b / b)))
    print(90 - math.degrees(math.atan(2 * x / a / b / b)))
else:
    print(90 - math.degrees(math.atan(a / (b - (2 * s / a - b)))))
n = input()
n = int(n)
list = []

i = 0
while(i<n):
	x = input()
	x = int(x)
	list[i] = x
	i = i + 1

maxv = -20000000
minv = list[0]
i = 1
while(i<n):
	if(maxv >= list[i]-minv):
		maxv = maxv
	else:
		maxv = list[i]-minv
	
	if(minv <= list[i]):
		minv = minv
	else:
		minv = list[i]
	i = i + 1

print(maxv)


### FIXED CODE ###

n = input()
n = int(n)
list = []

i = 0
while(i<n):
	x = input()
	x = int(x)
	list.append(x)
	i = i + 1

maxv = -2000000000
minv = list[0]
i = 1
while(i<n):
        maxv = max(maxv, list[i]-minv)
        minv = min(minv, list[i])
        i = i + 1
	
print(maxv)
def f_playing_tag_on_tree():
    N, U, V = [int(i) for i in input().split()]
    Edges = [[int(i) for i in input().split()] for j in range(N - 1)]

    tree = [[] for _ in range(N)]
    for u, v in Edges:
        tree[u - 1].append(v - 1)
        tree[v - 1].append(u - 1)

    depth = [-1] * N

    def dfs(current, parent, dep):
        depth[current] = dep

        for child in tree[current]:
            if child == parent:
                continue
            dfs(child, current, dep + 1)
        return None
    dfs(V - 1, -1, 0)
    return max(depth) - 1

print(f_playing_tag_on_tree())

### FIXED CODE ###

def f_playing_tag_on_tree():
    from collections import deque

    def bfs(tree, distance, first_pos):
        q = deque([(first_pos, -1)])
        while q:
            current, parent = q.pop()
            for child in tree[current]:
                if child == parent:
                    continue
                distance[child] = distance[current] + 1
                q.appendleft((child, current))

    N, U, V = map(int, input().split())
    tree = [[] for _ in range(N)]
    for _ in range(N - 1):
        a, b = map(int, input().split())
        tree[a - 1].append(b - 1)
        tree[b - 1].append(a - 1)

    # 両者について、最初にいる場所から他の頂点への移動回数を求める
    dist_aoki = [0] * N
    bfs(tree, dist_aoki, V - 1)
    dist_takahashi = [0] * N
    bfs(tree, dist_takahashi, U - 1)

    ans = 0
    for aoki, takahashi in zip(dist_aoki, dist_takahashi):
        # 注目した頂点 v には高橋くんの方が先に到達できる
        if aoki > takahashi:
            # 青木くんは v の親で高橋くんを捕まえることになるので、
            # v までの距離 - 1 が解となりうる
            ans = max(ans, aoki - 1)
    return ans

print(f_playing_tag_on_tree())
N = int(input())
W = map(int,input().split())
t = []
for i in range(1,N):
  t.append(abs(sum(W[:i])-sum(W[i:])))
print(min(t))

### FIXED CODE ###

N = int(input())
W = list(map(int,input().split()))
t = []
for i in range(1,N):
  t.append(abs(sum(W[:i])-sum(W[i:])))
print(min(t))
def m():
    N, M = [int(i) for i in input().split()]
    cards = sorted([int(i) for i in input().split()])
    manups = []
    for _ in range(M):
        b, c = [int(i) for i in input().split()]
        # c is number, b is max
        manups.append((c, b))
    manups.sort(reverse=True)

    cursor = 0
    for manup in manups:
        sub = manup[0]
        count = manup[1]
        for c in range(1, count+1):
            if cards[cursor] <= sub:
                cards[cursor] = sub
            else:
                break
                return(sum(cards))

            cursor += 1
    return(sum(cards))


if __name__ == '__main__':
    print(m())


### FIXED CODE ###

def m():
    N, M = [int(i) for i in input().split()]
    cards = sorted([int(i) for i in input().split()])
    manups = []
    for _ in range(M):
        b, c = [int(i) for i in input().split()]
        # c is number, b is max
        manups.append((c, b))
    manups.sort(reverse=True)

    cursor = 0
    for manup in manups:
        sub = manup[0]
        count = manup[1]
        for c in range(1, count+1):
            if cursor == N:
                break
                return(sum(cards))

            if cards[cursor] <= sub:
                cards[cursor] = sub
            else:
                break
                return(sum(cards))

            cursor += 1
    return(sum(cards))


if __name__ == '__main__':
    print(m())
from math import pi
r=int(input())
print("{} {}".format(r*r*pi,2*r*pi))

### FIXED CODE ###

from math import pi
r=float(input())
print("{} {}".format(r*r*pi,2*r*pi))
S = input()
T = input()
rec = []
for i in range(len(S)):
    flag = True
    Z = S
    for j in range(len(T)):
        if Z[i] == T[j]:
            for e in range(i - j):
                if Z[e] == "?":
                    Z = Z.replace("?", "a", 1)
            for k in range(len(T)):
                if Z[i + k - j] == T[k]:
                    continue
                elif Z[i + k - j] == "?":
                    Z = Z.replace("?", T[k], 1)
                    print(Z)
                else:
                    flag = False
            if flag:
                Z = Z.replace("?", "a")
                rec.append(Z)
if rec == []:
    print("UNRESTORABLE")
else:
    print(rec[-1])

### FIXED CODE ###

N = int(input())
G = int(input())
print(2*G-N)
n=int(input())
t,a=map(int,input().split())
h=[abs((t-int(i)*6/1000)-a) for i in input().split()]
print(h.index(min(h))+1)

### FIXED CODE ###

x,y=map(int,input().split())
print(x+y//2)
n=int(input(""))
a=[]
b=[]
for i in range(n):
    cc=input("").split(" ")
    a+=[int(cc[0])]
    b+=[int(cc[1])]
s=0
a.sort()
b.sort()
if (n%2==0):
    s=(a[n/2]+a[n/2-1]-b[n/2]-b[n/2-1])/2
else:
    s=a[int((n-1)/2)]-b[int((n-1)/2)]
print(-s+1)


### FIXED CODE ###

n=int(input(""))
a=[]
b=[]
for i in range(n):
    cc=input("").split(" ")
    a+=[int(cc[0])]
    b+=[int(cc[1])]
s=0
a.sort()
b.sort()
if (n%2==0):
    s=(a[int(n/2)]+a[int(n/2)-1]-b[int(n/2)]-b[int(n/2)-1])
else:
    s=a[int((n-1)/2)]-b[int((n-1)/2)]
print(int(-s+1))
a,b = map(int,input().split())
c = 'a'*b
d = 'b'*a
if int(c[0]) <= int(d[0]):
  print(int(c))
else:
  print(int(d))

### FIXED CODE ###

a,b = map(int,input().split())
c = 0
if a<=b:
  for i in range(b):
    c += a*(10**i)
  print(c)
else:
  for i in range(a):
    c += b*(10**i)
  print(c)
N,M=map(int, input().split())

L=[]
R=[]

for i in range(M):
    a,b=map(int, input().split())
    L.append(a)
    R.append(b)


ans=max(R)-max(L)+1
if ans<0:
  print(0)
else:
  prnit(ans)

### FIXED CODE ###

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

L=[]
R=[]

for i in range(M):
    a,b=map(int, input().split())
    L.append(a)
    R.append(b)

ans=min(R)-max(L)+1
print("0" if ans<0 else ans)
def solve():
  n,m = (int(i) for i in input().split())
  a = [0]*n
  for i in range(m):
    a1,b1 = (int(i) for i in input().split())
    a[a1-1]+=1
    a[b1-1]+=1
  ans = 'YES'
  for i in range(1,n+1):
   if a[i]%2 == 1:
    ans ='NO'
  return ans
                   
  
if __name__ == '__main__':
  print(solve())

### FIXED CODE ###

def solve():
  a,b,c = (int(i) for i in input().split())
  queue = [[a,b,c]] #mugencheck
  ct = 0
  while ct <100000000:
    if a%2 ==1 or b%2 ==1 or c%2 == 1: break
    #とりあえず交換simluration
    tmpa = a//2
    tmpb = b//2
    tmpc = c//2
    a = tmpb+tmpc
    b = tmpa+tmpc
    c = tmpa+tmpb
    if [a,b,c] in queue: 
      return -1
    else:
      ct += 1
      queue.append([a,b,c])
      #print(queue)
  return ct
                   
  
if __name__ == '__main__':
  print(solve())
import numpy as np


N = int(input())
H = np.array(list(map(int, input().split())))

answer = 0

L1 = (H[:-1] >= H[1:])
#print(L1)

for i in range(N-1):
    count = 0
    for j in range(i, N-1):
        if L1[j]:
            count += 1
        else:
            break
    else:
        answer = max(count, answer)

print(answer)

### FIXED CODE ###

import numpy as np


N = int(input())
H = np.array(list(map(int, input().split())))

answer = 0

L1 = (H[:-1] >= H[1:])
#print(L1)

answer = 0
count = 0
for l in L1:
    if l:
        count += 1
    else:
        answer = max(answer, count)
        count = 0

print(max(answer, count))
n=int(input())
x=list(map(int,input().split()))

import numpy as np
import fractions as frc
from functools import reduce
from copy import deepcopy

x2=deepcopy(x)

def gcd_list(lst):
    return reduce(frc.gcd, lst)

while True:
	n=len(x)
	g=[]
	if n<=5:
		if n==2:
			res=max(x)
			break
		else:
			for i in range(n):
				f=[c for c in x if c!=x[i]]
				g.append(gcd_list(f))
			idx=np.argmax(g)
			rm=x[idx]
			x3=[c for c in x2 if c!=rm]
			res=gcd_list(x3)
			break
	sp=n//2
	y=x[:sp]
	z=x[sp:]
	y_gcd=gcd_list(y)
	z_gcd=gcd_list(z)
	if y_gcd>z_gcd:
		x=z
	else:
		x=y

print(res)

### FIXED CODE ###

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

import fractions as frc

y=[0]*n
z=[0]*n

cd=x[0]
for i in range(n):
	cd=frc.gcd(cd,x[i])
	y[i]=cd

#print(y)

cd=x[n-1]
for i in range(n-1,-1,-1):
	cd=frc.gcd(cd,x[i])
	z[i]=cd

#print(z)

res=[0]*n
for i in range(n):
	if i==0:
		res[0]=z[1]
	else:
		if i==n-1:
			res[n-1]=y[n-2]
		else:
			res[i]=frc.gcd(y[i-1],z[i+1])

#print(res)

print(max(res))
from sys import stdin
import math
import bisect
import heapq
import numpy as np
from math import factorial

x,y = [int(x) for x in stdin.readline().rstrip().split()]

if (x+y)%3 != 0:
    print(0)
    exit()

a = (2*x-y)//3
b = (2*y-x)//3

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

print(combinations_count(a+b,a)%(10**9+7))

### FIXED CODE ###

from sys import stdin
import math
import bisect
import heapq
import numpy as np
from math import factorial
mod = 1000000007
x,y = [int(x) for x in stdin.readline().rstrip().split()]

if (x+y)%3 != 0:
    print(0)
    exit()

a = (2*x-y)//3
b = (2*y-x)//3

if a < 0 or b < 0:
    print(0)
    exit()

def combination(n,r,mod=10**9+7):
    r=min(r,n-r)
    up,down=1,1
    for i in range(r):
        up=up*(n-i)%mod
        down=down*(i+1)%mod
    return up*pow(down,mod-2,mod)%mod

print(combination(a+b,a))
# ABC140E
class SegTree:
    def __init__(self, init_val, n, ide_ele, seg_func):
        self.segfunc = seg_func
        self.num = 2**(n-1).bit_length()
        self.ide_ele = ide_ele
        self.seg=[self.ide_ele]*2*self.num
        for i in range(n):
            self.seg[i+self.num-1]=init_val[i]    
        for i in range(self.num-2,-1,-1) :
            self.seg[i]=self.segfunc(self.seg[2*i+1],self.seg[2*i+2]) 
        
    def update(self, k, x):
        k += self.num-1
        self.seg[k] = x
        while k+1:
            k = (k-1)//2
            self.seg[k] = self.segfunc(self.seg[k*2+1],self.seg[k*2+2])
        
    def query(self, p, q):
        if q<=p:
            return self.ide_ele
        p += self.num-1
        q += self.num-2
        res=self.ide_ele
        while q-p>1:
            if p&1 == 0:
                res = self.segfunc(res,self.seg[p])
            if q&1 == 1:
                res = self.segfunc(res,self.seg[q])
                q -= 1
            p = p//2
            q = (q-1)//2
        if p == q:
            res = self.segfunc(res,self.seg[p])
        else:
            res = self.segfunc(self.segfunc(res,self.seg[p]),self.seg[q])
        return res

n,Q=map(int,input().split())
xs,qs,tmp = [],[],set()
for _ in range(n):
    s,t,x=map(int,input().split())
    s,t,x=s-x-0.5,t-x-0.5,x
    xs.append((s,1,x))
    xs.append((t,0,x))
    tmp.add(x)
xs.sort()
tmp = list(tmp)
tmp.sort()
x2i = dict()
for i, x in enumerate(tmp):
    x2i[x] = i

q = int(input())
rs = set()
st = SegTree([XN]*XN, XN, XN, min)
for t,r,x in xs:
    if q < t:
        c = st.query(0,XN)
        while True:
            if q < t:
                if c != XN:
                    print(tmp[c])
                else:
                    print(-1)
                Q-=1
                if Q == 0:
                    break
                q = int(input())
            else:
                break
#    print(t,r,x)
    if Q==0:
        break
    if r:
        st.update(x2i[x], x2i[x])
    else:
        st.update(x2i[x], XN)
print("-1\n"*Q)


### FIXED CODE ###

import sys
input = sys.stdin.readline

n,Q=map(int,input().split())
b_num = 2**(n-1).bit_length()
mx = 10**9
segl=[mx]*2*b_num 

def update( k, x):
    k += b_num-1
    segl[k] = x
    while k+1:
        k = (k-1)//2
        segl[k] = min(segl[k*2+1],segl[k*2+2])
    
if __name__ == '__main__':
    xs = []
    for i in range(n):
        s,t,x=map(int,input().split())
        xs += [(s-x-0.4,True,x,i), (t-x-0.5,False,x,i)]
    for _ in range(Q):
        xs.append((int(input()),2))
    xs.sort(key=lambda x:x[0])
    for x in xs:
        if x[1]==2:
            print(segl[0] if segl[0]!= mx else -1)
            continue
        update(x[3], x[2] if x[1] else mx)
s = input()
if s[:4] == 2019 and s[5] == 0 and s[6] < 5:
    print("Heisei")
elif s[:4] < 2019:
    print("Heisei")
else:
    print("TBD")

### FIXED CODE ###

s = input()
 
if s <= '2019/04/30':
    print('Heisei')
else:
    print('TBD')
a=int(input())
b=int(input())
c=int(input())
if a==1:
  print("Hello World")
else:
  print(int(b+c))
  

### FIXED CODE ###

a=int(input())
if a==1:
  print("Hello World")
else:
  b=int(input())
  c=int(input())
  print(int(b+c))
word = 'keyence'
l = input()
now = 0
for w in l:
  if word[now] == w:
    now ++
  if now == len(word):
    print('YES')
    exit()
print('NO')


### FIXED CODE ###

word = 'keyence'
l = input()
i = l.find(word)
if i == 0 or i == (len(l)-len(word)) :
  print('YES')
  exit()

for i in range(1,len(word)):
  a = word[:i]
  b = word[i:]
  #print(l[:len(a)], l[-len(b):])
  if l[:len(a)] == a and l[-len(b):] == b:
    print('YES')
    exit()
print('NO')
s = list(input())

flag = 0
pos_a, pos_z = 1, 1
length = 0

for i, ltr in enumerate(s, 1)
  if ltr == 'A':
    pos_a = i
    flag = 1
  elif ltr == 'Z':
    if flag == 1:
      pos_z = i
      if pos_z - pos_a > length:
        length = pos_z - pos_a
      else:
        flag = 0
        
print(length)

### FIXED CODE ###

s = list(input())

flag = 0
pos_a, pos_z = 1, 1
length = 0

for i, ltr in enumerate(s, 1):
  if ltr == 'A' and flag == 0:
    pos_a = i
    flag = 1
  elif ltr == 'Z' and flag == 1:
    pos_z = i
    if pos_z - (pos_a -1) > length:
      length = pos_z - (pos_a -1)
    else:
      flag = 0

print(length)
from scipy.special import comb

a,b = map(int,input().split()) #a even b odd
x = 0

x = comb(a, 2, exact=True) + comb(b, 2, exact=True)
    

print(x)

### FIXED CODE ###

from scipy.misc import comb

a,b = map(int,input().split()) #a even b odd
x = 0

x = comb(a, 2, exact=True) + comb(b, 2, exact=True)
    

print(x)