Harryxun/stf_run huggingface dataset:
N = input()
str_h = input()

fls = flowers(str_h)
ls_fls = fls.str_split0()
water = 0

while(len(ls_fls)>0):
    #print(f'ls_fls = {ls_fls}')
    temp_ls_fls = []
    for fls in ls_fls:
        if len(fls)<=2:
            water += max([int(s) for s in fls])
            continue
        else:
            _fls = flowers(' '.join(fls))
            _fls.minimize()
            _ls_fls = _fls.str_split0()
            water += _fls.water
            temp_ls_fls += _ls_fls
            flg=1
    ls_fls = temp_ls_fls
print(water)

### FIXED CODE ###

class flowers:
    def __init__(self, str_h):
        self.str = str_h.split()
        self.int = []
        self.min = 0
        self.water = 0
        
        self.update_int()
        self.update_min()
    
    def update_str(self):
        self.str = list(map(str, self.int))
        return

    def update_int(self):
        self.int = list(map(int, self.str))
        return
    
    def update_min(self):
        self.min = min(self.int)
        return
    
    def minimize(self):
        self.int = [n-self.min for n in self.int]
        self.water += self.min
        self.update_str()
        self.min = 0
        return
    
    def str_split0(self):
        idxs = [-1] + [i for i,n in enumerate(self.int) if n==0]
        if len(idxs)==1:
            return [self.str]
        else:
            temp_ls = []
            for i in range(len(idxs)-1):
                s = self.str[idxs[i]+1:idxs[i+1]]
                if len(s)>0: temp_ls.append(s)
            if self.int[-1]!=0:
                temp_ls.append(self.str[idxs[-1]+1:])
        return temp_ls

N = input()
str_h = input()

fls = flowers(str_h)
ls_fls = fls.str_split0()
water = 0

while(len(ls_fls)>0):
    #print(f'ls_fls = {ls_fls}')
    temp_ls_fls = []
    for fls in ls_fls:
        if len(fls)<=2:
            water += max([int(s) for s in fls])
            continue
        else:
            _fls = flowers(' '.join(fls))
            _fls.minimize()
            _ls_fls = _fls.str_split0()
            water += _fls.water
            temp_ls_fls += _ls_fls
            flg=1
    ls_fls = temp_ls_fls
print(water)
from functools import reduce
l = int(input())
src = list(map(lambda x: 1 if x=="." else 0, input()))
lb = 0
rw = sum(src)
a = rw
for i in range(l):
  if src[i]==0:
    lb+=1
  else:
    rw-=1
  a = min(ans, lb + rw)
  if a==0:
    break
print(a)

### FIXED CODE ###

from functools import reduce
l = int(input())
src = list(map(lambda x: 1 if x=="." else 0, input()))
left_black = 0
right_white = sum(src)
ans = right_white
for i in range(l):
  if src[i]==0:
    left_black+=1
  else:
    right_white-=1
  ans = min(ans, left_black + right_white)
  if ans==0:
    break
print(ans)
n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
a.sort()
used=[False]*n
idx=n-1
cnt=0
while True:
    if idx-cnt<0:
        break
    tmp=sum(a[idx-cnt:idx+1])
    if tmp<k:
        cnt+=1
        continue
    for i in xrange(idx-cnt,idx+1):
        used[i]=True
    tmp-=a[idx-cnt]
    for i in xrange(idx-cnt-1,-1,-1):
        if tmp+a[i]>=k:
            used[i]=True
        else:
            break
    idx-=1
    cnt=0
ans=0
for i in xrange(n):
    if not used[i]:
        ans+=1
print ans

### FIXED CODE ###

x=int(raw_input())
ans=0
su=0
while su<x:
    ans+=1
    su+=ans
print ans
N=int(input())
a=str(N)
if 'a' in 7:
else:
  print("No")
   

### FIXED CODE ###

N=int(input())
a=str(N)
if '7' in a:
  print("Yes")
else:
  print("No")
import sys
sys.setrecursionlimit(200001)
N, Q = map(int, sys.stdin.readline().split())
a_b = [list(map(int, sys.stdin.readline().split())) for _ in range(N-1)]
p_x = [list(map(int, sys.stdin.readline().split())) for _ in range(Q)]
 
rin = [[] for _ in range(N)]
for v in a_b:
    rin[v[0]-1].append(v[1]-1)
    rin[v[1]-1].append(v[0]-1)
    
score = [0 for _ in range(N)]
for ele in p_x:
    score[ele[0]-1] +=ele[1]
#print(score)
 
def dfs(p, bp=-1):
    for c in rin[p]:
        if c != bp:
            #print(c)
            score[c]+= score[p]
            dfs(c, p)
 
dfs(0)
print(*score)

### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(1000000)

n,q = map(int, input().split())
a_b = [list(map(int, sys.stdin.readline().split())) for _ in range(n-1)]
p_x = [list(map(int, sys.stdin.readline().split())) for _ in range(q)]

v = [deque([]) for i in range(n)]
for e in a_b:
    v[e[0]-1]+=[e[1]-1]
    v[e[1]-1]+=[e[0]-1]
score = [0 for i in range(n)]
for e in p_x:
    score[e[0]-1]+=e[1]
def dfs(p, bp=-1):
    while v[p]:
        c =v[p].popleft()
        if c ==bp:
            continue
        #print(p, c, bp)
        score[c]+=score[p]
        dfs(c, bp=p)
visited = [0]                
dfs(0)
print(*score)
while True:
    (x,y) = map(int, input().split())
    if x == 0 and y == 0:
        break
    elif x => y:
        print (y,x)
    else:
        print (x,y)

### FIXED CODE ###

while True:
    x,y = map(int, input().split())
    if x == 0 and y == 0 :
        break
    elif x <= y :
        print (x,y)
    else :
        print (y,x)
# -*- coding: utf-8 -*-
inf = 10**9+1
n,m = map(int, input().split())
edge = [[inf for _ in range(n)] for _ in range(n)]
for _ in range(m):
    a,b,c = map(int, input().split())
    a -= 1
    b -= 1
    edge[a][b] = c


score = [inf for _ in range(n)]
def dfs(v):
    for u in range(n):
        if edge[v][u]<inf:
            if score[u]<inf:
                if score[v]+edge[v][u]>score[u]:
                    print("inf")
                    exit()
            else:
                score[u] = score[v] + edge[v][u]
                dfs(u)

score[0] = 0
dfs(0)
print(score[n-1])


### FIXED CODE ###

# -*- coding: utf-8 -*-
inf = 10**50
n,m = map(int, input().split())

ea = []
eb = []
cost = []

for _ in range(m):
    a,b,c = map(int, input().split())
    a -= 1
    b -= 1
    ea.append(a)
    eb.append(b)
    cost.append(-c)

d = [inf for _ in range(n)]
d[0] = 0
for _ in range(n):
    update = False
    for i in range(m):
        a = ea[i]
        b = eb[i]
        c = cost[i]
        if d[a]!=inf and d[b]>d[a]+c:
            d[b] = d[a]+c
            update = True
    if not update:
        break

ans = d[n-1]
negative = [False for _ in range(n)]
for _ in range(n):
    update = False
    for i in range(m):
        a = ea[i]
        b = eb[i]
        c = cost[i]
        if d[a]!=inf and d[b]>d[a]+c:
            d[b] = d[a]+c
            if not negative[b]:
                update = True
            negative[b] = True
        if negative[a] and not negative[b]:
            negative[b] = True
            update = True
    if not update:
        break
# print(d)
if negative[n-1]:
    print("inf")
else:
    print(-ans)
def gcd(x,y):
    if x%y == 0:
        return y
    else:
        return gcd(y,x%y)

def lcm(x,y):
    return x*y//gcd(x,y)

def f(tmp):
    tmp.sort(reverse=True)
    result=[]
    for i in tmp[1:]:
        if tmp[0]%i == 0:
            tmp.remove(i)
    for i in range(1,len(tmp)):
        result.append(lcm(tmp[0],tmp[i]))
    else:
        if result:
            return result
        else:
            return tmp
if __name__ == "__main__":
    n=int(input())
    t=[]
    for _ in range(n):
        t.append(int(input()))
    t.sort(reverse=True)
    tmp=[]
    for i in range(1,n):
        tmp.append(lcm(t[0],t[i]))
    while len(tmp) > 1:
        tmp=f(tmp)
    if tmp[0] >1000000000000000000:
        print(1000000000000000000)
    else:
        print(tmp[0])


### FIXED CODE ###


def gcd(x,y):
    if x%y == 0:
        return y
    else:
        return gcd(y,x%y)

def lcm(x,y):
    return x*y//gcd(x,y)

def f(tmp):
    tmp.sort(reverse=True)
    result=[]
    for i in tmp[1:]:
        if tmp[0]%i == 0:
            tmp.remove(i)
    for i in range(1,len(tmp)):
        result.append(lcm(tmp[0],tmp[i]))
    else:
        if result:
            return result
        else:
            return tmp
if __name__ == "__main__":
    n=int(input())
    t=[]
    for _ in range(n):
        t.append(int(input()))
    t.sort(reverse=True)
    if len(t)<2:
        print(t[0])
        exit(0)
    tmp=[]
    for i in range(1,n):
        tmp.append(lcm(t[0],t[i]))
    while len(tmp) > 1:
        tmp=f(tmp)
    if tmp[0] >1000000000000000000:
        print(1000000000000000000)
    else:
        print(tmp[0])
K,N = map(int,input().split())
a = list(map(int,input().split()))
c = a[1:]-a[:-1]
d = max(c)
print(K - d)


### FIXED CODE ###

e = list(map(int,input().split()))
K = e[0]
N = e[1]
a = list(map(int,input().split()))
c = [a[i+1] - a[i] for i in range(N-1)]
f = a[0]+ K - a[N-1]
c.append(f)
d = max(c)
print(K - d)
import math

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

MAX = 1000005

is_prime = [1]*MAX
D = [None]*MAX
is_prime[0],is_prime[1] = 0,0

for i in range(2,MAX):
  if is_prime[i]:
    D[i] = i
    for j in range(i,MAX,i):
      is_prime[j] = 0
      D[j] = i
      
counts = [0]*MAX
pair = True

for a_i in a:
  while True:
    p = D[a_i]
    if counts[p]>0:
      pair = False
    counts[p] += 1
    if p == a_i:
      break
    else:
      a_i //= p

if pair:
  print('pairwise coprime')
else:
  g = 0
  for a_i in a:
    g = math.gcd(a_i,g)
  if g == 1:
    print('setwise coprime')
  else:
    print('not coprime')

### FIXED CODE ###

import math

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

MAX = 1000005
c = [0]*MAX

for i in range(n):
  c[a[i]] += 1

pair = True

for i in range(2,MAX):
  cnt = 0
  for j in range(i,MAX,i):
    cnt += c[j]
  if cnt > 1:
    pair = False

if pair:
  print('pairwise coprime')
else:
  g = a[0]
  for i in range(1,n):
    g = math.gcd(g,a[i])
    
  if g == 1:
    print('setwise coprime')
  else:
    print('not coprime')
a = [int(input()) for i in range(4)]
if a <= b:
  if c <= d:
    print(a + c)
  else:
    print(a + d)
else:
  if c <= d:
    print(b + c)
  else:
    print(b + d)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
if a <= b:
  if c <= d:
    print(a + c)
  else:
    print(a + d)
else:
  if c <= d:
    print(b + c)
  else:
    print(b + d)
t = int(input())
list_v = list(map(int,input().split()))
 
res = 1
for v in list_v:
  if v == 0:
    res = 0
    break
  res *= v
  if res > 10**18:
    res = -1
    break
print(res)

### FIXED CODE ###

a, b = map(int, input().split())
print(a*b)
from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict
import math as m

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

setrecursionlimit(8000)

def main():
	n, m = rli()
	G = defaultdict(lambda: [])
	for _ in range(m):
		u, v = rli()
		G[u].append(v)
	ans = 0
	memo = defaultdict(lambda: 0)

	def longest(v):
		if v in memo:
			return memo[v]
		pathlen = 0
		for nbhr in G[v]:
			pathlen = max(pathlen, 1 + longest(nbhr))
		memo[v] = pathlen
		return pathlen

	for i in range(1, n+1):
		ans = max(ans, longest(i))

	print(ans)

	stdout.close()

if __name__ == "__main__":
	main()

### FIXED CODE ###

from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict
import math as m

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

setrecursionlimit(10000)

def main():
	n, m = rli()
	G = [[] for i in range(n+1)]
	for _ in range(m):
		u, v = rli()
		G[u].append(v)
	ans = 0
	memo = [-1 for _ in range(n+1)]

	def longest(v):
		if memo[v] > -1:
			return memo[v]
		pathlen = 0
		for nbhr in G[v]:
			pathlen = max(pathlen, 1 + longest(nbhr))
		memo[v] = pathlen
		return pathlen

	for i in range(1, n+1):
		ans = max(ans, longest(i))

	print(ans)
	stdout.close()

if __name__ == "__main__":
	main()
s = input()
s[3]="8"
print(s)

### FIXED CODE ###

s = input()
print(s.replace("2017","2018"))
n = int(input())

for _ in range(n):
  m, f, r = map(int, input().split())
  s = m+f

if s >= 80:
    print("A")
elif s >= 65 and s < 80:
    print("B")
elif (s >= 50 and s < 65) or f >= 50:
    print("C")
elif s >= 30 and s < 50:
    print("D")
else:
    print("F")


if m == f == r== -1:
    print("F")



### FIXED CODE ###

while True:
    m, f, r = map(int, input().split())
    if m == f == r== -1:
        break
    s = m + f
    if m == -1 or f == -1:
        print("F")
    elif s >= 80:
        print("A")
    elif s >= 65:
        print("B")
    elif s >= 50:
        print("C")
    elif s >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")
N, M = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse=True)

for i in range(M):
    A[0] = A[0]//2
    if A[0]<A[1]:
        A.sort(reverse=True)

print(sum(A))

### FIXED CODE ###

import heapq

N, M = map(int, input().split())
A = list(map(lambda a: int(a)*(-1), input().split()))

heapq.heapify(A)

for i in range(M):
    a = -heapq.heappop(A)//2
    heapq.heappush(A, -a)
    
print(-sum(A))
a,b=int(map(int,input().split()))
print(a*b)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b)
d = int(input())
if d == 3 or d== 5 or d==7:
	print("YES")
else
	print("NO")	

### FIXED CODE ###

d = int(input())
if d == 3 or d== 5 or d==7:
 print("YES")
else:
 print("NO")
#if WATCH_RUNTIME
	#include <ctime>
	clock_t startTime;
#endif

#include <cstdio>
#include <cstring>

int main(void)
{
	#if DEBUG 
	freopen("_in","r",stdin);
	#endif
	#if WATCH_RUNTIME
	startTime=clock();
	#endif
	bool winFlag;
	int i,j,N;
	char msg[200],patten[100];
	scanf("%s",msg);
	scanf("%s",patten);
	N=strlen(msg);
	for(i=0;i<N;i++)
	{
		msg[N+i]=msg[i];
	}
	msg[N+i]='\0';
	for(i=0;i<N;i++)
	{
		winFlag=true;
		for(j=0;patten[j];j++)
		{
			if(patten[j]!=msg[i+j])
			{
				winFlag=false;
				break;
			}
		}
		if(winFlag)
			break;
	}
	printf("%s\n",winFlag?"Yes":"No");

	#if WATCH_RUNTIME
	printf("----------\n");
	printf("\n+===============+\n");
	printf("|RUNTIME =%3dms.|\n",clock()-startTime);
	printf("+===============+\n");
	#endif

	return 0;
}

### FIXED CODE ###

S = input()
T = input()

for _ in range(len(S)):
    if S == T:
        print('Yes')
        break
    else:
        S = S[-1] + S[:-1]
else:
    print('No')
# -*- coding:utf-8 -*-
n, m = map(int, input().strip().split())
digit = {}
for i in range(m):
    tmp_d, tmp = map(int, input().strip().split())
      
    if ((tmp_d == 1) and (tmp == 0)):
        print(-1)
        exit()
    elif (tmp_d in digit.keys()) and (digit[tmp_d] != tmp):
        print(-1)
        exit()
    else:
        digit[tmp_d] = tmp
 
 
    
ans = 0
for key in digit.keys():
    ans += digit[key]*(10**(n-key))
 
if (ans // n == 0) and n >= 2:
  ans += 1*(10**(n-1))
print(ans)
# -*- coding:utf-8 -*-
n, m = map(int, input().strip().split())
digit = {}
for i in range(m):
    tmp_d, tmp = map(int, input().strip().split())
      
    if ((tmp_d == 1) and (tmp == 0)):
        print(-1)
        exit()
    elif (tmp_d in digit.keys()) and (digit[tmp_d] != tmp):
        print(-1)
        exit()
    else:
        digit[tmp_d] = tmp
 

    
ans = 0
for key in digit.keys():
    ans += digit[key]*(10**(n-key))

if (ans // (10*(n-1)) == 0) and n >= 2:
  ans += 1*(10**(n-1))
print(ans)
提出情報

### FIXED CODE ###

# -*- coding:utf-8 -*-
n, m = map(int, input().strip().split())
ans = 0

digit ={}
for i in range(m):
    tmp_d, tmp = map(int, input().strip().split())
       	
    if (tmp_d in digit.keys()) and (digit[tmp_d] != tmp):
        print(-1)
        exit()
    else:
        digit[tmp_d] = tmp
      
      
if not (1 in digit.keys()) and n>=2:
	digit[1] = 1
    
ans = 0
for key in digit.keys():
  ans += digit[key]*(10**(n-key))

if len(str(ans)) == n: 
  print(ans)
else:
  print(-1)
# -*- coding: utf-8 -*-
import sys

args = sys.argv
num = int(args.split())
if num % 4 == 0:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys

x = input()
num = int(''.join(x.split()))
if num % 4 == 0:
    print('YES')
else:
    print('NO')
def hoge(x, y):
    return y if x >= y else y - 1

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

flag = 0
for i in range(N - 1):
    H[i + 1] = hoge(H[i], H[i + 1])
    print(H)
    if H[i] < H[i + 1]:
        print("No")
        flag = 1
        break

if flag == 0:
    print("Yes")


### FIXED CODE ###

def hoge(x, y):
    return y if x >= y else y - 1

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

flag = 0
for i in range(N - 1):
    H[i + 1] = hoge(H[i], H[i + 1])
    if H[i] < H[i + 1]:
        flag = 1
        print("No")
        break

if flag == 0:
    print("Yes")
# arr=input().strip().split(' ')
x,n=[int(i) for i in input().strip().split(' ')]
arr=[int(i) for i in input().strip().split(' ')]
# neg,pos=[],[]
# for i in arr:
# 	if x-i >0 :
# 		pos.append(x-i)
# 	else:
# 		neg.append(i-x)
# pos=sorted(pos)
# neg=sorted(neg)
diff=[]
for i in arr:
    
	diff.append(x-i)
i=-1
j=0
while i in diff:
	i=i-1
while j in diff:
	j=j+1
if abs(i)<abs(j):
    print(x-i)
else:
    print(x-j)
# print(x+)

### FIXED CODE ###

# arr=input().strip().split(' ')
def aa():
    x,n=[int(i) for i in input().strip().split(' ')]
    if n==0:
        print(x)
        return 
    arr=[int(i) for i in input().strip().split(' ')]
    # neg,pos=[],[]
    # for i in arr:
    # 	if x-i >0 :
    # 		pos.append(x-i)
    # 	else:
    # 		neg.append(i-x)
    # pos=sorted(pos)
    # neg=sorted(neg)
    
    diff=[]
    for i in arr:

        diff.append(x-i)
    i=-1
    j=0
    while i in diff:
        i=i-1
    while j in diff:
        j=j+1
    if abs(i)<abs(j):
        print(x-i)
    else:
        print(x-j)
    # print(x+)
aa()
N = int(input())
h = input().rstrip().split(' ')
h.insert(0,0)
h = list(map(int,h))

#ここで保存しておく
l = [-1]*(N-1)
l.insert(0,0)
l.insert(0,0)

import sys
sys.setrecursionlimit(30000)

def cost_min(n):
    #n番目までで最小のコストを考える
    if(l[n] != -1):
        return l[n]
    else:
        l[n] = min([cost_min(n-1) + abs(h[n]-h[n-1]),cost_min(n-2) + abs(h[n]-h[n-2])])
        return l[n]

def cost_min_bottomup(n):
    if(n<2):
        return 0
    t_0 = 0
    t_1 = abs(h[2] - h[1])
    ans_0 = 0
    ans_1 = t_1
    for i in range(n-2):
        t_0 = ans_0 + abs(h[i+3]-h[i+1])
        t_1 = ans_1 + abs(h[i+3]-h[i+2])
        ans_0 = ans_1
        ans_1 = min([t_0,t_1])
    return ans_1

print(cost_min(N))
#print(cost_min_bottomup(N))

### FIXED CODE ###

N = int(input())
h = input().rstrip().split(' ')
h.insert(0,0)
h = list(map(int,h))

#ここで保存しておく
l = [-1]*(N-1)
l.insert(0,0)
l.insert(0,0)

def cost_min(n):
    #n番目までで最小のコストを考える
    if(l[n] != -1):
        return l[n]
    else:
        l[n] = min([cost_min(n-1) + abs(h[n]-h[n-1]),cost_min(n-2) + abs(h[n]-h[n-2])])
        return l[n]

def cost_min_bottomup(n):
    if(n<2):
        return 0
    t_0 = 0
    t_1 = abs(h[2] - h[1])
    ans_0 = 0
    ans_1 = t_1
    for i in range(n-2):
        t_0 = ans_0 + abs(h[i+3]-h[i+1])
        t_1 = ans_1 + abs(h[i+3]-h[i+2])
        ans_0 = ans_1
        ans_1 = min([t_0,t_1])
    return ans_1

#print(cost_min(N))
print(cost_min_bottomup(N))
def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    for mou in range(K):
        newA = [0]*N
        count = 0
        for i in A:
            for j in range(-i,i+1):
                if count+j >= 0 and count + j < N:
                    newA[count+j] += 1
            count +=1
        A = newA
    print(' '.join(map(str,A)))

if __name__ == '__main__':
    main()

### FIXED CODE ###

import random
S = input()

ran = random.randint(0,len(S)-3)

print(S[ran:ran+3])
# -*- coding: utf-8 -*-

A, B, C = map(int, input().split())

for i in range(1, B + 1)
    if (A * i) % B == C:
        print('YES')
        exit()
        
print('NO')

### FIXED CODE ###

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

A, B, C = map(int, input().split())

for i in range(1, B + 1):
    if (A * i) % B == C:
        print('YES')
        exit()

print('NO')
N = int(input())
XYList = []
for i in range(N):
    A = int(input())
    for j in range(A):
        XY = []
        XY.append(list(map(int, input().split())))
    XYList.append(XY)
maxSum = 0
for i in range(2**N):
    sum = 0
    for j in range(N):
        if i >> j & 1:
            honest = True
            for XY in XYList[j]:
                if ((i >> (XY[0]-1)) & 1) != XY[1]:
                    honest = False
                    break
            if honest:
                sum += 1
            else:
                sum = 0
                break
    if maxSum < sum:
        maxSum = sum
print(maxSum)

### FIXED CODE ###

N = int(input())
XYList = []
for i in range(N):
    A = int(input())
    XY = []
    for j in range(A):
        XY.append(list(map(int, input().split())))
    XYList.append(XY)
maxSum = 0
for i in range(2**N):
    sum = 0
    for j in range(N):
        if i >> j & 1:
            honest = True
            for XY in XYList[j]:
                if ((i >> (XY[0]-1)) & 1) != XY[1]:
                    honest = False
                    break
            if honest:
                sum += 1
            else:
                sum = 0
                break
    if maxSum < sum:
        maxSum = sum
print(maxSum)
N = input()
list = [input() for i in range(N)]
print(len(set(list)))

### FIXED CODE ###

N = int(input())
list = [input() for i in range(N)]
print(len(set(list)))
n, k = map(int,input().split())
s = input()
print(s.replace(s[k],s[k].lower()))


### FIXED CODE ###

n, k = map(int, input().split())
s = input()

ans = ""
for i, j in enumerate(list(s)): 
  if i == k - 1:
    ans += j.lower()
  else:
    ans += j

print(ans)
A = input()

if int(A[6:8]) >= 5:
  print('TBD')
else:
  print('Heisei')

### FIXED CODE ###

A = input()

if int(A[5:7]) >= 5:
  print('TBD')
else:
  print('Heisei')
n = int(input())
s = []
for i in range(n):
    s.append(input())
    
dic = {}
for i in range(len(s)):
    if s[i] not in dic:
        dic[s[i]]=s.count(s[i])
    
ans = sorted([k for k, v in dic.items() if v == max(dic.values())])

for i in range(len(ans)):
    print(ans[i])

### FIXED CODE ###

a = input()
b = eval(a.replace(" ","^"))
print((a.count(str(b))==1)*"Yes" or "No")
n=int(input())

print(n**2)


### FIXED CODE ###

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

if a<=9 and b<=9:
  print(a*b)
else:
  print('-1')
ary = input().split(" ")
a = ary[0]
b = ary[1]
c = ary[2]

if ( a == b and (a != c or b != c) ) or ( a == c and ( a != b and c != b ) ) or ( b == c and ( c != a or b != a ) :
  print("Yes") 
else :
  print("No")
 

### FIXED CODE ###


ary = input().split(" ")
a = ary[0]
b = ary[1]
c = ary[2]

if a == b and ( a != c or b != c )  :
  print("Yes") 
elif a == c and ( a != b or c != b ) :
  print("Yes") 
elif b == c and ( b != a or c != a ) :
  print("Yes") 
else :
  print("No")
import scipy.special.comb
S = int(input)
ans = 0
for i in range(3, S+1, 3):
  ans += scipy.special.comb(S-2*(i//3)-1, i//3-1, exact=True)
print(ans)

### FIXED CODE ###

from scipy.special import comb
S = int(input())
ans = 0
mod = 10**9+7
for i in range(3, S+1, 3):
  ans = (ans +comb(S-2*(i//3)-1, i//3-1, exact=True)) % mod 
print(ans)
A, B, C, D = map(int, input().split())

import math

interval = B-A+1

n1 = math.ceil(A/C)
n2 = math.ceil(A/D)
m1 = math.ceil(B/C)
m2 = math.ceil(B/D)

arr1 = []
arr2 = []

if B%C==0:
    for i in range(n1, m1+1):
        arr1.append(i*C)
else:
    for i in range(n1, m1):
        arr1.append(i*C)
        
if B%D==0:
    for j in range(n2, m2+1):
        arr2.append(j*D)
else:
    for j in range(n2, m2):
        arr2.append(j*D)
    
cnt_c = len(arr1)
cnt_d = len(arr2)
cnt_cd = sum([arr[i]%C==0 for i in range(len(arr))])
cnt = cnt_c+cnt_d-cnt_cd

print(interval-cnt)

### FIXED CODE ###

A, B, C, D = map(int, input().split())

import math

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

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

def myfunc(x, div1, div2):
    div3 = lcm(div1, div2)
    return x-x//div1-x//div2+x//div3

print(myfunc(B, C, D)-myfunc(A-1, C, D))
N, L = map(int, input().split())
S = sorted([input() for i in range(N)])
print(sum(S))

### FIXED CODE ###

N, L = map(int,input().split())
S = sorted([input() for i in range(N)])
print(''.join(S))
a,b=input().split();print(a/b+a%b)

### FIXED CODE ###

a=eval(input().replace(' ', '+'));print(a//2+a%2)