Harryxun/stf_run huggingface dataset:
from sys import stdin
import sys
sys.setrecursionlimit(20000)
N,M,K=list(map(int,input().split()))
friend_list=[set() for _ in range(N+1)]
block_list=[set() for _ in range(N+1)]
def friend_tansaku(i,j):
    color.add(j)
    for friend in friend_list[j]:
        if friend not in color:
            if friend not in block_list[i] and friend not in candidate and friend not in friend_list[i]:
                candidate.add(friend)
                count[0]+=1
            friend_tansaku(i,i)




for _ in range(M):
   a,b= list(map(int, input().split()))
   friend_list[a].add(b)
   friend_list[b].add(a)
for _ in range(K):
    a, b = list(map(int, input().split()))
    block_list[a].add(b)
    block_list[b].add(a)
for i in range(1,N+1):
    count=[0]
    color =set()
    candidate=set()
    friend_tansaku(i,i)
    if i==N:print(count[0])
    else:print(count[0],end=" ")

### FIXED CODE ###

from sys import stdin
import sys
import copy
sys.setrecursionlimit(200000)
N,M,K=list(map(int,input().split()))
counter=[[None,None] for i in range(N+1)]
friend_list=[set() for _ in range(N+1)]
block_list=[set() for _ in range(N+1)]
def friend_tansaku(i,j):
    color.add(j)
    cnt[0]+=1
    for friend in friend_list[j]:
        if friend not in color :
            friend_tansaku(i,friend)





for _ in range(M):
   a,b= list(map(int, input().split()))
   friend_list[a].add(b)
   friend_list[b].add(a)
for _ in range(K):
    a, b = list(map(int, input().split()))
    block_list[a].add(b)
    block_list[b].add(a)
for i in range(1,N+1):
    cnt=[0]
    color =set()
    if counter[i][0] is None:
        friend_tansaku(i,i)
        cnt=cnt[0]
        for aa in color:
            counter[aa]=[color,cnt]
    color,cnt =counter[i][0],counter[i][1]
    for k in block_list[i]:
        if k not in color:
            cnt+=1

    count=cnt-(len(friend_list[i])+len(block_list[i]))-1
    if i==N:print(count)
    else:print(count,end=" ")
n=int(input())
s=list(input())

rn=s.count('R')
gn=s.count('G')
bn=n-rn-gn

ans=0
if n>2:
  
  for x in range(len(s)-2):
    if s[x]=='R':
      rn-=1
      ans+=gn*bn
    elif s[x]=='G':
      gn-=1
      ans+=rn*bn
    else:
      bn-=1
      ans+=gn*rn
    y=(n-1-x)//2
    for i in range(1,y+1):
      if  (not s[x]==s[x+i]) & (not s[x]==s[x+i+i]) & (not s[x+i]==s[x+i+i]):
        ans-=1
        
  print(ans)
    
else:
  print(0)


### FIXED CODE ###

n=list(input())

if '7' in n:
  print('Yes')
  
else:
  print('No')
import sys
line=[int(c) for c in sys.stdin.read]
length=len(line)
while True:
  line2=[]
  for i in range(len(line)-1):
    if line[i]!=2 and line[i]!=line[i+1]:
      line[i]=2
      line[i+1]=2
    elif line[i]!=2:
      line2.append(line[i])
  if len(line)!=0 and line[len(line)-1]!=2:
      line2.append(line[len(line)-1])
  if 2 in line:
    line=[i for i in line2]
  else:
    break
print(length-len(line))

### FIXED CODE ###

s=str(input())
if s.count('1')>s.count('0'):
    print(s.count('0')*2)
else:
    print(s.count('1')*2)
n = int(input())
t,a = map(int,input().split())
s = []
f = 1
for i in range(1,n+1):
    h = int(input())
    d = int(abs(a-t-h*0.006))
    s.append(d)
    if d == min(s):
       f = i
print(f)


### FIXED CODE ###

n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
s = []

for i in h:
    s.append(abs(t-i*0.006-a))

print(s.index(min(s))+1)
N,T = map(int,input().split())
c = []
t = []
for i in range(N):
  a,b = map(int,input().split())
  c.append(a)
  t.append(b)
result = []
for j in range(N):
  if T >= t[j]:
    result.append(c[j])
  else:
    None
print(min(result))


### FIXED CODE ###

N,T = map(int,input().split())
c = []
t = []
for i in range(N):
  a,b = map(int,input().split())
  c.append(a)
  t.append(b)
result = []
for j in range(N):
  if T >= t[j]:
    result.append(c[j])
  else:
    None
print(min(result) if len(result) > 0 else "TLE")
import sys
sys.setrecursionlimit(10 ** 9)

n, m = map(int, input().split())
root = [-1] * (110000)
def find(x):
    if root[x] >= 0:
        root[x] = find(x)
        return root[x]
    else:
        return x

def unite(a, b):
    a = find(a)
    b = find(b)
    if a != b:
        root[a] += root[b]
        root[b] = a
        

for _ in range(m):
    a, b = map(int, input().split())
    unite(a, b)

ans = 0
for i in range(1, n+1):
    if root[i]  < 0:
        ans += 1
print(ans-1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)

n, m = map(int, input().split())
root = [-1] * n
def find(x):
    if root[x] < 0:
        return x
    else:
        root[x] = find(root[x])
        return root[x]
    

def unite(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    root[x] += root[y]
    root[y] = x
        

for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    unite(a, b)

ans = len([i for i in root if i < 0]) - 1
print(ans)
cnt_st0 = 0
cnt_st1 = 0
in_str = str(input())
for i, m in enumerate(in_str):
  if i % 2 == 0:
    if m == '0':
      cnt_st1 += 1
    else:
      cnt_st0 += 1
  else:
    if m == '0':
      cnt_st0 += 1
    else:
      cnt_st1 += 1
      
print(min(cnt_st0, cnt_St1))

### FIXED CODE ###

cnt_st0 = 0
cnt_st1 = 0
in_str = str(input())
for i, m in enumerate(in_str):
  if i % 2 == 0:
    if str(m) == '0':
      cnt_st1 += 1
    else:
      cnt_st0 += 1
  else:
    if str(m) == '0':
      cnt_st0 += 1
    else:
      cnt_st1 += 1
print(min(cnt_st0, cnt_st1))
import sys
from bisect import bisect_left


def dfs(v, p, links, state, ans):
    # print(v, p, state, ans)
    ans[v] = len(state)
    for u in links[v]:
        if u == p:
            continue
        a = aaa[u]
        b = -1
        i = bisect_left(state, aaa[u])
        if i == len(state):
            state.append(a)
        else:
            b = state[i]
            state[i] = a
        dfs(u, v, links, state, ans)
        if b == -1:
            state.pop()
        else:
            state[i] = b


n = int(input())
aaa = list(map(int, input().split()))
links = [set() for _ in range(n)]
for line in sys.stdin:
    u, v = map(int, line.split())
    u -= 1
    v -= 1
    links[u].add(v)
    links[v].add(u)
ans = [0] * n
dfs(0, -1, links, [aaa[0]], ans)
print('\n'.join(map(str, ans)))


### FIXED CODE ###

import sys
from bisect import bisect_left

sys.setrecursionlimit(10 ** 6)


def dfs(v, p, links, state, ans):
    ans[v] = len(state)
    for u in links[v]:
        if u == p:
            continue
        a = aaa[u]
        b, i = -1, -1
        if state[-1] < a:
            state.append(a)
        else:
            i = bisect_left(state, a)
            b = state[i]
            state[i] = a
        dfs(u, v, links, state, ans)
        if b == -1:
            state.pop()
        else:
            state[i] = b


n = int(input())
aaa = list(map(int, input().split()))
links = [set() for _ in range(n)]
for line in sys.stdin:
    u, v = map(int, line.split())
    u -= 1
    v -= 1
    links[u].add(v)
    links[v].add(u)
ans = [0] * n
dfs(0, -1, links, [aaa[0]], ans)
print('\n'.join(map(str, ans)))
A,op,B=(int(x) for x in input().split())
if(op=="+"):
    print(A+B)
else:
    print(A-B)


### FIXED CODE ###

A,op,B=(x for x in input().split())
A1=int(A)
B1=int(B)
if(op=="+"):
    print(A1+B1)
else:
    print(A1-B1)
a,b=map(int, input().split())
from scipy.special import comb
print(comb(10**4, 100, exact=True)%(10**9+7))


### FIXED CODE ###

n,k=map(int, input().split())
if -(-n//2)>=k:print('YES')
else:print('NO')
from collections import defaultdict
from operator import sub

def main():
    N = int(input())
    balls = [tuple(map(int,input().split())) for _ in range(N)]
    d = defaultdict(int)
    for i in range(N):
        for j in range(N):
            if i == j:
                continue
            d[tuple(map(sub, balls[i], balls[j]))] += 1
    mmax = max(d.values())
    mmax = int(N - mmax)
    try:
        print(mmax)
    except:
        print(100)


if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import defaultdict
from operator import sub

def main():
    N = int(input())
    balls = [tuple(map(int,input().split())) for _ in range(N)]
    d = defaultdict(int)
    for i in range(N):
        for j in range(N):
            if i == j:
                continue
            d[tuple(map(sub, balls[i], balls[j]))] += 1
    try:
        mmax = N - max(d.values(), default=0)
        print(mmax)
    except ValueError:
        print(100)

if __name__ == '__main__':
    main()
import sys

def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym:
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1, 0, 1, 0]
DY = [0, -1, 0, 1]

tile = [[0 for i in range(1)] for j in range(1)]
while True:
        sys.setrecursionlimit(10000000)
	counter+=1
	line = input()
	if ' ' in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(N)] for j in range(M)]
	if N is 0 and M is 0:
		break
	else:
		tile[counter-2] = list(line)
	if (counter-1)==M:
		solve()
		counter = 0

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys
def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym):
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1,0,1,0]
DY = [0,-1,0,1]
sys.setrecursionlimit(10**7)
while True:
	line = input()
	if " " in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(M)] for j in range(N)]
	else:
		tile[counter-1] = list(line)
	if N is 0 and M is 0:
		break
	counter += 1
	if counter-1 is N:
		solve()
		counter = 0
import sys


H, W = map(int, input().split())
m = [input() for i in range(H)]

valid = True
dx = [0, 0, 1, -1]
dy = [-1, 1, 0, 0]
for y in range(H):
    for x in range(W):
        if m[y][x] != '#':
            continue
        cnt = 0
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]
            if 0 <= nx and nx < W and \
               0 <= ny and ny < H and m[ny][nx] == '#':
                cnt += 1
        if cnt >= 3:
            valid = False
            print("Impossible")
            sys.exit()


def rec(x, y):
    if x == W - 1 and y == H - 1:
        return True

    if m[y][x] != '#':
        return False
    dx = [0, 1]
    dy = [1, 0]
    valid = False
    for i in range(4):
        nx = x + dx[i]
        ny = y + dy[i]
        if 0 <= nx and nx < W and \
           0 <= ny and ny < H and m[ny][nx] == '#':
            ret = rec(nx, ny)
            if ret:
                return ret
    return False


if rec(0, 0):
    print("Possible")
else:
    print("Impossible")


### FIXED CODE ###


H, W = map(int, input().split())
m = [input() for i in range(H)]

cnt = 0
for h in range(H):
    for w in range(W):
        if m[h][w] == '#':
            cnt += 1

def rec(x, y):
    if x == W - 1 and y == H - 1:
        return True

    if m[y][x] != '#':
        return False
    dx = [0, 1]
    dy = [1, 0]

    for i in range(2):
        nx = x + dx[i]
        ny = y + dy[i]
        if 0 <= nx and nx < W and \
           0 <= ny and ny < H:
            ret = rec(nx, ny)
            if ret:
                return ret
    return False


if rec(0, 0) and cnt == H + W - 1:
    print("Possible")
else:
    print("Impossible")
n = int(input())
a = list(map(int, input().split()))

from sympy import Indexed, IndexedBase, Tuple, sqrt, solve

A = IndexedBase('A')
eqs = Tuple()
for i in range(n-1):
    eqs += Tuple(A[i]+A[i+1]-2*a[i])
eqs += Tuple(A[n-1]+A[0]-2*a[n-1])

ans = solve(eqs, eqs.atoms(Indexed))

ans = [x for x in ans.values()]

print(' '.join(map(str, ans)))


### FIXED CODE ###

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

ans = []
ans += [sum(a) - 2*sum(a[1::2])]
for i in range(0, n-1):
    ans += [2*a[i]-ans[i]]

print(' '.join(map(str, ans)))
#!/usr/bin/env python
# coding: utf-8

import math


def main():
    x1, y1, x2, y2 = [int(i) for i in raw_input().split(" ")]
    if x1 < x2:
        x1, x2 = x2, x1
    w = x1 - x2
    if y1 < y2:
        y1, y2 = y2, y1
    h = y1 - y2
    print "%1.8f" % math.sqrt(w ** 2 + h ** 2)

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env python
# coding: utf-8

import math


def main():
    x1, y1, x2, y2 = [float(i) for i in raw_input().split(" ")]
    if x1 < x2:
        x1, x2 = x2, x1
    w = x1 - x2
    if y1 < y2:
        y1, y2 = y2, y1
    h = y1 - y2
    print "%1.8f" % math.sqrt(w ** 2 + h ** 2)

if __name__ == '__main__':
    main()
n=int(input())
p=list(map(int,input().split()))
new_p=p.sort()
cnt=0

for i in range(n):
    if p[i] != new_p[i]:
        cnt += 1
        
if cnt > 2:
    print('NO')
else:
    print('YES')

### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))
new_p=sorted(p)
cnt=0

for i in range(n):
    if p[i] != new_p[i]:
        cnt += 1
        
if cnt > 2:
    print('NO')
else:
    print('YES')
from bisect import *
N = int(input())
S = input()

swapleft = []
swapright = []

for i in range(N):
    if S[i] == "B":
        if (i+1) % 2 == 0:
            swapright.append(i+1)
    else:
        if (i+1) % 2 == 1:
            swapright.append(i+1)

for i in range(N, 2*N):
    if S[i] == "B":
        if (i+1) % 2 == 1:
            swapleft.append(i+1)
    else:
        if (i+1) % 2 == 0:
            swapleft.append(i+1)

swapleft = set(swapleft)
swapright = set(swapright)

swapleft |= set([i for i in range(1, N+1)]) - swapright
swapright = set([i for i in range(1, 2*N+1)]) - swapleft
swapleft = list(swapleft)
swapleft.sort(reverse = True)
lmax = max(swapleft)
swapright = list(swapright)
swapright.sort()

ans = 1

for i in range(N):
    ans *= (N - bisect_left(swapright, swapleft[i]) - i)
    ans %= 1000000007


for i in range(1, N+1):
    ans *= i
    ans %= 1000000007

print(ans)


### FIXED CODE ###

from bisect import *
N = int(input())
S = input()

swapleft = []
swapright = []

for i in range(N):
    if S[i] == "B":
        if (i+1) % 2 == 0:
            swapright.append(i+1)
    else:
        if (i+1) % 2 == 1:
            swapright.append(i+1)

for i in range(N, 2*N):
    if S[i] == "B":
        if (i+1) % 2 == 1:
            swapleft.append(i+1)
    else:
        if (i+1) % 2 == 0:
            swapleft.append(i+1)


swapleft = set(swapleft)
swapright = set(swapright)

if len(swapleft) > len(swapright):
    swapleft |= set([i for i in range(1, N+1)]) - swapright
    swapright = set([i for i in range(1, 2*N+1)]) - swapleft

else:
    swapright |= set([i for i in range(N+1, 2*N+1)]) - swapleft
    swapleft = set([i for i in range(1, 2*N+1)]) - swapright

if len(swapright) != len(swapleft):
    print(0)
else:

    swapleft = list(swapleft)

    swapleft.sort(reverse = True)
    swapright = list(swapright)
    swapright.sort()

    ans = 1

    for i in range(N):
        ans *= (N - bisect_left(swapright, swapleft[i]) - i)
        ans %= 1000000007


    for i in range(1, N+1):
        ans *= i
        ans %= 1000000007

    print(ans)
if k >= 1:
    print("OK")

if b - a + 2 >= k:
    print("OK")
else:
    print("NG")


### FIXED CODE ###

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

a_div_k = a // k
b_div_k = b // k

a_mod_k = a % k
b_mod_k = b % k

if b < k:
    print("NG")
elif k == 1:
    print("OK")
elif k == b:
    print("OK")
elif (a_mod_k == 0) or (b_mod_k == 0) and (a_div_k == b_div_k):
    print("OK")
elif (k < a) and (a_div_k == b_div_k):
    print("NG")
else:
    print("OK")
#!/usr/bin python3
# -*- coding: utf-8 -*-

n = int(input())
dp = [[0]*20 for _ in range(20)]
dq = [[0]*20 for _ in range(20)]

for i in range(n):
    s = input()
    x = s.find('.')
    if x == -1:
        s = s + '0'*9
    else:
        s = s.replace('.','') + '0'*(10-(len(s)-x))
    s = int(s)
    d2 = 0
    d5 = 0
    for i in range(20):
        if s%2 == 0:
            s = s//2
            d2 += 1
        else:
            break
    for i in range(20):
        if s%5 == 0:
            s = s//5
            d5 += 1
        else:
            break
    dp[d2][d5] += 1
    dq[d2][d5] += 1

for i in list(range(19))[::-1]:
    for j in list(range(19))[::-1]:
        dp[i][j-1]+=dp[i][j]
for j in list(range(19))[::-1]:
    for i in list(range(19))[::-1]:
        dp[i-1][j]+=dp[i][j]
ret = 0
for i in range(20):
    for j in range(20):
        ret += dq[i][j] * dp[18-i][18-j]
ret -= dp[9][9]
print(ret//2)

### FIXED CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-

n = int(input())
dp = [[0]*19 for _ in range(19)]
dq = [[0]*19 for _ in range(19)]

for i in range(n):
    s = input()
    x = s.find('.')
    if x == -1:
        s = s + '0'*9
    else:
        s = s.replace('.','') + '0'*(10-(len(s)-x))
    s = int(s)
    d2 = 0
    d5 = 0
    for _ in range(18):
        if s%2 != 0:
            break
        s = s//2
        d2 += 1
    for _ in range(18):
        if s%5 != 0:
            break
        s = s//5
        d5 += 1
    dp[d2][d5] += 1
    dq[d2][d5] += 1

for i in range(18,-1,-1):
    for j in range(18,0,-1):
        dp[i][j-1]+=dp[i][j]
for j in range(18,-1,-1):
    for i in range(18,0,-1):
        dp[i-1][j]+=dp[i][j]

ret = 0
for i in range(19):
    for j in range(19):
        if dq[i][j] == 0:
            continue
        ret += dq[i][j] * dp[18-i][18-j]
ret -= dp[9][9]
print(ret//2)
n, k = map(int, input().split())
 
p = list(map(int, input().split()))

p = [(e+1) / 2 for e in p]

s_max = sum(p[0:k])

for i in range(n-k+1):
  s = s - p[i] + p[i+k]
  if s_max < s:
    s_max = s
    
print(s_max)

### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))

m = [(e + 1) / 2 for e in p]

t = sum(m[0:K])
result = t
for i in range(N - K):
    t -= m[i]
    t += m[i + K]
    if t > result:
        result = t
print(result)
ab=input().split()
a=int(ab[0])
b=ab[1].replace('.','')
ans=a*b//100
print(ans)


### FIXED CODE ###

ab=input().split()
a=int(ab[0])
b=ab[1].replace('.','')
b=int(b)
ans=a*b//100
print(ans)
N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()

ans = 0
a = A[0]
work = 1
for i in (1, N):
    if A[i] == a:
        work += 1
    else:
        if work % 2 == 0:
            pass
        else:
            ans += 1
        work = 1
        a = A[i]

print(ans)

### FIXED CODE ###

'''
全量のリストを用いると検索対象が大きくなってしまうため、ディクショナリで都度追加/削除する
'''

N = int(input())

A = {}

for _ in range(N):
    tmp = int(input())
    if tmp in A:
        del A[tmp]
    else:
        A[tmp] = 1

print(len(A))
N = [int(input()) for i in range(3)]
if N[0] <= N[2] <= N[1]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a<=c and c<=b:
    print("Yes")
else:
    print("No")
n=int(input())
y=sorted(list(map(int,input().split())))
x1, x2 = y[n//2-1], y[n//2]
for i in range(n):
    if x[i]<=x1:
        print(x2)
    else:
        print(x1)


### FIXED CODE ###

n=int(input())
x=list(map(int,input().split()))
N=int(n/2)
y=sorted(x)
a=y[N-1]
b=y[N]
for j in range(n):
    if x[j]<=a:
        print(b)
    else:
        print(a)
n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [[int(i) for i in input().split()] for i in range(m)]
bc.sort(key = lambda x:x[1], reverse = True)

d = []
d_count = 0

while d_count <= n:
        for b, c in bc:
                d.extend([b for i in range(c)])
                d_count += c

ans = []

sort(a.extend(d), reverse = True)

for i in range(n):
        ans.append(a[i])

print(sum(ans))

### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [[int(i) for i in input().split()] for i in range(m)]

bc.sort(key = lambda x:x[1], reverse = True)

a.sort()

a_count = 0
for b, c in bc:
        if c > a[a_count]:
                for i in range(b):
                        if c > a[a_count]:
                                a[a_count] = c
                                a_count += 1    
                        else:
                                break
                        if a_count == n:
                                        break

        else:
                break
        if a_count == n:
                break        

print(sum(a))
h,a,*m=open(0)
h,w,k,a,b,f,g=map(int,(h+a).split())
I=h*w
d=[I]*I
m+=d,
a=~w+a*w+b
q=[a]
d[a]=1
for s in q:
 for x in 0,1,2,3:
  for z in range(k):
   y=~z,0,z+1,0;i,j=s//w+y[x],s%w+y[~x];t=i*w+j;p=d[s]+1
   if'.'!=m[i][j]ord[t]<p:break
   if d[t]>p:q+=t,;d[t]=p
print(d[~w+f*w+g]%I-1)


### FIXED CODE ###

h,a,*m=open(0)
h,w,k,a,b,f,g=map(int,(h+a).split())
I=h*w
d=[I]*I
m+=d,
a=~w+a*w+b
q=[a]
d[a]=1
for s in q:
 for x in 0,1,2,3:
  for z in range(k):
   y=~z,0,z+1,0;i,j=s//w+y[x],s%w+y[~x];t=i*w+j;p=d[s]+1
   if'.'!=m[i][j]or d[t]<p:break
   if d[t]>p:q+=t,;d[t]=p
print(d[~w+f*w+g]%I-1)
import math
from functools import reduce

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

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

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

n = int(input())
list_T = [int(input()) for _ in range(n)]

print(lcm_list(list_T))


### FIXED CODE ###

from fractions import gcd
from functools import reduce


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

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

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

n = int(input())
list_T = [int(input()) for _ in range(n)]

print(lcm_list(list_T))
# -*- coding: utf-8 -*-
import heapq
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N, M = map(int, input().split())
L = list(map(int, input().split()))
OP = [list(map(int, input().split())) for _ in range(M)]
heapq.heapify(L)
OP = sorted(OP, key=lambda x: x[1], reverse=True)
ans = 0

for m, n in OP:
    for _ in range(m):
        head = heapq.heappop(L)
        if head < n:
            ans += n
        else:
            print(ans+sum(L)+head)
            exit()
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import heapq
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N, M = map(int, input().split())
L = list(map(int, input().split()))
OP = [list(map(int, input().split())) for _ in range(M)]
heapq.heapify(L)
OP = sorted(OP, key=lambda x: x[1], reverse=True)
ans = 0

for m, n in OP:
    for _ in range(m):
        if L:
            head = heapq.heappop(L)
            if head < n:
                ans += n
            else:
                print(ans+sum(L)+head)
                exit()
        else:
            print(ans)
            exit()
print(ans+sum(L))
lst = imput().split()
if int(lst[0]) >= 3200:
  print(lst[1])
else:
  print('red')

### FIXED CODE ###

a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print('red')
n, m, q = map(int, input().split())
I = list(range(1, m + 1))
A = list(map(list, itertools.combinations(I, n)))
l = len(A)
ans = [0 for i in range(l)]
for _ in range(q):
    a, b, c, d = map(int, input().split())
    for i in range(l):
        if A[i][b - 1] - A[i][a - 1] == c:
            ans[i] += d
print(max(ans))

### FIXED CODE ###

import itertools

n, m, q = map(int, input().split())
I = list(range(1, m + 1))
A = list(map(list, itertools.combinations_with_replacement(I, n)))
l = len(A)
ans = [0 for i in range(l)]
for _ in range(q):
    a, b, c, d = map(int, input().split())
    for i in range(l):
        if A[i][b - 1] - A[i][a - 1] == c:
            ans[i] += d
print(max(ans))
N = int(input())
S = input()
#N = 12
#S = 'WEWEWEEEWWWE'


min = 1000000
e = S.count('E')
w = 0

for i in range(0,N-1):
    flag = 0
    now = S[i]
    if now == 'E':
        e = e - 1
    else:
        flag = 1
    sum = w + e
    if min > sum:
        min = sum
    if flag:
        w = w + 1
print(min)


### FIXED CODE ###

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

n_sum = n[0] + n[1]
n_sub = n[0] - n[1]
n_mul = n[0] * n[1]

ans = max(n_sum,n_sub,n_mul)
print(ans)