Harryxun/stf_run huggingface dataset:
# ABC091B

n = int(input)
s = [0] * n
for i in range(n):
    s[i] = input()
m = int(input)
t = [0] * m
for i in range(m):
    t[i] = input()

blue = {}
for c in s:
    if c in blue.keys():
        blue[c] += 1
    else:
        blue.setdefault(c, 1)
red = {}
for c in t:
    if c in red.keys():
        red[c] += 1
    else:
        red.setdefault(c, 1)

Max = 0
for blue_key, blue_value in blue.items():
    get = blue_value
    if blue_key in red.keys():
        for red_key, red_value in red.items():
            if blue_key == red_key:
                get -= red_value
                break
    Max = max(Max, get)
print(Max)


### FIXED CODE ###

# ABC091B

n = int(input())
s = [0] * n
for i in range(n):
    s[i] = input()
m = int(input())
t = [0] * m
for i in range(m):
    t[i] = input()

blue = {}
for c in s:
    if c in blue.keys():
        blue[c] += 1
    else:
        blue.setdefault(c, 1)
red = {}
for c in t:
    if c in red.keys():
        red[c] += 1
    else:
        red.setdefault(c, 1)

Max = 0
for blue_key, blue_value in blue.items():
    get = blue_value
    if blue_key in red.keys():
        for red_key, red_value in red.items():
            if blue_key == red_key:
                get -= red_value
                break
    Max = max(Max, get)
print(Max)
N,L = map(int,input().split())
S = [input() for i in range(N)]

S.sort()

s = ""
for i in range(N):
    s += S[i]

print(s)


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Wed May 13 11:57:51 2020

@author: shinba
"""

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

B = [[5,5,7],[5,7,5],[7,5,5]]

if A in B:
    print("YES")
else:
    print("NO")
from typing import List


class Solution:

    def solve(self, S: str, Q: int, Query) -> int:

        num_reverse = 0
        for q in Query:
            if int(q[0]) == 1:
                num_reverse += 1
            else:
                if (num_reverse + int(q[1])) % 2 == 0:
                    S = S + q[2]
                else:
                    S = q[2] + S

        if num_reverse % 2 == 1:
            S = S[::-1]

        return S


if __name__ == '__main__':

    # standard input
    S = input()
    Q = int(input())
    Query = []
    for _ in range(Q):
        Query.append(tuple(input().split()))

    # solve
    solution = Solution()
    print(solution.solve(S, Q, Query))


### FIXED CODE ###

# standard input
S = input()
Q = int(input())
Query = []
num_reverse = 0

L = ''
R = ''

rev = False

for _ in range(Q):

    q = tuple(map(str, input().split()))

    if q[0] == '1':
        rev = (not rev)

    else:
        if (rev and q[1] == '1') or (not rev and q[1] == '2'):
            R = R + q[2]
        else:
            L = q[2] + L 

if rev:
    print( R[::-1] + S[::-1] + L[::-1])
else:
    print( L + S + R )
A, B = map(int, input().split())
if B % A = 0:
  print(int(B//A * A))
else:
  print(B//A * A + 1)

### FIXED CODE ###

A, B = map(int, input().split())
ans = 0
tap = 0
for i in range(10000):
    if B == 1:
        break
    if i == 0:
        tap += A
        ans += 1
    if i >= 1:
        tap -= 1
        tap += A
        ans += 1
    if tap >= B:
        break
print(ans)
def main(N):
    CP = 4
    DP = 7
    
    if N <= 3:
        return f"No"
    
    for i in range(26):
        for j in range(15):
            if (CP * i + DP * j) == N:
                return f"Yes"
    
    return f"No"
  

### FIXED CODE ###

def main(N):
  
    CP = 4
    DP = 7
    
    if N <= 3:
        return "No"
    
    for i in range(100):
        for j in range(100):
            if (CP * i + DP * j) == N:
                return "Yes"
    return "No"
N = int(input())
print(main(N))
class Node:
    def __init__(self, parent, left, right):
        self.parent = parent
        self.left = left
        self.right = right

    def get_type(self):
        if self.parent == -1: return "root"
        elif self.left == -1: return "leaf"
        else: return "internal node"

def set_depth(u,d):
    global D
    global tree
    D[u] = d
    if not tree[u].right == -1:
        set_depth(tree[u].right, d)
    if not tree[u].left == -1:
        set_depth(tree[u].left, d+1)

def print_tree(t,D):
    for i in range(len(t)):
        children = []
        c = t[i].left
        if not c == -1:
            while True:
                children.append(c)
                c = t[c].right
                if c == -1: break
        print "node %s: parent = %s, depth = %s, %s, [%s]" % (i, t[i].parent, D[i], t[i].get_type(), ", ".join(map(str, children)))

n = int(raw_input())

tree = {}
for i in range(n):
    tree[i] = Node(-1, -1, -1)
for _ in range(n):
    entry = map(int, raw_input().strip().split(' '))
    nid = entry[0]
    n_child = entry[1]
    for i in range(n_child):
        if i == 0: tree[nid].left = entry[i+2]
        else: tree[entry[i+1]].right = entry[i+2]
        tree[entry[i+2]].parent = nid

r = -1
for i in range(n):
    if tree[i].parent == -1: r = i

D = {}
set_depth(r, 0)

print_tree(tree, D)

### FIXED CODE ###

class Node:
    def __init__(self, parent, left, right):
        self.parent = parent
        self.left = left
        self.right = right

    def get_type(self):
        if self.parent == -1: return "root"
        elif self.left == -1: return "leaf"
        else: return "internal node"

def set_depth(u,d):
    global D
    global tree
    D[u] = d
    v = tree[u].right
    while not v == -1:
        D[v] = d
        if not tree[v].left == -1:
            set_depth(tree[v].left, d+1)
        v = tree[v].right
    if not tree[u].left == -1:
        set_depth(tree[u].left, d+1)

def print_tree(t,D):
    for i in range(len(t)):
        children = []
        c = t[i].left
        if not c == -1:
            while True:
                children.append(c)
                c = t[c].right
                if c == -1: break
        print "node %s: parent = %s, depth = %s, %s, [%s]" % (i, t[i].parent, D[i], t[i].get_type(), ", ".join(map(str, children)))

n = int(raw_input().strip())

tree = {}
for i in range(n):
    tree[i] = Node(-1, -1, -1)
for _ in range(n):
    entry = map(int, raw_input().strip().split(' '))
    nid = entry[0]
    n_child = entry[1]
    for i in range(n_child):
        if i == 0: tree[nid].left = entry[i+2]
        else: tree[entry[i+1]].right = entry[i+2]
        tree[entry[i+2]].parent = nid

r = -1
for i in range(n):
    if tree[i].parent == -1: r = i

D = {}
set_depth(r, 0)

print_tree(tree, D)
n, m = map(int, input().split())
h = list(map(int, input().split()))
x = []
for j in range(m):
    a = list(map(int, input().split()))
    s = a[0] - 1
    t = a[1] - 1
    if h[s] <= h[t]:
        x.append(t)
    else
        x.append(s)

print(len(set(x)))    

        

### FIXED CODE ###

n, m = map(int, input().split())
h = list(map(int, input().split()))
x = [0 for _ in range(n)]
for j in range(m):
    a = list(map(int, input().split()))
    s = a[0] - 1
    t = a[1] - 1
    if h[s] < h[t]:
        x[s] = 1
    elif h[s] > h[t]:
        x[t] =1
    else:
        x[s] = 1
        x[t] = 1

print(x.count(0))
# n個からk個を選ぶ順列
def perm(n, k):
    if n == 0:
        return 0
    else:
        result = 1
        if k != 0:
            for i in range(k):
                result *= (n - i)
        return result

# n個からk個を選ぶ組合せ
def comb(n, k):
    if n == 0:
        return 0
    else:
        k = min(k, n - k)
        if k == 0:
            return 1
        else:
            return perm(n, k) / perm(k, k)

# n種類からk個を選ぶ重複組合せ
def homo(n, k):
    if n == 0:
        return 0
    else:
        return comb(n + k - 1, k)

def main(n, k, i):
    # 青玉k個のうち、まずi箇所に1個ずつ配置
    # 残りの(k - i)個を、ゼロを許容してi箇所に配置 => i種類から(k - i)個を選ぶ重複組合せ
    result = homo(i, k - i)
    # 赤玉(n - k)個のうち、まず(i - 1)個は青玉を区切るために配置
    # 残りの(n - k - i + 1)個を、ゼロを許容して(i + 1)箇所に配置 => (i + 1)種類から(n - k - i + 1)個を選ぶ重複組合せ
    result *= homo(i + 1, n - k - i + 1)
    result = result % (10**9 + 7)
    return int(result)

N, K = [int(x) for x in input().split()]
for i in range(K):
    print(main(N, K, i + 1))

### FIXED CODE ###

# パスカルの三角形
def pascal_triangle(n):
    pascal =[[]]
    pascal[0].append(1)
    for i in range(1, n + 1):
        pascal[i - 1].append(0)
        pascal.append([])
        for j in range(i + 1):
            pascal[i].append((pascal[i - 1][j - 1] + pascal[i - 1][j]) % (10**9 + 7))
    return pascal

# n個からr個を選ぶ組合せ
def comb(n, r, pascal_triangle):
    r = min(r, n - r)
    if r == 0:
        return 1
    if r == 1:
        return n
    result = pascal_triangle[n][r]
    return result

# n種類からr個を選ぶ重複組合せ
def homo(n, r, pascal_triangle):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return comb(n + r - 1, r, pascal_triangle)

def main(n, k, i, pascal_triangle):
    # 青玉k個のうち、まずi箇所に1個ずつ配置
    # 残りの(k - i)個を、ゼロを許容してi箇所に配置 => i種類から(k - i)個を選ぶ重複組合せ
    result = homo(i, k - i, pascal_triangle)
    # 赤玉(n - k)個のうち、まず(i - 1)個は青玉を区切るために配置
    # 残りの(n - k - i + 1)個を、ゼロを許容して(i + 1)箇所に配置 => (i + 1)種類から(n - k - i + 1)個を選ぶ重複組合せ
    # ただし、そもそも赤玉が(i - 1)個未満の場合は、論外
    if (n - k) < (i - 1):
        return 0
    result *= homo(i + 1, n - k - i + 1, pascal_triangle)
    result = result % (10**9 + 7)
    return int(result)

N, K = [int(x) for x in input().split()]
pascal_triangle = pascal_triangle(N)
for i in range(K):
    print(main(N, K, i + 1, pascal_triangle))
import math

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

for i in range(1,K+1):
	print(math.factorial(N-K+1)//math.factorial(N-K+1-i)//math.factorial(i)*math.factorial(K-1)//math.factorial(K-i)//math.factorial(i-1)%1000000007)

### FIXED CODE ###

from math import factorial
N, K = map(int, input().split())
mod = 10**9 + 7
def combination(n, r):
	if n >= r:
		return int(factorial(n) // (factorial(r) * factorial(n - r)))
	else:
		return 0

for i in range(1, K+1):
	print(combination(N-K+1, i) * combination(K-1, i-1)%mod)
n, k = map(int, input().split())
h = list(map(int,input().split()))

h.sort(reverse = True)
for i in range(k-1):
    h[i] = 0
print(sum(h))

### FIXED CODE ###

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

h.sort(reverse = True)
print(sum(h[k::]))
n = map(int, input())
alist = list(map(int, input().split(" ")))

def do_sunuke(l, cnt) : 
    reslist = []
    flg_div2 = 0

    for a in l :
        if a % 2 == 0 and flg_div2 == 0 :
            reslist.append(int(a/2))
            flg_div2 = 1
        else :
            reslist.append(a)

    if flg_div2 == 0 :
        return cnt
    else : 
        return do_sunuke(reslist, cnt + 1)
    
print(do_sunuke(alist, 0))

### FIXED CODE ###

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

def two_factor(n) :
    cnt = 0

    while n % 2 == 0:
        n /= 2
        cnt += 1

    return cnt 
    
fact_cnt = 0
for a in alist :
    fact_cnt += two_factor(a)
    
print(fact_cnt)
N = int(input())
inputs = [int(input()) for i in range(N)]

points = [int(s) for s in inputs]
points_sorted = sorted(points)

get_point = sum(points)

idx = 0
if get_point % 10 != 0:
    print(get_point)
else:
    while points_sorted[idx] % 10 == 0:
        idx += 1
        if idx == N - 1:
            print(0)
    print(get_point - points_sorted[idx])

### FIXED CODE ###

N = int(input())
inputs = [int(input()) for i in range(N)]

points = [int(s) for s in inputs]
points_sorted = sorted(points)

get_point = sum(points_sorted)
non_10 = [x for x in points_sorted if (x % 10 != 0)]

if get_point % 10 != 0:
    print(get_point)
elif non_10 == []:
    print(0)
else:
    print(get_point - min(non_10))
_ = input()
A = list(map(int, input().split()))
b = np.prod(A)
b = b if b < 10 ** 18 else -1
print(b)

### FIXED CODE ###

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

ans = 1
for a in A:
    ans *= a

    if ans > 10 ** 18:
        break
ans = 0 if 0 in A else ans
ans = ans if ans <= 10 ** 18 else -1
print(ans)
N, M = map(int, input().split())
G = {k: [] for k in range(N+1)}
for _ in range(N):
    a, b = map(int, input().split())
    # 無向グラフ
    G[a-1].append(b-1)
    G[b-1].append(a-1)

visited = [False]*N
visited[0] = True
ans = 0


def dfs(v):
    if all(visited):
        return 1
    r = 0
    for nv in G[v]:
        if visited[nv] is False:
            visited[nv] = True
            r += dfs(nv)
            visited[nv] = False
    return r


print(dfs(0))


### FIXED CODE ###

import itertools

N,M=map(int,input().split())
route=[list(map(int,input().split())) for _ in range(M)]
candidate=list(itertools.permutations(range(1,N+1)))

ans=0
for c in candidate:
  if c[0]==1:
    for i in range(N-1):
      l=sorted([c[i], c[i+1]])
      if l not in route:
         break
    else:
      ans+=1
print(ans)
a,b=(int(e)*2-1 for e in input()[::2])
print(max(a,b,(a+b)//2+1))

### FIXED CODE ###

a, b = map(int, input().split())
c = max(a,b)
print(c + max(c-1, min(a,b)))
x, y, z, k = map(int, input().split())
cs = list(map(int, input().split()))
bs = list(map(int, input().split()))
a_s = list(map(int, input().split()))
a_s.sort(reverse=True)
bs.sort(reverse=True)
cs.sort(reverse=True)

list = []
i = -1
m = int(k/3)
minlist = 0
if m < min(len(a_s), len(bs), len(cs)):
    minlist = a_s[m] + bs[m] + cs[m]
for a in a_s:
    if minlist >= (a + bs[0] + cs[0]):
        break
    for b in bs:
        if minlist >= (a + b + cs[0]):
            break
        for c in cs:
            abc = a + b +c
            if minlist >= abc:
                break
            list.append(abc)
            i += 1
list.sort(reverse=True)
for i in range(k):
    print(list[i])


### FIXED CODE ###

x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ab = []
for ai in a:
  for bi in b:
    ab.append(ai + bi)
ab.sort(reverse = True)

abc = []

for abi in ab[:k]:
  for ci in c:
    abc.append(abi + ci)
abc.sort(reverse = True)

for abci in abc[:k]:
  print(abci)
x = list(map(int, input().split()))

for i in range(len(x)):
    if x[i] == 0:

### FIXED CODE ###

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

for i in range(len(x)):
    if x[i] == 0:
        print(i+1)
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(M)]

class UnionFind(object):
    def __init__(self, N):
        self.parent = [-1] * (N)
    
    #Aがどのグループに属しているかを調べる
    def root(self, A):
        if self.parent[A-1] < 0:
            return A
        self.parent[A-1] = self.root(self.parent[A-1])
        return self.parent[A-1]

    #自分がいるグループのチュ点数を調べる    
    def size(self, A):
        return self.parent[self.root(A)-1]
    
    #AとBをくっ付ける
    def connect(self, A, B):
        A = self.root(A)
        B = self.root(B)
        if A == B:
            return False
        #大きい方(A)に小さい方(B)をくっつけたい
        #大小が逆であればひっくり返す
        if self.size(A) < self.size(B):
            A, B = B, A
        
        self.parent[A-1] += self.parent[B-1]
        self.parent[B-1] = A
        return True

ans = [0] * M
ans[M-1] = N * (N-1) //2
uni = UnionFind(N)
for i in range(M-1, 0, -1):
    if uni.root(ab[i][0]) != uni.root(ab[i][1]):
        ans[i-1] = ans[i] - uni.size(ab[i][0]) * uni.size(ab[i][1])
        uni.connect(ab[i][0], ab[i][1])


for i in ans:
    print (i)



### FIXED CODE ###

N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(M)]

class UnionFind(object):
    def __init__(self, N):
        self.parent = [-1] * (N)
    
    #Aがどのグループに属しているかを調べる
    def root(self, A):
        if self.parent[A-1] < 0:
            return A
        self.parent[A-1] = self.root(self.parent[A-1])
        return self.parent[A-1]

    #自分がいるグループのチュ点数を調べる    
    def size(self, A):
        return -1 * self.parent[self.root(A)-1]
    
    #AとBをくっ付ける
    def connect(self, A, B):
        A = self.root(A)
        B = self.root(B)
        if A == B:
            return False
        #大きい方(A)に小さい方(B)をくっつけたい
        #大小が逆であればひっくり返す
        if self.size(A) < self.size(B):
            A, B = B, A
        
        self.parent[A-1] += self.parent[B-1]
        self.parent[B-1] = A
        return True

ans = [0] * M
ans[M-1] = N * (N-1) //2
uni = UnionFind(N)
for i in range(M-1, 0, -1):
    if uni.root(ab[i][0]) != uni.root(ab[i][1]):
        ans[i-1] = ans[i] - uni.size(ab[i][0]) * uni.size(ab[i][1])
        uni.connect(ab[i][0], ab[i][1])
    else:
        ans[i-1] = ans[i]


for i in ans:
    print (i)
N, K = map(int, input().split())
P = 10**9+7
X = [0] + [1] * N
for i in range(1, K+1):
    NX = [0] * (N+1)
    for j in range(1, N+1):
        NX[j] = (NX[j-1] + X[N//j]) % P
    X = NX
print(X[-1])


### FIXED CODE ###

N, K = map(int, input().split())
P = 10**9+7
R = int(N**0.5)+1
A = [i for i in range(R)] + [N//i for i in range(1, R)][::-1]
M = len(A)
X = [0] + [1] * (M-1)
for i in range(1, K+1):
    NX = [0] * M
    for j in range(1, M):
        NX[j] = (NX[j-1] + X[M-j]*(A[j]-A[j-1])) % P
    X = NX
print(X[-1])
# Fast IO (be careful about bytestring)

# import os,io
# input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline


H,W,M = map(int,input().split())
targetList = []
rowCount = [0] * H
columnCount = [0] * W
for _ in range(M):
    p,q = map(int,input().split())
    targetList.append((p-1,q-1))
    rowCount[p-1] += 1
    columnCount[q-1] += 1
rowCountLabelled = []
columnCountLabelled = []
for i in range(H):
    rowCountLabelled.append((rowCount[i],i))
for i in range(W):
    columnCountLabelled.append((columnCount[i],i))
rowCountLabelled.sort(reverse = True)
columnCountLabelled.sort(reverse = True)
targetList.sort()
maxi = rowCountLabelled[0][0] + columnCountLabelled[0][0]
isMaxAchievable = False
for elem1 in rowCountLabelled:
    if elem1[0] != rowCountLabelled[0][0]:
        break
    for elem2 in columnCountLabelled:
        if elem2[0] != columnCountLabelled[0][0]:
            break
        target = (elem1[1],elem2[1])
        l = 0
        r = len(targetList)
        while l < r:
            m = (l + r) // 2
            if target == targetList[m]:
                l = m
                r = m
                break
            elif target < targetList[m]:
                r = m-1
            elif target > targetList[m]:
                l = m + 1
        if target != targetList[l] and target != targetList[r]:
            isMaxAchievable = True
            break
    if isMaxAchievable:
        break
if isMaxAchievable:
    print(maxi)
else:
    print(maxi - 1)


### FIXED CODE ###

# Fast IO (be careful about bytestring)

# import os,io
# input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline


H,W,M = map(int,input().split())
targetList = []
rowCount = [0] * H
columnCount = [0] * W
for _ in range(M):
    p,q = map(int,input().split())
    targetList.append((p-1,q-1))
    rowCount[p-1] += 1
    columnCount[q-1] += 1
rowCountLabelled = []
columnCountLabelled = []
for i in range(H):
    rowCountLabelled.append((rowCount[i],i))
for i in range(W):
    columnCountLabelled.append((columnCount[i],i))
rowCountLabelled.sort(reverse = True)
columnCountLabelled.sort(reverse = True)
targetList.sort()
maxi = rowCountLabelled[0][0] + columnCountLabelled[0][0]
isMaxAchievable = False
for elem1 in rowCountLabelled:
    if elem1[0] != rowCountLabelled[0][0]:
        break
    for elem2 in columnCountLabelled:
        if elem2[0] != columnCountLabelled[0][0]:
            break
        target = (elem1[1],elem2[1])
        l = 0
        r = len(targetList) - 1
        while l < r:
            m = (l + r) // 2
            if target == targetList[m]:
                l = m
                r = m
                break
            elif target < targetList[m]:
                r = m-1
            elif target > targetList[m]:
                l = m + 1
        if (l >= len(targetList) or target != targetList[l]) and target != targetList[r]:
            isMaxAchievable = True
            break
    if isMaxAchievable:
        break
if isMaxAchievable:
    print(maxi)
else:
    print(maxi - 1)
import sys
sys.setrecursionlimit(10**6)

H = 0
W = 0
table = None


def search(h, w, cnt):
    global H, W, table

    if(type(table[h][w]) is int and table[h][w] < cnt):
        return

    move = [(-1, 0), (1, 0), (0, -1), (0, 1)]

    for k in range(len(move)):
        i, j = move[k]
        if h+i < 0 or w+j < 0 or h+i >= H or w+j >= W:
            continue
        if table[h+i][w+j] == '.':
            table[h+i][w+j] = cnt
            search(h+i, w+j, cnt)
        elif table[h+i][w+j] != '#' and table[h+i][w+j] > cnt:
            table[h+i][w+j] = cnt
            search(h+i, w+j, cnt)

    for i in range(-2, 3):
        for j in range(-2, 3):
            if h+i < 0 or w+j < 0 or h+i >= H or w+j >= W or(i == 0 and j == 0):
                continue
            if table[h+i][w+j] == '.':
                table[h+i][w+j] = cnt+1
                search(h+i, w+j, cnt+1)
            elif table[h+i][w+j] != '#' and table[h+i][w+j] > cnt+1:
                table[h+i][w+j] = cnt+1
                search(h+i, w+j, cnt+1)


def main(input, print):
    global H, W, table
    H, W = map(int, input().split())
    Ch, Cw = map(int, input().split())
    Dh, Dw = map(int, input().split())
    table = [[] for _ in range(W)]
    for i in range(H):
        table[i] = list(input().strip())
    search(Ch-1, Cw-1, 0)
    if(table[Dh-1][Dw-1] == '.'):
        print(-1)
    else:
        print(table[Dh-1][Dw-1])


if __name__ == '__main__':
    main(sys.stdin.readline, print)


### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(10**6)


def main(input, print):
    move = [(-1, 0), (1, 0), (0, -1), (0, 1)]
    move2 = [(-2, -2), (-2, -1), (-2, 0), (-2, 1), (-2, 2),
             (-1, -2), (-1, -1), (-1, 1), (-1, 2),
             (0, -2), (0, 2),
             (1, -2), (1, -1), (1, 1), (1, 2),
             (2, -2), (2, -1), (2, 0), (2, 1), (2, 2)]

    H, W = map(int, input().split())
    Ch, Cw = map(int, input().split())
    Dh, Dw = map(int, input().split())
    table = [input() for _ in range(H)]
    path = [[-1 for _ in range(W)] for _ in range(H)]

    que = deque()
    path[Ch-1][Cw-1] = 0
    que.append((Ch-1, Cw-1))
    while que:
        y, x = que.popleft()
        cnt = path[y][x]

        for k in range(len(move)):
            i, j = move[k]
            nx = x+i
            ny = y+j
            if ny < 0 or nx < 0 or ny >= H or nx >= W:
                continue
            if table[ny][nx] == '#':
                continue
            if path[ny][nx] == -1 or path[ny][nx] > cnt:
                path[ny][nx] = cnt
                que.appendleft((ny, nx))

        for k in range(len(move2)):
            i, j = move2[k]
            nx = x+i
            ny = y+j
            if ny < 0 or nx < 0 or ny >= H or nx >= W:
                continue
            if table[ny][nx] == '#':
                continue
            if path[ny][nx] == -1 or path[ny][nx] > cnt+1:
                path[ny][nx] = cnt+1
                que.append((ny, nx))
    if(path[Dh-1][Dw-1] == -1):
        print(-1)
    else:
        print(path[Dh-1][Dw-1])


if __name__ == '__main__':
    main(sys.stdin.readline, print)
num = int(input())
char=[] #appendのために宣言が必要
while True:
    try:
        char.append(list(input()))

    except:
        break
new_char=[]
cnt=0
for i in range(num):
	new_char.append(sorted(char[i]))
for x in range(num):
    for y in range(num):
        if new_char[x]==new_char[y] and x!=y:
            cnt = cnt+1
print(cnt//2)
    

    

### FIXED CODE ###

x,y = map(int,input().split())

ans = [x*y,x+y,x-y]

print(max(ans))
import math

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
  
a_list = factorization(a)
b_list = factorization(b)

a_b_and = set(a_list) & set(b_list)
print(len(a_b_and) + 1)


### FIXED CODE ###

from fractions import gcd

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    return arr
  
d = gcd(a,b)
print(len(factorization(d)) + 1)