Harryxun/stf_run huggingface dataset:
import sys
n = int(input().strip())
items = set()
for _ in range(n):
  items |= {sys.readline().strip()}

### FIXED CODE ###

import sys
n = int(input().strip())
items = set()
for _ in range(n):
  items |= {sys.stdin.readline().strip()}
print(len(items))
n = int(input())
li = list(map(int, input().split()))
temp = li.copy()
for i in range(n-1):
    if li[i] < 0:
        li[i] *= -1
        li[i+1] *= -1
ans = sum(li)
li = temp
for i in reversed(range(1,n)):
    if li[i] < 0:
        li[i] *= -1
        li[i+1] *= -1
ans = max(ans, sum(li))

### FIXED CODE ###

n = int(input())
li = list(map(int, input().split()))
mainus_li = [i for i in li if i<0]
li = [abs(i) for i in li]
ans = sum(li)
if len(mainus_li) %2 == 1:
    ans -= 2*min(li)
print(ans)
n=int(input())
p=list(map(int,input().split()))
count==0
for i in range(n-2):
  if p[i] < p[i+1] < p[i+2] or p[i+2] < p[i+1] < p[i]:
    count += 1
print(count)

### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))
count=0
for i in range(n-2):
  if p[i] < p[i+1] < p[i+2] or p[i+2] < p[i+1] < p[i]:
    count += 1
print(count)
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
count = 0
for i in range(0, n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            a = list[i]
            b = list[j]
            c = list[k]
            if a == b or b == c or c == b:
                continue
            if a + b > c:
                count += 1
            else:
                break
print(count)


### FIXED CODE ###

n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
count = 0
for i in range(0, n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            a = l_list[i]
            b = l_list[j]
            c = l_list[k]
            if a == b or b == c or c == b:
                continue
            if a + b > c:
                count += 1
            else:
                break
print(count)
import sys, math
from collections import deque

readline = sys.stdin.readline

S = int(readline())

M = 10 ** 9
rS = math.ceil(math.sqrt(S))

while True:
    rem = rS ** 2 - S


    if rem <= M:
        b = rem
        break
    else:
        b = 0
        a = rem // M + 1
        c = math.floor(rem ** 0.5)
        while a < c:
            if rem % a == 0:
                b = a
                break
            a += 1
        if b != 0:
            break
    
    if rS == M:
        rS -= 1000
    else:
        rS += 1
print('0 0 {} {} {} {}'.format(rS, b, rem // b, rS))

### FIXED CODE ###

import sys, math
from collections import deque

readline = sys.stdin.readline

S = int(readline())

M = 10 ** 9
rS = math.ceil(math.sqrt(S))

while True:
    rem = rS ** 2 - S

    if rem == 0:
        print('0 0 {} {} {} {}'.format(rS, 0, 0, rS))
        exit(0)

    if rem <= M:
        b = rem
        break
    else:
        b = 0
        a = rem // M + 1
        c = math.floor(rem ** 0.5)
        while a < c and a < M:
            if rem % a == 0:
                b = a
                break
            a += 1
        if b != 0:
            break
    
    if rS >= M:
        rS = M - 1000
    else:
        rS += 1


print('0 0 {} {} {} {}'.format(rS, b, rem // b, rS))
a=input()
b=input()
print(a*b)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,2*a+2*b)
s = list(input())
while len(s)>0:
  
  if len(s) % 2 == 0:
    s.pop().pop()
  else:
    s.pop()
    
  n = len(s)//2
  
  if s[:n] == s[n:]:
    print(len(s))
    break

### FIXED CODE ###

s = list(input().rstrip())
while len(s)>0:
  
  s.pop()
    
  n = len(s)//2
  
  if s[:n] == s[n:] and len(s) % 2 == 0:
    print(len(s))
    break
n, q = map(int, input().split())
counter = [0]*n
edges = {}

def have(p, add_lst):
    if p not in edges.keys():
        return
    for i in edges[p]:
        add_lst += [i]
        have(i, add_lst)


for i in range(n-1):
    a, b = map(int, input().split())
    if a in edges.keys():
        edges[a] += [b]
    else:
        edges[a] = [b]

for i in range(q):
    p, x = map(int, input().split())
    add_lst = [p]
    have(p, add_lst)
    for j in add_lst:
        counter[j-1] += x

for i in range(n):
    print(counter[i], end=" ")


### FIXED CODE ###

from collections import deque
n, Q = map(int, input().split())
edges = [[] for _ in range(n+1)]
count = [0]*(n+1)
q = deque()
q.append((1, 0))

for _ in range(n-1):
    a, b = map(int, input().split())
    edges[a].append(b)
    edges[b].append(a)
for _ in range(Q):
    p, x = map(int, input().split())
    count[p] += x

while(q):
    k = q.popleft()
    count[k[0]] += count[k[1]]
    for i in edges[k[0]]:
        if not i == k[1]:
            q.append((i, k[0]))

print(*count[1:])
import numpy

e=input().split()
for i in range(len(e)):
  e[i]=int(e[i])
x=e[0]
k=e[1]
d=e[2]
t=k
if k>10000:
 if k%2==0:
   t=10000
 else:
   t=10001
kou=numpy.gcd(x,d)
x=int(x/kou)
d=int(d/kou)
if d>100 and d%2==0:
  d=100
if d>100 and d%2==1:
  d=1001
for i in range(t):
  if abs(x+d)<abs(x-d):
    x+=d
  else:
    x-=d
print(abs(x)*kou)


### FIXED CODE ###

w=input()
count=0

if w=="SSS":
 print(0)
if w=="SSR":
 print(1)
if w=="SRR":
 print(2)
if w=="RRS":
 print(2)
if w=="RSR":
 print(1)
if w=="SRS":
 print(1)
if w=="RSS":
 print(1)
if w=="RRR":
 print(3)
N,D = map(int,input().split())
if N % (D*2+1) != 0:
  p = n // (d*2+1) + 1
else:
  p = n // (d*2+1)
  
print(p)

### FIXED CODE ###

N,D = map(int,input().split())
if N % (D*2+1) != 0:
  p = N // (D*2+1) + 1
else:
  p = N // (D*2+1)
  
print(p)
import math
#import decimal
#decimal.getcontext().prec = 12

#getcontext().prec=20
a,b,h,m=map(int,input().split())
#a=decimal.Decimal(a)
#b=decimal.Decimal(b)
#h=decimal.Decimal(h)
#m=decimal.Decimal(m)

#print(a,b,h,m)

#ang1=decimal.Decimal(360*(h/12)+30*m/60)
#ang2=decimal.Decimal(360*m/60)
#ang=decimal.Decimal(abs(ang1-ang2))
ang1=360*(h/12)+30*m/60
ang2=360*m/60
ang=abs(ang1-ang2)
#print(ang)
if ang>=180.0:
#    ang=ang-180.0
    ang=360.0-ang

#print(ang)
#ans = ((a)**2 + (b)**2 - decimal.Decimal(2.0)*(a)*(b)*decimal.Decimal(math.cos(math.radians(ang))))
ans = a**2 + b**2 - 2.0*a*b*math.cos(math.radians(ang))
ans = math.sqrt(ans)
#print(math.cos(math.radians(ang)))

print(ans)

### FIXED CODE ###

s=input()
#print(s)
a=int(s[-1])
#print(a)

if a==3:
    print("bon")
elif a==0 or a==1 or a==6 or a==8:
    print('pon')
else:
    print("hon")
# -*- coding: utf-8 -*-
"""
AtCoder A
"""

import math
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column

# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']




def main():
    N, A, B, C, D = list(map(int,input().split()))
    S= str(input())
    # print(S[2:5])-> [2]~[4]
    if C>D:
        if '##' in S[A:C]:
            print("No")
        elif "..." in S[B-2:C]:
            print("Yes")
        else:
            print("No")
    else:
        if '##' in S[A:D]:
            print("No")
        else:
            print("Yes")
    # elif C>D and  ("..." in S[B-2:])
    # print(S[B-2:])
    
if __name__ == "__main__":
    main()

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
AtCoder A
"""

import math
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column

# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']




def main():
    N, A, B, C, D = list(map(int,input().split()))
    S= str(input())
    # print(S[2:5])-> [2]~[4]
    if C>D:
        if '##' in S[A-1:C+1]:
            print("No")
        elif "..." in S[B-2:D+1]:
            print("Yes")
        else:
            print("No")
    else:
        if '##' in S[A-1:D]:
            print("No")
        else:
            print("Yes")
    # elif C>D and  ("..." in S[B-2:])
    # print(S[B-2:])
    
if __name__ == "__main__":
    main()
S=input()
x=0
for i in range(len(S)//2+1):
  if S[2*i]=='L':
   x= x+1
  else:
   x= x

for j in range(len(S)//2):  
  if S[2*j+1]=='R':
   x= x+1
  else:
   x= x
    
if x==0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

S=input()
x=0
if len(S)%2==1:
 for i in range(len(S)//2+1):
  if S[2*i]=='L':
   x= x+1
  else:
   x= x
else:
 for i in range(len(S)//2):
  if S[2*i]=='L':
    x= x+1
  else:
    x= x

for j in range(len(S)//2):  
  if S[2*j+1]=='R':
   x= x+1
  else:
   x= x
    
if x==0:
  print('Yes')
else:
  print('No')
n = int( input() )
p = map(int, input().split())
q = map(int, input().split())

import math
def order(l):
    l = 0
    for i in range(n-1):
        l += (p[i]-1) * math.factorial(n-1-i)
    return l

order(a)
order(b)
print(abs(a-b))




### FIXED CODE ###

from itertools import permutations
n=int(input())
v=list(permutations(range(1,n+1),n))
print(abs(v.index(tuple(map(int,input().split())))-v.index(tuple(map(int,input().split())))))
N=input()
A=map(int,input().split(' '))
summed=0
for i in range(0,N):
	for j in range(i+1,N):
		sumed+=A[i]*A[j]
MOD=10**9+7
print(sumed%MOD)


### FIXED CODE ###

D,T,S=map(int,input().split(' '))
if (D/S)<=T:
  print("Yes")
else:
  print("No")
a=input()
print 3.14*2*a

### FIXED CODE ###

a = int(input())
print (3.14*2*a)
d=input()
t=input()
s=input()

if d<=s*t:
  print("Yes")
else print("No") 

### FIXED CODE ###

d,t,s=map(int,input().split())

if t*s>=d:
  print("Yes")
else:
  print("No")
import math
a,b,x=map(int,input().split())
x=x/a
c=b/2
if x<=a*c:
    d=2*x/b
    print(round(math.degrees(math.atan(b/d)),10))
else:
    x=a*b-x
    d=2*x/a
    print(round(90-math.degrees(math.atan(a/d)),10))

### FIXED CODE ###

import math
a,b,x=map(int,input().split())
x=x/a
c=b/2
if x<=a*c:
    d=2*x/b
    print(round(math.degrees(math.atan(b/d)),10))
elif x==a*b:
    print(0)
else:
    x=a*b-x
    d=2*x/a
    print(round(90-math.degrees(math.atan(a/d)),10))
N = int(input())

if N % 2 = 0:
    print(N)
else:
    print(N + 1)

### FIXED CODE ###

N = int(input())

if N % 2 == 0:
    print(N // 2)
else:
    print(N // 2 + 1)
import numpy as np
N = int(input())

a = []
for i in range(N):
    a.append(int(input()))

all_max = max(a)
max_arg = np.argmax(a)

print(max(a[1:]))

for i in range(1,N-1):
    if i!=max_arg:
        print(all_max)
    else:
        a_max = max(a[:i])
        n_a_max = max(a[i+1:])
        if(a_max>=n_a_max):
            print(a_max)
        else:
            print(n_a_max)

print(max(a[:N-1]))
    

### FIXED CODE ###

import numpy as np

N = int(input())

a = []
for i in range(N):
    a.append(int(input()))

if(N==1):
    print(a[0])
else:
    a_max = 0
    n_a_max = 0
    all_max = max(a)
    max_arg = np.argmax(a)

    if(max_arg!=0):
        a_max = max(a[:max_arg])
    if(max_arg!=N-1):
        n_a_max = max(a[max_arg+1:])

    if(a_max>=n_a_max):
        next_max = a_max
    else:
        next_max = n_a_max

    for i in range(N):
        if a[i]==all_max:
            print(next_max)
        else:
            print(all_max)
N, K = map(int,input().split())

T = [[] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = 1
def bfs(i, bb, b, p):
    global ans
    ans = (ans*(K-bb-b))%(10**9+7)
    cnt = 0
    for j in T[i]:
        if j == p:
            continue
        bfs(j, b + cnt, 1, i)
        cnt += 1

bfs(0, 0, 0, -1)
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(500000)

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

T = [[] for i in range(N)]
for i in range(N-1):
    a, b = map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = 1
def dfs(i, bb, b, p):
    global ans
    ans = (ans*(K-bb-b))%(10**9+7)
    cnt = 0
    for j in T[i]:
        if j == p:
            continue
        dfs(j, b + cnt, 1, i)
        cnt += 1

dfs(0, 0, 0, -1)
print(ans)
n, m = map(int, input().split())
i = 0
j = 0

while True:
    if n // 2 - i * 2 - 1 <= 0:
        break
    print(i + 1, n // 2 - i)
    i += 1

while True:
    if i + j == m:
        break
    print(n // 2 + j + 1, n - j)
    j += 1

### FIXED CODE ###

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

a = 1
b = m + 1
while a < b:
  print(a, b)
  a += 1
  b -= 1

a = m + 2
b = 2 * m + 1
while a < b:
  print(a, b)
  a += 1
  b -= 1
# input
A, B = map(int, input().split())

# check
# kimeuchi = max([int(A / 0.08), int(B / 0.1)])
# if int(kimeuchi * 0.08) == A and int(kimeuchi * 0.1) == B:
#
#     print(kimeuchi)
# else:
#     print(-1)

ans = -1
for n in range(100 * 0.1, -1 , -1):
    if int(n * 0.08) == A and int(n * 0.1) == B:
        ans = n

print(ans)

### FIXED CODE ###

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

# check
ans = -1
for n in range(1000, -1, -1):
    if int(n * 0.08) == A and int(n * 0.1) == B:
        ans = n

print(ans)
def calendar():
    m, d = map(int, x.split())
    print(m)
    res = []
    for month in range(1, m + 1):
        for day in range(2, d + 1):
            for x in range(2, d + 1):
                if x * day == month:
                    temp = str(day) + str(x)
                    temp = int(temp)
                    if temp <= d:
                        res.append(temp)
    print(len(res))


calendar()

### FIXED CODE ###

def calendar():
    m, d = map(int, input().split())
    res = []
 
    for month in range(1, m + 1):
        for day in range(2, 10):
            for x in range(2, 10):
                if x * day == month:
                    temp = str(day) + str(x)
                    temp = int(temp)
                    if temp <= d:
                        res.append(temp)
    return len(res)
 
 
print(calendar())
from math import *
a, b, x = map(int, input().split())
if a*a*b >= 2*x:
  theta = degrees(pi/2 - atan(2*x/(a*pow(b,2))))
else:
  theta = degrees(pi/2 - atan(pow(a,3)/(2*(pow(a,2)*b - x))))    
print(theta)

### FIXED CODE ###

from math import *
a, b, x = map(int, input().split())
if a*a*b == x:
    theta = 0
elif a*a*b > 2*x:
    theta = degrees(pi/2 - atan(2*x/(a*pow(b,2))))
else:
    theta = degrees(pi/2 - atan(pow(a,3)/(2*(pow(a,2)*b - x))))
print(theta)
import sys


def parallelism(x1, y1, x2, y2, x3, y3, x4, y4):
    if x1 == x2 or x3 == x4:
        return x1 == x2 and x3 == x4
#    elif y1 == y2:
#        return y3 == y4
    else:
        return (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3)



#input_file = open(sys.argv[1], "r")

#lines = input_file.readlines()
lines = sys.stdin.readlines()
lines.pop(0)

for line in lines:
    x1, y1, x2, y2, x3, y3, x4, y4 = tuple(map(float, line.split(' ')))
    if parallelism(x1, y1, x2, y2, x3, y3, x4, y4):
        print "YES"
    else:
        print "NO"

### FIXED CODE ###


import sys


def parallelism(x1, y1, x2, y2, x3, y3, x4, y4):
    if x2 - x1 == 0.0 or x4 - x3 == 0.0:
        return x2 - x1 == 0.0 and x4 - x3 == 0.0
    else:
        return ((y2 - y1) / (x2 - x1)) == ((y4 - y3) / (x4 - x3))


#lines = sys.stdin.readlines()
#lines.pop(0)

for i in range(input()):
    x1, y1, x2, y2, x3, y3, x4, y4 = tuple(map(float, raw_input().split(' ')))
    if parallelism(x1, y1, x2, y2, x3, y3, x4, y4):
        print "YES"
    else:
        print "NO"
N, M = map(int, input().split())

S, C = [], []
for i in range(M):
  s, c = map(int, input().split())
  S += [s-1]
  C += [str(c)]
  
if N == 1:
  for i in range(10):
    flag = 1
    for m in range(M):
      if i_str[S[m]] != C[m]:
        flag = 0
        break
      if flag:
        print(i)
        break
    else:
      print(-1) 
else:
  for i in range(10**(N-1), 10**N):
    flag = 1
    i_str = str(i)
    for m in range(M):
      if i_str[S[m]] != C[m]:
        flag = 0
        break
    if flag:
      print(i)
      break
  else:
    print(-1)

### FIXED CODE ###

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

S, C = [], []
for i in range(M):
  s, c = map(int, input().split())
  S += [s-1]
  C += [str(c)]
  
if N == 1:
  for i in range(10):
    flag = 1
    for m in range(M):
      if str(i) != C[m]:
        flag = 0
        break
    if flag:
      print(i)
      break
  else:
    print(-1) 
else:
  for i in range(10**(N-1), 10**N):
    flag = 1
    i_str = str(i)
    for m in range(M):
      if i_str[S[m]] != C[m]:
        flag = 0
        break
    if flag:
      print(i)
      break
  else:
    print(-1)
import math
A, B, N = map(int, input().split())
ans = []
for x in range(1, N//(10**6)+1 ):
    cal = math.floor((A*x)/B) - (int(A) * math.floor(x/B))
    ans.append(cal)
print(max(ans))

### FIXED CODE ###

a, b, n = map(int, input().split())
n = min(n, b-1)
 
print(int((a * n) / b) - a * int(n / b))
import math
n,x=map(int,input().split())
h=[int(i) for i in input().split()]
tmp=abs(x-h[0])
for i in range(1,n-1):
    tmp=math.gcd(abs(x-h[i]),tmp)
print(tmp)

### FIXED CODE ###

from fractions import gcd
from functools import reduce
n,x=map(int,input().split())
h=[abs(x-int(a)) for a in input().split()]
print(reduce(gcd,h))
import sys
n, m = map(int, input().split())
num = [-1 for i in range(n)]
for i in range(m):
    s, c = map(int, input().split())
    s -= 1
    if num[s] != -1 and c != num[s]:
        print(-1)
        sys.exit()
    num[s] = c
if num[0] == 0 and n == 1:
    print(0)
elif num[0] == 0:
    print(-1)
elif n == 1 and s[0] == -1:
    print(0)
else:
    num[0] = max(num[0], 1)
    for i in range(1, n):
        num[i] = max(num[i], 0)
    print(''.join([str(i) for i in num]))

### FIXED CODE ###

import sys
n, m = map(int, input().split())
num = [-1 for i in range(n)]
for i in range(m):
    s, c = map(int, input().split())
    s -= 1
    if num[s] != -1 and c != num[s]:
        print(-1)
        sys.exit()
    num[s] = c
if num[0] == 0 and n == 1:
    print(0)
elif num[0] == 0:
    print(-1)
elif n == 1 and num[0] == -1:
    print(0)
else:
    num[0] = max(num[0], 1)
    for i in range(1, n):
        num[i] = max(num[i], 0)
    print(''.join([str(i) for i in num]))
import math
while True:
    n = int(input())
    score = [ int(i) for i in input().split(" ") ] 
    average = sum(score) / float(n)
    if n == 0:
        break
    a2 = 0
    for s in score:
        a2 += (s - average) ** 2
    print("{:.8f}".format(math.sqrt(a2) / n )

### FIXED CODE ###

import math
while True:
    n = int(input())
    if n == 0:
        break
    s = [int(i) for i in input().split(" ")]
    m = sum(s) / n
    print("{:.8f}".format(math.sqrt(sum([(x-m) ** 2 for x in s]) / n)))
n,m = map(int,input().split())
numList = list(map(int,input().split()))

y = 0
n = 0

for i in len(nunList):
  if numList > 1/(4*m):
    y +=1
  else:
    n +=1
    
if y > m:
  print("Yes")
else:
  print("No")
   
  

### FIXED CODE ###

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

sum = 0

for i in Ai:
	sum += i

S = sorted(Ai,reverse=True)

if S[m-1] >= sum/(4*m):
  print("Yes")
else:
  print("No")
n = int(input())
k = int(input())
sum_list = []
for i in range(1,n+1):
  j = n-i
  if j >= 1:
    sum_list.append((2*i)+(j+k))
sum_list.sort()
print(sum_list[0])


### FIXED CODE ###

n = int(input())
k = int(input())
sum = 1
for i in range(n):
  sum = min(sum*2,sum+k)    
print(sum)
n,k=map(int,input().split())
p=list(map(int,input().split()))
p=map(lambda x:(x+1)/2,p)
a=[]
for i in range(n+1-k):
  a+=[p[i:i+k]]
print(max(a))

### FIXED CODE ###

import itertools

n,k=map(int,input().split())
a=list(map(int,input().split()))
a=list(map(lambda x:(x+1)/2,a))

a=[0]+list(itertools.accumulate(a))
ans=0

for i in range(n-k+1):
  ans=max(ans,a[i+k]-a[i])
  
print(ans)
n,x,y=map(int, input().split())

ans=[0]*(n-1)

def func2(np, nd, state):
    #print(np, nd, state)
    nxp=[]
    for p in np:
        if p > 0 and not state[p-1]:
            nxp.append(p-1)
            ans[nd]+=1
        if p < n-1 and not state[p+1]:
            nxp.append(p+1)
            ans[nd]+=1
        if p == x-1 and not state[y-1]:
            nxp.append(y-1)
            ans[nd]+=1
        if p == y-1 and not state[x-1]:
            nxp.append(x-1)
            ans[nd]+=1
#    if nd == 1:
#        print(nd, nxp)

    nxp=list(set(nxp))
    for i in nxp:
        state[i]=True
    if len(nxp) == 0:
        return
    else:
        func2(nxp, nd+1, state)

for i in range(n):
    st=[False]*n
    st[i]=True
    func2([i], 0, st)

for i in ans:
    print(i//2)


### FIXED CODE ###

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

ans=[0]*(n-1)

for i in range(1, n+1):
    for j in range(i+1, n+1):
        d=min(j-i, abs(x-i)+1+abs(j-y), abs(y-i)+1+abs(j-x))
        #print(i,j,d)
        ans[d-1]+=1

for a in ans:
    print(a)
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
c = defaultdict(int)
for x in a:
  c[x] += 1

top, sec = 0,0
for k,v in c:
  if n < 2:
    continue
  if k > top:
    sec = top
    top = k
  elif k > sec:
    sec = k

print(top * sec)


### FIXED CODE ###

from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
c = defaultdict(int)
for x in a:
  c[x] += 1

sq = False
top, sec = 0,0
for k,v in c.items():
    if v < 2:
        continue
    if k > top:
        sq = v >= 4
        sec = top
        top = k
    elif k > sec:
        sec = k

if sq:
    print(top * top)
else:
    print(top * sec)
n = int(input())
a = list(map(int, input().split()))
ans = 0

for i in range(n):
    if a[n] <= min(a[:n]):
        ans += 1

print(ans)

### FIXED CODE ###

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

for i in range(n):
    if a[i] <= minimum:
        ans += 1
        minimum = a[i]

print(ans)
n=int(input())
x=input()
pc=[0]*(2*10**5+1)
pc[1]=1
for i in range(1,2*10**5+1):
  pc[i]=pc[i>>1]+pc[i&1]
f=[0]*(2*10**5+1)
for i in range(1,2*10**5+1):
  f[i]=f[i%pc[i]]+1
xx=int(x,2)
j=2**(n-1)
cnt=x.count('1')
xm=xx%(cnt-1)
xp=xx%(cnt+1)
for i in range(n):
  if x[i]=='1':
    c=cnt-1
    nx=(xm-(j>>i)%c)%c
  else:
    c=cnt+1
    nx=(xp+(j>>i)%c)%c
  print(f[nx]+1)

### FIXED CODE ###

n=int(input())
x=input()
pc=[0]
m=2*10**5
for i in range(1,m+2):
  cnt=0
  j=i
  while i:
    cnt+=i%2
    i//=2
  pc+=[j%cnt]
f=[0]*(m+2)
for i in range(1,m+2):
  if pc[i]==0:f[i]=1
  else:f[i]=f[pc[i]]+1
cnt=x.count('1')
ix=int(x,2)
ixp=ix%(cnt+1)
ixm=ix%(cnt-1) if cnt-1 else 0
d=1<<(n-1)
for i in range(n):
  dp=pow(2,n-i-1,cnt+1)
  if cnt-1:dm=pow(2,n-i-1,cnt-1)
  if x[i]=='0':print(f[(ixp+dp)%(cnt+1)]+1)
  else:
    if cnt-1:print(f[(ixm-dm)%(cnt-1)]+1)
    else:print(0)
t = input()
if t[len(t)]=="?":
    g == "D"
for i in range(len(t-1)):
    if t[i+1] == "?":
        if i == 0 and t[i+2] =="D":
            f="P"
        elif i == 0:
            f="D"
        s[i+1] = t[i+1]
        if t[i]=="P" or s[i] =="P":
            f="D"
    s=s+f
print(s+g)
     

### FIXED CODE ###

T = input()
print(T.replace('?','D'))
N = int(input())

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

color = [0] * 8
free = 0

a = 400 
    
for i in range(0,N):
    if rate[i] < a:
        color[0] = 1
    elif a <= rate[i] < 2*a:
        color[1] = 1
    elif 2*a <= rate[i] < 3*a:
        color[2] = 1
    elif 3*a <= rate[i] < 4*a:
        color[3] = 1
    elif 4*a <= rate[i] < 5*a:
        color[4] = 1
    elif 5*a <= rate[i] < 6*a:
        color[5] = 1
    elif 6*a <= rate[i] < 7*a:
        color[6] = 1
    elif 7*a <= rate[i] < 8*a:
        color[7] = 1
    elif 8*a <= rate[i]:
        free += 1
        

min_color = 0
max_color = 0

print( max(color.count(1),1), color.count(1) + free)

### FIXED CODE ###

r,g,b = map(int, input().split())

if (g*10 + b) % 4 == 0:
    print("YES")
else:
    print("NO")
nm = input().split()
n = int(nm[0])
m = int(nm[1])

p = []
r = []

for i in range(m):
	pr = input().split()
	p.append(int(pr[0]))
	r.append(pr[1])

ac = 0
wa = 0

for i in range(1,p[-1]+1):
    for l in range(m):
#         print(p[l])
#         print(r[l])
        if i != p[l]: continue
        if r[l] == 'AC':
            ac += 1
            break
        else: wa += 1

            
print(ac)
print(wa)
            

### FIXED CODE ###

nm = input().split()
n = int(nm[0])
m = int(nm[1])

p = []
r = []

for i in range(m):
	pr = input().split()
	p.append(int(pr[0]))
	r.append(pr[1])

ac = 0
wa = 0
flg = [0 for i in range(n)]

if m != 0:
	for l in range(m):
		if r[l] == 'AC' and flg[p[l]-1] !=  'ac':
			ac += 1
			wa += flg[p[l]-1]
			flg[p[l]-1] = 'ac'
		elif  flg[p[l]-1] != 'ac' :
			flg[p[l]-1] += 1

print(ac)
print(wa)