Harryxun/stf_run huggingface dataset:
while True:
	try:
		a,b,c,d,e,f = map(float, input().split())
		x = (c*e - b*f)/(a*e - b*d)
		y = (a*f - c*d)/(a*e - b*d)
		print("{0:.3f} {0:.3f}".format(x,y)
	except:
		exit()

### FIXED CODE ###

while True:
	try:
		a,b,c,d,e,f = map(float, input().split())
		z = a*e - b*d
		if z != 0:
			y = (a*f - c*d) / z
			x = (c*e - b*f) / z
			print("{:.3f} {:.3f}".format(x+0,y+0))
	except:
		break
N = int(input())
L = [int(s) for s in input().split(' ')]

while len(L) > 1:
	L.sort()
    if L[-1] % L[0] == 0:
      L.pop()
    else:
      L[-1] = L[-1] % L[0]
print(L[0])

### FIXED CODE ###

N = int(input())
L = [int(s) for s in input().split(' ')]

while len(L) > 1:
  L.sort()
  L_new = [L[0]]
  for l in L[1:]:
    v = l % L_new[0]
    if v != 0:
      L_new.append(v)
  L = L_new
print(L[0])
S,W=map(int,input().split())
if S　<=　W:
    print("unsafe")
else:
    print("safe")

### FIXED CODE ###

S,W=map(int,input().split())
if S <= W:
    print("unsafe")
else:
    print("safe")
#-*- coding: utf-8 -*-
"""
oj dl https://atcoder.jp/contests/abc116/tasks/abc116_d -d test-d
oj test -d test-d -c "python abc116d.py"
oj test -d test-d -c "python abc116d.py" test-d/sample-3.in
"""

from collections import defaultdict
import sys
import time
import logging



def deco(func):
    def wrapper(*args, **kwargs):
        s = time.time()
        #print('--start--')
        ret = func(*args, **kwargs)
        logging.debug('--end in %f --' % (time.time() - s))
        return ret

    return wrapper


def sol_wrong(n):
    if n <= 0: return 0
    dp = [0] * (n+1)

    dp[1] = 0
    if n == 1:
        return dp[n]
    if n == 2:
        return 1
    if n == 3:
        return 3
    # dp[2] = 1
    # dp[2] = 3
    # dp[4] = 5

    for i in range(3, n+1):
        dp[i] = dp[i-2] + i

    return dp[n]


def sol_lte():
    if n <= 0: return 0
    dp = [0] * (n+1)
    dp[1] = 0
    if n == 1:
        dp[1] = 0
        return dp[1]
    if n == 2:
        dp[2] = 1
        return dp[2]
    dp[2] = 1
    for i in range(3, n+1):
        dp[i] = dp[i-1] + i - 1
    return dp[i]


def sol(n):
    if n <= 0: return 0
    dp = [0] * (n+1)
    dp[1] = 0
    if n == 1:
        return 0
    if n == 2:
        return 1
    dp[2] = 1
    for i in range(3, n+1):
        x = i - 1
        if x % 2 == 0: # even
            dp[i] = ((x + 1) * int(n/2))
        else: # odd
            dp[i] = ((x + 1) * int(n/2)) + int((n+1)/2)
    return dp[i]



do_submit = True
#do_submit = False
if do_submit:
    logging.basicConfig(level=logging.ERROR, format="%(message)s")
else:
    logging.basicConfig(level=logging.DEBUG, format="%(message)s")

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [[x.strip() for x in line.split()] for line in lines]
    n, k = parsed_lines[0]
    n = int(n)
    k = int(k)
    S = parsed_lines[1][0]
    return (n, k, S)


if not do_submit:
    n, k, S = input_parse("""
    14 2
    11101010110011
    """)
    print(sol(n, k, S))

    n, k, S = input_parse("""
    5 1
    00010
    """)
    print(sol(n, k, S))

    n, k, S = input_parse("""
    1 1
    1
    """)
    print(sol(n, k, S))


else:
    # str = ""
    # str += input().strip() + "\n"# n, k
    # str += input().strip() # S
    # n, k, S = input_parse(str)
    n = int(input().strip())
    print (sol(n))




### FIXED CODE ###

#-*- coding: utf-8 -*-
def sol(n):
    if n <= 0: return 0
    if n == 1:
        return 0
    if n == 2:
        return 1
    x = n - 1
    if x % 2 == 0: # even
        return ((x + 1) * int(x/2))
    else: # odd
        return ((x + 1) * int(x/2)) + int((x+1)/2)



n = int(input().strip())
print (sol(n))
N=int(input())
s=list(map(int, input().split()))
a=1
for i in range(N):
  if if a>1000000000000000000:
    break
  a*=s[i]
print(-1 if a>1000000000000000000 else a)

### FIXED CODE ###

N=int(input())
s=sorted(list(map(int, input().split()))[::-1])
a=1
for i in range(N):
  if a>10**18:
    break
  a*=s[i]
print(-1 if a>10**18 else a)
import numpy as np

num_q = int(input())
x = 0
f = 0
a = []
c = False
b = 0

for b in range(num_q):
  q = input()
  if q[0] == '2':
    print(x, f)
  else:
    _, n, m = map(int, q.split(" "))
    a.append(n)
    a.sort()
    x_tmp = a[b//2]
    if c:
      f += m + np.abs(x - n)
    else:
      f += m + np.abs(x_tmp - n)
    c = ~c
    x = x_tmp
    b += 1


### FIXED CODE ###

from heapq import heappush, heappop

num_q = int(input())
x = 0
f = 0
low = []
high = []
odd = False
num_a = 0
 
for _ in range(num_q):
  q = input()
  if q[0] == '2':
    print(x, f)
  else:
    _, n, m = map(int, q.split(" "))
    if odd:
      if n >= -low[0]:
        f += m + n + low[0]
        heappush(high, n)
      else:
        f += m - n - low[0]
        heappush(low, -n)
        heappush(high, -heappop(low))
    else:
      f += m
      if num_a == 0:
        heappush(low, -n)
      else:
        if n > -low[0]:
          if n > high[0]:
            f += n - high[0]
          heappush(high, n)
          heappush(low, -heappop(high))
        else:
          f += - n - low[0]
          heappush(low, -n)

    odd = ~odd
    x = -low[0]
    num_a += 1
[n, k] = [int(x) for x in input().split()]

prob = 0

for i in range(n):
    
    num = math.ceil(math.log2(k/(i+ 1)))
    
    if num < 1:
        num = 1
    prob = prob + 1 / n * ((1 / 2) ** num)
    
print(prob)


### FIXED CODE ###

import math

[n, k] = [int(x) for x in input().split()]

prob = 0

for i in range(n):
    
    num = math.ceil(math.log2(k/(i+ 1)))
    
    if num < 0:
        num = 0
    prob += 1 / n * ((1 / 2) ** num)
    
print(prob)
import re
N,M=map(int, input().split())

A=[]
B=[]

for n in range(N):
    A.append(input())

for m in range(M):
    B.append(input())
        
# check
for n in range(N):
      # Bのm行目と一致
      # Bのm+1行目と一致するかチェック
      span =[m.span() for m in re.finditer(B[0], A[n])]
      #print(span)
      if span==[]:
          continue
      allgood=False
      for i in range(min(M,N)):
          #print(n)
          #print((B[i],A[n+i][span[0][0]:span[0][1]]))
          if (B[i]==A[n+i][span[0][0]:span[0][1]]):
              allgood=True
              continue
          else:
              allgood=False
              break
      if allgood==True:
          print("Yes")
          exit()

print("No")

### FIXED CODE ###

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

A=[]
B=[]

for n in range(N):
    A.append(input())

for m in range(M):
    B.append(input())
        
if N<M:
    print("No")
    exit()
# check
for n in range(N):
      # Bのm行目と一致
      # Bのm+1行目と一致するかチェック
      span =[m.span() for m in re.finditer(B[0], A[n])]
      #print(span)
      if span==[]:
          continue
      allgood=False
      for sp in span:
        for i in range(min(M,N)):
            if n+i>=N:
                allgood=False
                break
            #print(n)
            #print((B[i],A[n+i][span[0][0]:span[0][1]]))
            if (B[i]==A[n+i][sp[0]:sp[1]]):
                allgood=True
                continue
            else:
                allgood=False
                break
        if allgood==True:
            print("Yes")
            exit()

print("No")
# coding: utf-8
# Your code here!

import math
a, b, c, d = map(int,input().split())
a = a-1
dc = b//c
dc -= a//c

dd = b//d
dd -= a//d

lcm = c*d//math.gcd(c,d)
dcd = b//lcm
dcd -= a//lcm

ans = b-a-dc-dd+dcd

print(ans)



### FIXED CODE ###

# coding: utf-8
# Your code here!

from fractions import gcd

a, b, c, d = map(int,input().split())
a = a-1
dc = b//c
dc -= a//c

dd = b//d
dd -= a//d

lcm = c*d//gcd(c,d)
dcd = b//lcm
dcd -= a//lcm

ans = b-a-dc-dd+dcd

print(ans)
N=input()

if N<2:
	print(0)
elif N==2:
	print(2)
else:
	without=10*(N-2)
	considered=without*(without-1)/2
	print(considered)

### FIXED CODE ###

MOD=10**9+7
N=int(input())
 
all=pow(10,N,MOD)
sub9=pow(9,N,MOD)
sub8=pow(8,N,MOD)
print((all-2*sub9+sub8)%MOD)
S = int(input())
h = S/60
m = S/120
s = S/240
print(h,m,s,sep=':=)

### FIXED CODE ###

S = int(input())
h = S // 3600
m = S % 3600 // 60
s = (S % 3600) - (m * 60)
print(h,m,s,sep=':')
i = input().split(" ")
n = int(i[0])
x = int(i[1])
l = input().split(" ")
height = 0
count = 0

while height <= x and count < n+1:
    height += int(l[count])
    count += 1

print(count)


### FIXED CODE ###

i = input().split(" ")
n = int(i[0])
x = int(i[1])
l = input().split(" ")
height = 0
count = n+1

for i in range(n):
    if (height + int(l[i]) <= x):
        height += int(l[i])
    else:
        count = i + 1
        break

print(count)
S1, S2 = input().strip().split()
print(S1*S2)

### FIXED CODE ###

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

print(a * b)
x, y = map(int, input().split())
d = abs(abs(y) - abs(x))
if x // abs(x) == y // abs(y):
    if x > y:
        d += 2
else:
    d += 1

print(d)


### FIXED CODE ###

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

d = abs(abs(y) - abs(x))

if (x > 0 and y <= 0) or (x >= 0 and y < 0) or (x < 0 and y > 0):
    d += 1
elif x > y:
    d += 2

print(d)
from collections import defaultdict
import sys
input = sys.stdin.readline

N = int(input())


tree = defaultdict(list)
nodes_len = defaultdict(list)
for i in range(N):
    nodes_len[i+1] = [0, 0]

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

queue_set = set()
while len(tree) > 1:
    del_nodes = []
    for from_node, to_nodes in tree.items():
        # dictのサイズが1なら
        if len(to_nodes) == 1:
            to_node = to_nodes[0]

            # queueに次のノードを入れる
            queue_set.add(to_node)

            # そのノードが持つ隣接ノード長を追加する
            nodes_len[to_node].append(nodes_len[from_node][0]+1)

            # 長さが2以上のみ保持する
            nodes_len[to_node].sort(reverse=True)
            nodes_len[to_node] = nodes_len[to_node][:2]

            # treeのto_nodeの部分から削除する
            tree[to_node].remove(from_node)

            del_nodes.append(from_node)

    for node in del_nodes:
        del tree[node]

n = list(tree.keys())[0]
print("Second" if (nodes_len[n][0] + nodes_len[n][1]+1) % 3 == 2 else "First")


### FIXED CODE ###

from collections import defaultdict
import sys
input = sys.stdin.readline


N = int(input())
# 例外処理
if (N == 1):
    print("First")
    quit()

tree = defaultdict(set)
tree_main = defaultdict(set)
for i in range(N-1):
    a, b = tuple(map(int, input().split()))
    tree[a].add(b)
    tree[b].add(a)
    tree_main[a].add(b)
    tree_main[b].add(a)

def longest_path(tree, from_node=1):
    cnt = 1

    nearest_nodes = list(tree[from_node])
    while len(nearest_nodes) > 0:
        for one_step_node in nearest_nodes:
            for two_step_node in tree[one_step_node]:
                if two_step_node != from_node:
                    tree[two_step_node].remove(one_step_node)
                    tree[two_step_node].add(from_node)
                    tree[from_node].add(two_step_node)
            tree[from_node].remove(one_step_node)
        cnt += 1
        nearest_nodes = list(tree[from_node])

    return one_step_node, cnt


far, _ = longest_path(tree)
_, n = longest_path(tree_main, far)
print("Second" if n % 3 == 2 else "First")
B=0
for b in range((a+1)**5-a**5,(a+1)**+a**5+1):
  if (a+1)**5-b**5 == X:
    B=b
    break

print(A+1, B)

### FIXED CODE ###

X=int(input())
I=J=0
for i in range(-300,300):
  for j in range(-300,300):
    if i**5-j**5==X:
      I=i
      J=j
      break
print(I,J)
n = int(input())
nums = list(map(int,input().split()))
ans = 0
while sum(nums)%2 == 0:
    for i in range(n):
        nums[i]=nums[i]/2
    ans +=1
print(ans)

### FIXED CODE ###

print(sum(list(map(int,str(input())))))
V, E = int(input()), int(input())
L = []
visited = [0 for i in range(V)]
edges = [[] for i in range(V)]
#flag = 0

def visit(x):
#  if visited[x] == 1:
#    flag = 1
  if not visited[x]:
    visited[x] = 1
    for e in edges[x]:
      visit(e)
    L.insert(0,x)

for i in range(E):
  s, t = map(int,input().split())
  edges[s - 1].append(t - 1)

for i in range(V):
  if not visited[i]:
    visit(i)

flag = 0
for i in range(V):
  print(L[i] + 1)
  if not flag and i < V - 1 and (L[i + 1] not in edges[L[i]]):
    flag = 1
print(flag)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def main():
  V, E = int(input()), int(input())
  L = []
  app = L.append
  visited = [0 for i in range(V)]
  edges = [[] for i in range(V)]
  
  def visit(x):
    if not visited[x]:
      visited[x] = 1
      for e in edges[x]:
        visit(e)
      app(x)
  
  for i in range(E):
    s, t = map(int,input().split())
    edges[s - 1].append(t - 1)
  
  for i in range(V):
    if not visited[i]:
      visit(i)
  L.reverse()
  
  flag = 0
  temp = L[0]
  print(temp + 1)
  for i in range(V - 1):
    v = L[i + 1]
    print(v + 1)
    if not flag and i < V - 1 and (v not in edges[temp]):
      flag = 1
    temp = v
  print(flag)
main()
import sys
input = sys.stdin.readline
import math

mod = 10**9+7

N = int(input())
As = {}
for _ in range(N):
    x, y = map(int, input().split())
    g = math.gcd(x, y)
    x, y = x//g, y//g
    if x != 0 or y != 0:
        if y < 0 or (y==0 and x < 0):
            y = -y
            x = -x
        if (x, y) in As:
            As[(x, y)] += 1
        else:
            As[(x, y)] = 1

ans = 1
for (x, y), num in As.items():
    if (-y, x) in As:
        if x > 0:
            ans = (ans * (pow(2, num, mod) + pow(2, As[(-y, x)], mod) - 1)) % mod
    elif not (y, -x) in As:
        ans = (ans * pow(2, num, mod)) % mod

print((ans-1)%mod)

### FIXED CODE ###

import sys
input = sys.stdin.readline
import math

mod = 10**9+7

N = int(input())
As = {}
Empty = 0
for _ in range(N):
    x, y = map(int, input().split())
    g = math.gcd(x, y)
    if g == 0:
        Empty += 1
        continue
    x, y = x//g, y//g
    if y < 0 or (y==0 and x < 0):
        y = -y
        x = -x
    if (x, y) in As:
        As[(x, y)] += 1
    else:
        As[(x, y)] = 1

ans = 1
for (x, y), num in As.items():
    if (-y, x) in As:
        ans = (ans * (pow(2, num, mod) + pow(2, As[(-y, x)], mod) - 1)) % mod
    elif not (y, -x) in As:
        ans = (ans * pow(2, num, mod)) % mod

print((ans-1+Empty)%mod)
n,a,b,c,d=map(int, input().split())
S='.'+input()
dpa=[0]*(n+1)
dpb=[0]*(n+1)
seta=[c]
setb=[d]
if d<c:
    if S[b-1:d+2].find('...')>0:
        index = S[b-1:d+2].find('...')
        S[index+1]='#'
        while seta:
            i = seta.pop()
            if i>0 and S[i-1]=='.' and dpa[i-1]==0:
                dpa[i-1]=1
                seta.append(i-1)
            if i>1 and S[i-2]=='.' and dpa[i-2]==0:
                dpa[i-2]=1
                seta.append(i-2)
        S[index+1]='.'
        while setb:
            i = setb.pop()
            if i>0 and S[i-1]=='.' and dpb[i-1]==0:
                dpb[i-1]=1
                setb.append(i-1)
            if i>1 and S[i-2]=='.' and dpb[i-2]==0:
                dpb[i-2]=1
                setb.append(i-2)

else:
    while setb:
        i = setb.pop()
        if i>0 and S[i-1]=='.' and dpb[i-1]==0:
            dpb[i-1]=1
            setb.append(i-1)
        if i>1 and S[i-2]=='.' and dpb[i-2]==0:
            dpb[i-2]=1
            setb.append(i-2)
    while seta:
        i = seta.pop()
        if i>0 and S[i-1]=='.' and dpa[i-1]==0:
            dpa[i-1]=1
            seta.append(i-1)
        if i>1 and S[i-2]=='.' and dpa[i-2]==0:
            dpa[i-2]=1
            seta.append(i-2)
if dpa[a]==1 and dpb[b]==1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import copy
n,a,b,c,d=map(int, input().split())
S='.'+input()
dpa=[0]*(n+1)
dpb=[0]*(n+1)
seta=[c]
setb=[d]
if d<c:
    if S[b-1:d+2].find('...')>=0:
        while seta:
            i = seta.pop()
            if i>0 and S[i-1]=='.' and dpa[i-1]==0:
                dpa[i-1]=1
                seta.append(i-1)
            if i>1 and S[i-2]=='.' and dpa[i-2]==0:
                dpa[i-2]=1
                seta.append(i-2)
        while setb:
            i = setb.pop()
            if i>0 and S[i-1]=='.' and dpb[i-1]==0:
                dpb[i-1]=1
                setb.append(i-1)
            if i>1 and S[i-2]=='.' and dpb[i-2]==0:
                dpb[i-2]=1
                setb.append(i-2)
else:
    while setb:
        i = setb.pop()
        if i>0 and S[i-1]=='.' and dpb[i-1]==0:
            dpb[i-1]=1
            setb.append(i-1)
        if i>1 and S[i-2]=='.' and dpb[i-2]==0:
            dpb[i-2]=1
            setb.append(i-2)
    while seta:
        i = seta.pop()
        if i>0 and S[i-1]=='.' and dpa[i-1]==0:
            dpa[i-1]=1
            seta.append(i-1)
        if i>1 and S[i-2]=='.' and dpa[i-2]==0:
            dpa[i-2]=1
            seta.append(i-2)
if dpa[a]==1 and dpb[b]==1:
    print('Yes')
else:
    print('No')
import sympy
from collections import defaultdict, Counter
# def factors(N): #約数を全て求める。ただし、順不同
#     from collections import deque
#     ret = deque()
#     middle = int( N**(1/2))
#     for i in range(1, middle):
#         if N%i == 0:
#             ret.append(i)
#             ret.append(N//i)
            
#     if N%middle == 0:
#         ret.append(middle)
#         if middle != N//middle:
#             ret.append(N//middle)
#     return ret

def main():
    N = int( input())
    A = list( map( int, input().split()))
    CA = Counter(A)
    d = defaultdict( lambda : False)
    for a in A:
        d[a] = True
    ans = 0
    for a in A:
        if CA[a] > 1:
            continue
        for p in sympy.divisors(a):
            if p == a:
                continue
            if d[p]:
                break
        else:
            ans += 1
    print(ans)
if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import Counter, defaultdict
def main():
    N = int( input())
    A = list( map( int, input().split()))
    CA = Counter(A)
    d = defaultdict( lambda : False)
    T = [False]*(10**6+1)
    A.sort()
    Z = [False]*(10**6+1)
    ans = 0
    for a in A:
        if CA[a] == 1 and not T[a]:
            ans += 1
        if not Z[a]:
            Z[a] = True
            for i in range(1, 10**6+1):
                if i*a > 10**6:
                    break
                T[i*a] = True
    print(ans)
if __name__ == '__main__':
    main()
from collections import defaultdict
N,X,Y = map(int,input().split())

k = defaultdict(lambda: 0)

for i in range(N-1):
    for j in range(i+1,N):
        dist = min( j-i , abs(X-1-i)+1+abs(Y-1-j) , abs(Y-1-i)+1+abs(X-1-j) )
        k[dist] += 1

for i in range(1,N+1):
    print(k[i])


### FIXED CODE ###

S = input()

if S[2]==S[3] and S[4]==S[5]:
    print('Yes')
else:
    print('No')
def alf(st):
  if st == 1:
    return "a"
  if st == 2:
    return "b"
  if st == 3:
    return "c"
  if st == 4:
    return "d"
  if st == 5:
    return "e"
  if st == 6:
    return "f"
  if st == 7:
    return "g"
  if st == 8:
    return "h"
  if st == 9:
    return "i"
  if st == 10:
    return "j"
  if st == 11:
    return "k"
  if st == 12:
    return "l"
  if st == 13:
    return "m"
  if st == 14:
    return "n"
  if st == 15:
    return "o"
  if st == 16:
    return "p"
  if st == 17:
    return "q"
  if st == 18:
    return "r"
  if st == 19:
    return "s"
  if st == 20:
    return "t"
  if st == 21:
    return "u"
  if st == 22:
    return "v"
  if st == 23:
    return "w"
  if st == 24:
    return "x"
  if st == 25:
    return "y"
  if st == 26:
    return "z"
   
N,=list(map(int, input().split()))
li = []
NN = N
count=1
while True:
  li+=[NN%26]
  NN = NN//26
  if NN <26:
    if NN%26!=0:
      li.append(NN%26)
    break
  count+=1
  if count>1000000000000001:
    print("error")
    exit()
re=[alf(i) for i in li]
re.reverse()
print("".join(re))

### FIXED CODE ###

def alf(st):
  if st == 0:
    return "a"
  if st == 1:
    return "b"
  if st == 2:
    return "c"
  if st == 3:
    return "d"
  if st == 4:
    return "e"
  if st == 5:
    return "f"
  if st == 6:
    return "g"
  if st == 7:
    return "h"
  if st == 8:
    return "i"
  if st == 9:
    return "j"
  if st == 10:
    return "k"
  if st == 11:
    return "l"
  if st == 12:
    return "m"
  if st == 13:
    return "n"
  if st == 14:
    return "o"
  if st == 15:
    return "p"
  if st == 16:
    return "q"
  if st == 17:
    return "r"
  if st == 18:
    return "s"
  if st == 19:
    return "t"
  if st == 20:
    return "u"
  if st == 21:
    return "v"
  if st == 22:
    return "w"
  if st == 23:
    return "x"
  if st == 24:
    return "y"
  if st == 25:
    return "z"
   
def cc():
  N,=list(map(int, input().split()))
  li = [0 for i in range(100)]
  NN = N
  count=1
  for i in range(1,100):
    if NN > 26 ** i:
      NN = NN - 26 ** i
    else:
      l=i
      break; 
  NN-=1
  count=0
  while True:
    li[count]=NN%26
    count+=1
    NN //=26
    if NN <26:
      li[count]=NN%26
      break    
  re=[alf(i) for i in li[:l]]
  re.reverse()
  print("".join(re))

cc()
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)

l = [0] * (a[0])
f = 0
for i in a:
    l[i-1] += 1
    if l[i-1] == 2:
        f += 1
    if f == 1:
        x = i
        f += 1
    if f == 3:
        print(x*i)
        exit()
print(0)

### FIXED CODE ###

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

f = 0
x = 0
for i in range(len(a)-1):
    if a[i] == a[i+1] != x:
        f += 1
    if f == 1:
        x = a[i]
        f += 1
        if a.count(x) >= 4:
          f = 3
    if f >= 3:
        print(x*a[i])
        exit()
print(0)
l = list(input().split())
c = 0
for i in l:
 l[c] = int(l)
 c += 1

k = min(l[3],l[4])
money = min((l[0]+l[1])*k, l[2]*2*k)

if l[3]>l[4]:
 m = l[3]-l[4]
 money += min(l[0], l[2]*2)*m
else:
 m = l[4]-l[3]
 money += min(l[1], l[2]*2)*m

print(money)




 

### FIXED CODE ###

l = list(input().split())
c = 0
for i in l:
 l[c] = int(i)
 c+=1

k = min(l[3],l[4])
money = min((l[0]+l[1])*k, l[2]*2*k)

if l[3]>l[4]:
 m = l[3]-l[4]
 money += min(l[0], l[2]*2)*m
else:
 m = l[4]-l[3]
 money += min(l[1], l[2]*2)*m

print(money)
# coding: utf-8
# Your code here!
S=list(input())[::-1]

count=0
temp=[]
pre=[]
while len(S)>3:
    temp.append(S.pop(-1))
    if temp==pre:
        temp.append(S.pop(-1))
    pre.clear()
    pre+=temp
    temp.clear()
    count+=1

if len(S)==3:
    if pre[-1]==S[2] or S[2]==S[1] or S[1]==S[0]:
        print(count+2)
    else:
        print(count+3)
else:
    if pre[-1]==S[1] or S[1]==S[0]:
        print(S[10])
        print(count+1)
    else:
        print(count+2)


### FIXED CODE ###

# coding: utf-8
# Your code here!
S=list(input())[::-1]

count=0
temp=[]
pre=[]
while len(S)>3:
    temp.append(S.pop(-1))
    if temp==pre:
        temp.append(S.pop(-1))
    pre.clear()
    pre+=temp
    temp.clear()
    count+=1
#print(S[::-1])
if len(S)==3:
    if pre[-1]==S[2] or S[2]==S[1] or S[1]==S[0]:
        print(count+2)
    else:
        print(count+3)
else:
    if S[1]==S[0]:#aabbaが出来ればよい
        print(count+1)
    else:
        print(count+2)
#!/usr/bin/env python3

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

if m != 0:
    a = [int(input()) for _ in range(m)]

mod = 1000000007

if n == 1:
    print(1)
    exit()
elif n == 2:
    if m != 0 and a[0] == 1:
        print(1)
    else:
        print(2)
    exit()

if a[0] == 1:
    a_2, a_1 = 1, 0
    index = 1
else:
    a_2, a_1 = 1, 1
    index = 0

for i in range(2, n+1):
    if index < len(a):
        if i == a[index]:
            a_now = 0
            index += 1
            a_1, a_2 = a_now, a_1
            continue

    a_now = (a_1+a_2) % mod
    # print(a_now)
    a_1, a_2 = a_now, a_1
    # print(a_now)
print(a_now % mod)

# 0, 1, 2, 3, 4, 5, 6

# 1, 1, 2, 0, 2, 2, 4


### FIXED CODE ###

#!/usr/bin/env python3

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

if m != 0:
    a = [int(input()) for _ in range(m)]
else:
    a = [-1]

mod = 1000000007

if n == 1:
    print(1)
    exit()
elif n == 2:
    if a[0] == 1:
        print(1)
    else:
        print(2)
    exit()


if a[0] == 1:
    a_2, a_1 = 1, 0
    index = 1
else:
    a_2, a_1 = 1, 1
    index = 0

for i in range(2, n+1):
    if index < len(a):
        if i == a[index]:
            a_now = 0
            index += 1
            a_1, a_2 = a_now, a_1
            continue

    a_now = (a_1+a_2) % mod
    # print(a_now)
    a_1, a_2 = a_now, a_1
    # print(a_now)
print(a_now % mod)

# 0, 1, 2, 3, 4, 5, 6

# 1, 1, 2, 0, 2, 2, 4