Harryxun/stf_run huggingface dataset:
e = 10 ** 18
n = int(input())
arr = [int(i) for i in input().split()]
ans, flag = [1,1]
if 0 in arr:
  print('0')
else:
  for i in arr:
  	ans = ans * i
  	if ans > e:
    	print('-1')
    	flag = 0
    	break
if flag == 1:
  print(ans)

### FIXED CODE ###

def solve():
    e = 10 ** 18
    n = int(input())
    arr = [int(i) for i in input().split()]
    ans, flag = [1,1]
    if 0 in arr:
      	return 0
    for i in arr:
        ans = ans * i
        if ans > e:
            return -1
    return ans
print(solve())
k = 31
K = 1<<k
nu = lambda L: int("".join([bin(K+a)[-k:] for a in L[::-1]]), 2)
st = lambda n: bin(n)[2:] + "0"
li = lambda s: [int(a, 2) if len(a) else 0 for a in [s[-(i+1)*k-1:-i*k-1] for i in range(1001)]]

N = int(input())
A = [int(a) for a in input().split()]
C = [0] * 1001
for a in A:
    C[a] += 1
B = li(st(nu(C) ** 2))
for a in A:
    if a <= 500: B[2*a] -= 1
for i in range(1001):
    B[i] //= 2
for i in range(1, 1001):
    C[i] += C[i-1]
for i in range(N):
    B[i] += B[i-1]
ans = N*(N-1)*(N-2)//6
for i in range(1, 1001):
    ans -= (N-CC[i-1]) * B[i]
print(ans)


### FIXED CODE ###

N = int(input())
A = sorted([int(a) for a in input().split()])
X = [0] * 1001
for a in A:
    X[a] += 1
for i in range(1, 1001):
    X[i] += X[i-1]

ans = 0
for i in range(N):
    for j in range(i+1, N):
        ans += X[min(A[i]+A[j]-1, 1000)] - (j+1)
print(ans)
a,d = map(int,input().split())
if n == 100:
    print(101 * (100**d))
else:
    print(n * (100**d))


### FIXED CODE ###

d,n = map(int,input().split())
if n == 100:
    print(101 * (100**d))
else:
    print(n * (100**d))
import sys
from collections import Counter, deque, defaultdict
from itertools import accumulate, permutations, combinations, takewhile, compress, cycle

# from functools import reduce
# from math import ceil, floor, log10, log2, factorial

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7

# N = int(input())
# A = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]

def main():
    """"ここに今までのコード"""
    N, M = [int(x) for x in input().split()]
    S = [int(x) for x in input().split()]
    T = [int(x) for x in input().split()]

    if S[0] == S[1] and S[1] == 1 and T[0] == T[1] and T[1] == 1:
        hogehoge
        pass

    DP = [[0] * (M + 1) for _ in range(N + 1)]
    DP[0] = [1] * (M + 1)
    for n in range(1, N + 1):
        DP[n][0] = DP[n - 1][0]
        for m in range(1, M + 1):
            DP[n][m] = DP[n][m - 1] + DP[n - 1][m] - DP[n - 1][m - 1]
            DP[n][m] %= MOD
            if S[n - 1] == T[m - 1]:
                DP[n][m] += DP[n - 1][m - 1]
                DP[n][m] %= MOD
    print(DP[n][m])


if __name__ == '__main__':
    main()



### FIXED CODE ###

import sys
from collections import Counter, deque, defaultdict
from itertools import accumulate, permutations, combinations, takewhile, compress, cycle

# from functools import reduce
# from math import ceil, floor, log10, log2, factorial

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7

# N = int(input())
# A = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]

def main():
    """"ここに今までのコード"""
    N, M = [int(x) for x in input().split()]
    S = [int(x) for x in input().split()]
    T = [int(x) for x in input().split()]

    DP = [[0] * (M + 1) for _ in range(N + 1)]
    DP[0] = [1] * (M + 1)
    for n in range(1, N + 1):
        DP[n][0] = DP[n - 1][0]
        for m in range(1, M + 1):
            DP[n][m] = DP[n][m - 1] + DP[n - 1][m] - DP[n - 1][m - 1]
            DP[n][m] %= MOD
            if S[n - 1] == T[m - 1]:
                DP[n][m] += DP[n - 1][m - 1]
                DP[n][m] %= MOD
    print(DP[n][m])


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

a,b,c= map(int, input().split())
d= int(math.gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

### FIXED CODE ###

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

a,b,c= map(int, input().split())
d= int(gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])
from collections import deque


def bfs(S):  # 幅優先探索  # キュー
    dist = [-1] * (w * h)
    que, frag = deque(), set()
    for i, Si in enumerate(S):
        for j, Sij in enumerate(Si):
            if Sij == '#':
                dist[i + (w * j)] = 0
                que.append((i, j)), frag.add((i, j))
    
    while len(que) > 0:
        (x, y) = que.popleft()
        near = [(x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)]
        for i, j in near:  # 移動先の候補
            if (i, j) in frag:  # 処理済みか否か
                continue
            if 0 <= i < h and 0 <= j < w:
                dist[i + (w * j)] = dist[x + (w * y)] + 1
                que.append((i, j)), frag.add((i, j))
    return dist


h, w = map(int, input().split())
a = [input() for _ in range(h)]
print(max(bfs(a)))


### FIXED CODE ###

from collections import deque


def bfs(S):  # 幅優先探索  # キュー
    dist = [[-1] * w for _ in range(h)]  # 前処理
    que = deque()
    for i, Si in enumerate(S):
        for j, Sij in enumerate(Si):
            if Sij == '#':
                dist[i][j] = 0
                que.append((i, j))

    while len(que) > 0:
        (x, y) = que.popleft()
        near = [(x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)]
        for i, j in near:  # 移動先の候補
            if 0 <= i < h and 0 <= j < w and dist[i][j] < 0:
                dist[i][j] = dist[x][y] + 1
                que.append((i, j))
    return dist[x][y]


h, w = map(int, input().split())
a = [input() for _ in range(h)]
print(bfs(a))
import sys
sys.setrecursionlimit(200000)

def dfs(array, current, count):
  array[current - 1] = count
  for neighbour in graph[current]:
    if array[neighbour - 1] == -1:
      array = dfs(array, neighbour, count + 1)
  else:
    return array

T = [-1 for x in range(100000)]
A = [-1 for x in range(100000)]

graph = {}

N,u,v = map(int,input().split())

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

  try:
    graph[b].append(a)
  except KeyError:
    graph[b] = [a]

T = dfs(T, u, 0)
A = dfs(A, v, 0)

ans = -1
for i in range(N):
  if T[i] < A[i]:
    ans = max(ans, A[ImportError] - 1)
print(max(0,ans))


### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)

def dfs(array, current, count):
  array[current - 1] = count
  for neighbour in graph[current]:
    if array[neighbour - 1] == -1:
      array = dfs(array, neighbour, count + 1)
  else:
    return array

T = [-1 for x in range(100000)]
A = [-1 for x in range(100000)]

graph = {}

N,u,v = map(int,input().split())

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

  try:
    graph[b].append(a)
  except KeyError:
    graph[b] = [a]

T = dfs(T, u, 0)
A = dfs(A, v, 0)

ans = -1
for i in range(N):
  if T[i] < A[i]:
    ans = max(ans, A[i] - 1)
print(max(0,ans))
n = int(input())
a = list(map(int, input().split()))
b = [0] * n
l = []

for i in range(n, 0, -1):
    if a[i-1] == 1:
        if n//i < 2:
            b[i-1] = 1
        else:
            c = n//i
            asums = 0
            for j in range(1, c+1):
                asums += a[j*i-1]
            if asums%2 == 1:
                b[i-1] = 1
    else:
        if n//i < 2:
            b[i-1] = 0
        else:
            c = n//i
            asums = 0
            for j in range(1, c+1):
                asums += a[j*i-1]
            if asums%2 == 1:
                b[i-1] = 1

for k in range(0, n):
    if b[k] == 1:
        l.append(k+1)

print(len(l))
print(" ".join(map(str, l)))


### FIXED CODE ###

r = int(input())
print(3*r*r)
N,L = map(int,input().split())
import bisect
A = [i+L for i in range(N)]
ans = sum(A)-A[bisect.bisect_left(A,0)]
print(ans)

### FIXED CODE ###

N,L = map(int,input().split())
import bisect
A = [i+L for i in range(N)]
ans = sum(A)-A[min(bisect.bisect_left(A,0),len(A)-1)]
print(ans)
n, k = map(int, input().split())
p = list(map(int, input().split()))
c = list(map(int, input().split()))

maxcost = -float('inf')
for pi in p:    # O(n^2)
    curr, costs = pi, [0]
    while pi != p[curr-1]:
        costs.append(costs[-1]+c[curr-1])
        curr = p[curr-1]
    costs.append(costs[-1]+c[curr-1])
    l = len(costs)-1
    if costs[-1] > 0 and k > l:
        maxcost = max(maxcost, costs[-1]*(k//l)+max(costs[1:k % l+1]) or 0)
    else:
        maxcost = max(maxcost, max(costs[1:min(k, l)+1]))

print(maxcost)


### FIXED CODE ###

import numpy as np
 
n, k = map(int, input().split())
p = list(map(int, input().split()))
c = list(map(int, input().split()))
 
cycles, check = [], [False]*n
for pi in p:
    if not check[pi-1]:
        curr, cycle = pi, []
        check[pi-1] = True
        while pi != p[curr-1]:
            check[curr-1] = True
            cycle.append(c[curr-1])
            curr = p[curr-1]
        check[curr-1] = True
        cycles.append(cycle + [c[curr-1]])
 
scores = []
for cycle in (np.array(cycle) for cycle in cycles):
    for i in range(cycle.size):
        cum = np.roll(cycle, i).cumsum()
        if cum[-1] > 0 and k > cycle.size:
            scores.append(cum[-1]*(k//cycle.size-1) + np.concatenate([cum, cum[:k % cycle.size]+cum[-1]]).max())
        else:
            scores.append(cum[:min(k, cum.size)].max())
print(max(scores))
if len(S) == 6 and S[2]==S[3] and S[4]==S[5]: print('Yes')
else: print('No')

### FIXED CODE ###

S = input()

if len(S) == 6 and S[2]==S[3] and S[4]==S[5]: print('Yes')
else: print('No')
import sys


for line in sys.stdin:
    xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2 = map(float, line.split(' '))
    if ((xb1<=xa1 and xa1<=xb2) or (xa1<=xb1 and xb1<=xa2)) and ((yb1<=ya2 and ya2<=yb2) or (ya1<=yb2 and yb2<=ya2)):
        print 'YES'
    else:
        print 'NO'

### FIXED CODE ###


import sys


for line in sys.stdin:
    xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2 = map(float, line.strip().split(' '))
    if ((xb1<=xa1 and xa1<=xb2) or (xa1<=xb1 and xb1<=xa2)) and ((yb1<=ya2 and ya2<=yb2) or (ya1<=yb2 and yb2<=ya2)):
        print 'YES'
    else:
        print 'NO'
import numpy as np
def kyori(x1,y1,x2,y2):
    dis = ((x1-x2)**2+(y1-y2)**2)**0.5
    return dis
N = int(input())
xy = []
for n in range(N):
    xy.append(list(map(int, input().split())))
diss = np.zeros(N)
for i in range(N-1):
    for j in range(i+1,N):
        diss[i+j-1] = kyori(xy[i][0],xy[i][1],xy[j][0],xy[j][1])
print(np.average(np.sum(diss) - diss))

### FIXED CODE ###

# coding: utf-8
# Your code here!
import numpy as np
import itertools
def kyori(x1,y1,x2,y2):
    dis = ((x1-x2)**2+(y1-y2)**2)**0.5
    return dis
N = int(input())
xy = []
for n in range(N):
    xy.append(list(map(int, input().split())))
diss = np.zeros((N,N))
c = list(itertools.permutations(range(N), N))
s = 0
for n in range(len(c)):
    for d in range(N-1):
        if diss[c[n][d]][c[n][d+1]]==0:
            diss[c[n][d]][c[n][d+1]] = kyori(xy[c[n][d]][0],xy[c[n][d]][1],xy[c[n][d+1]][0],xy[c[n][d+1]][1])
            diss[c[n][d+1]][c[n][d]] = diss[c[n][d]][c[n][d+1]]
        s += diss[c[n][d]][c[n][d+1]]
print(s/len(c))
a,b=input().split
print a+b

### FIXED CODE ###

a,b=input().split()
print(b+a)
N,X,T=list(map(int,input().split()))

result=N//X*T

if N%X!=0:
    result+=T

print(result)N,X,T=list(map(int,input().split()))

result=N//X*T

if N%X!=0:
    result+=T

print(result)

### FIXED CODE ###

N,X,T=list(map(int,input().split()))

result=N//X*T

if N%X!=0:
    result+=T

print(result)
while 1:
    i = input().split()
    if i ==0:
        break
    else:
        a, b, c, d, e, f = map(float, i)
        x = (e*c - b*f)/(e*a - b*d)
        y = (c*d - f*a)/(d*b - e *a)

        print(x,y) 

### FIXED CODE ###

while(True):
        try:
            a,b,c,d,e,f=map(float,input().split(" "))
            z=a*e-b*d
            if(z!=0):
                x=(c*e-b*f)/z
                y=(a*f-c*d)/z
            print("{:.3f} {:.3f}".format(x+0,y+0))
        except:
            break
import sys

s = ""
for line in sys.stdin:
    s.append(line)
s.lower()
for str in list("abcdefghijklmnopqrstuvwxyz"):
    print(*[str,":",s.count(str)])


### FIXED CODE ###

import sys

s = ""
for line in sys.stdin:
    s+=line
s=s.lower()
for str in list("abcdefghijklmnopqrstuvwxyz"):
    print(*[str,":",s.count(str)])
while True:
  a = list(map(int, input().split()))
  if sum(a) == 0:
    break
  print(' '.join.(list(map(str, sorted(a)))))

### FIXED CODE ###

while True:
  a = list(map(int, input().split()))
  if sum(a) == 0:
    break
  print(' '.join(list(map(str, sorted(a)))))
# A,Double Helix
#AtCoder 星には四種類の塩基 A, C, G, T が存在し、A と T、C と G がそれぞれ対になります。
#文字 bが入力されます。これは A, C, G, T のいずれかです。塩基bと対になる塩基を表す文字を出力するプログラムを書いてください。

# bは文字 A, C, G, T のいずれかである。

b = input()

# 塩基bと対になる塩基を表す文字を出力せよ。
if b =="A":
    answer = "T"
elif b == "T":
    anawer = "A"
elif b == "C":
    answer = "G"
elif b == "G":
    answer = "C"

print(answer)

### FIXED CODE ###

# A,Double Helix
# AtCoder 星には四種類の塩基 A, C, G, T が存在し、A と T、C と G がそれぞれ対になります。
# 文字 bが入力されます。これは A, C, G, T のいずれかです。塩基bと対になる塩基を表す文字を出力するプログラムを書いてください。

# bは文字 A, C, G, T のいずれかである。

b = input()

# 塩基bと対になる塩基を表す文字を出力せよ。

if b == "A":
    print("T")
elif b == "T":
    print("A")
elif b == "C":
    print("G")
elif b == "G":
    print("C")
a,b = map(int,input())

if a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:
  print("Possible")
else:
  print("Impossible")

### FIXED CODE ###

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

if a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:
  print("Possible")
else:
  print("Impossible")
n,q=map(int,input().split())
S=input()
l=[list(map(int,input().split())) for i in range(q)]

s=[0]*(n+1)
for i in range(1,n+1):
    if S[i-1]=='A' and S[i]=='C':
        s[i]=s[i-1]+1
    else:
        s[i]=s[i-1]

#print(s)
for k,v in l:
    ans=s[v-1]-s[k-1]
    print(ans)

### FIXED CODE ###

#122-C
n,q=map(int,input().split())
s=input()
l=[list(map(int,input().split())) for i in range(q)]
m=[0]*(n+1)
for i in range(len(s)-1):
    
    if s[i]=='A' and s[i+1]=='C':
        m[i+1]=m[i]+1
    else:
        m[i+1]=m[i]

for i in l:
    print(m[i[1]-1]-m[i[0]-1])
N = int(input())
adj_list = { i: [] for i in range(N+1) }
for _ in range(N-1):
  u,v,w = map(int, input().split())
  adj_list[u].append([v,w])
  adj_list[v].append([u,w])

res = [None] * N
visited = [False] * (N+1)
def dfs(node, c, w):
  res[node-1] = c
  visited[node] = True

  for nei, nw, in adj_list[node]:
    if not visited[nei]:
      if (w+nw)%2 == 0:
        dfs(nei, 0, w+nw)
      else:
        dfs(nei, 1, w+nw)

dfs(1, 0, 0)
for r in res: print(r)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N = int(input())
adj_list = { i: [] for i in range(N+1) }
for _ in range(N-1):
  u,v,w = map(int, input().split())
  adj_list[u].append([v,w])
  adj_list[v].append([u,w])

res = [None] * N
visited = [False] * (N+1)
def dfs(node, c, w):
  res[node-1] = c
  visited[node] = True

  for nei, nw, in adj_list[node]:
    if not visited[nei]:
      if (w+nw)%2 == 0:
        dfs(nei, 0, w+nw)
      else:
        dfs(nei, 1, w+nw)

dfs(1, 0, 0)
for r in res: print(r)
import sys

n, m = map(int, input().split())
nums = []

for i in range(n):
    nums.append(i + 1)

for i in range(m):
    l, r = map(int, input().split())
    nums = list(filter(lambda x: l <= x <= r, nums))
    if len(nums) == 0:
        print(0)
	sys.exit()

print(len(nums))


### FIXED CODE ###

n, m = map(int, input().split())
lr = []

for i in range(m):
    lr.append(list(map(int, input().split())))

lmax = 0
mmin = 10**5

for i in range(m):
    lmax = max(lmax, lr[i][0])
    mmin = min(mmin, lr[i][1])

print(max(0, mmin - lmax + 1))
import math
H, W = map(int, input().split())

w1 = math.ceil(W/2)*math.ceil(H/2)
w2 = math.floor(W/2)*math.floor(H/2)

if: H == 1:
    print(1)
elif W==1:
    print(1)
elif W != 1:
    print(w1+w2)

### FIXED CODE ###

import math
H, W = map(int, input().split())

w1 = math.ceil(W/2)*math.ceil(H/2)
w2 = math.floor(W/2)*math.floor(H/2)

if H == 1:
    print(1)
elif W==1:
    print(1)
elif W != 1:
    print(w1+w2)
S = input()

if S == 'Sunny':
     print('Cloudy')
elif S == 'Cloudy':
     print('Rainy')
else S == ('Rainy')
     print('Sunny')

### FIXED CODE ###

S = input()
 
if S == 'Sunny':
     print('Cloudy')
elif S == 'Cloudy':
     print('Rainy')
else :
     print('Sunny')
N, M = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse = True)

n = 0
if N > 1:
    while not M == 0:

        while A[0] >= A[1]:
            A[n] //= 2
            M -= 1
            if M == 0:
                break
        i = 0
        while A[i] < A[i+1]:
            A[i], A[i+1] = A[i+1], A[i]
            i += 1
            if i == N:
                break 

        if M == 0:
            break

else:
    A[0] //= (2**M)


result = sum(A)
print(result)


### FIXED CODE ###

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

for i in range(len(A)):
    A[i] *= -1

import heapq

heapq.heapify(A)


for _ in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, ((a*(-1))//2)*(-1))


result = -sum(A)
print(result)
#

import sys
input=sys.stdin.readline

def main():
    N=int(input())
    X=input().strip("\n")[::-1]
    cnt=[0]*N
    for i in range(1,N):
        n=i
        while(n>0):
            pc=0
            for j in range(22):
                if (n>>j)&1==1:
                    pc+=1
            n%=pc
            cnt[i]+=1
    pc=X.count("1")
    t=0
    for i in range(N):
        if X[i]=="1":
            t+=2**i
    X=t
    for i in range(N-1,-1,-1):
        if (X>>i)&1==1:
            x=X-2**i
            pci=pc-1
            print(cnt[x%pci]+1)
        else:
            x=X+2**i
            pci=pc+1
            print(cnt[x%pci]+1)
        
    
    
    
if __name__=="__main__":
    main()


### FIXED CODE ###

#

import sys
input=sys.stdin.readline

def main():
    N=int(input())
    X=input().strip("\n")
    cnt=[0]*N
    for i in range(1,N):
        n=i
        while(n>0):
            pc=0
            for j in range(19):
                if (n>>j)&1==1:
                    pc+=1
            n%=pc
            cnt[i]+=1
    pc=X.count("1")
    if pc==0:
        for i in range(N):
            print(1)
        exit()

    rp=[0]*N
    rn=[0]*N
    for i in range(N):
        rp[i]=pow(2,i,pc+1)
        if pc!=1:
            rn[i]=pow(2,i,pc-1)
    rp=rp[::-1]
    rn=rn[::-1]
            
    Xrp=0
    Xrn=0
    for i in range(N):
        if X[i]=="1":
            Xrp=(Xrp+rp[i])%(pc+1)
            if pc!=1:
                Xrn=(Xrn+rn[i])%(pc-1)
            
    for i in range(N):
        if X[i]=="1":
            if pc==1:
                print(0)
                continue
            r=Xrn-rn[i]
            print(cnt[r%(pc-1)]+1)
        else:
            r=Xrp+rp[i]
            print(cnt[r%(pc+1)]+1)
    
    
    
if __name__=="__main__":
    main()
a, b = input()
n=int(a/2)
s=b
s1=s[n:]
s2=s[:n]
bl=s1==s2
print('Yes' if bl else 'No')

### FIXED CODE ###

n = int(input())
s = input()
if n % 2:
    print("No")
    exit()
half = s[0:n // 2]
print("Yes" if s == half + half else "No")
import sys

input = sys.stdin.readline



S = input()
T = input()

s_list = list(S)
s_list = s_list[:-1]
t_list = list(T)
t_list = t_list[:-1]

itti = 0
max_itti = 0
for s in s_list:
    if s == t_list[itti]:
        itti += 1
        max_itti = max(max_itti,itti)
    else:
        itti = 0
flag = False

if max_itti == 0:
    for s in s_list:
        for t in t_list:
            if s == t:
                max_itti = 1
                flag = True
            if flag:
                break
        if flag:
            break
                

print(len(t_list) - max_itti)

### FIXED CODE ###

import sys

input = sys.stdin.readline



S = input()
T = input()

S = S.replace('\n','')
T = T.replace('\n','')

s_list = list(S)
t_list = list(T)

itti = 0
min_count = 10**5
for i in range(len(s_list)):
    if i + len(t_list) > len(s_list):
        break
    count = 0
    for j in range(len(t_list)):
        if not s_list[i+j] == t_list[j]:
            count += 1
    min_count = min(count,min_count)

print(min_count)
a,b,c = map(float,input().split())
from decimal import *

roota = Decimal.sqrt(a)
rootb = Decimal.sqrt(b)
rootc = Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import decimal
a,b,c = map(decimal.Decimal,input().split())
roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")
s = list(input())
t = list(input())

flag = True
s_len = len(s)
t_len = len(t)
max_ha = 0
l = []
max_save = 0
save = 0
count = 0

for i in range(s_len):
    if s[i] == '?':
        s[i] = 'a'
        count += 1
        max_ha += 1
        max_save = i
        if count == t_len and flag:
            save = i - count + 1
            flag = False
    elif count < t_len and s[i] == t[count]:
        l.append([max_ha, max_save])
        max_ha = 0
        count += 1
        if count == t_len and flag:
            save = i - count + 1
            flag = False
    else:
        l.append([max_ha, max_save])
        max_ha = 0
        count = 0

max_ha, max_save = max(l)        
        
if t_len < max_ha:
    for j in range(t_len):
        s[max_save-j] = t[t_len-j-1]
else:
    for j in range(t_len):
        s[j+save] = t[j]

if flag:
    print("UNRESTORABLE")
else:
    print(s)

### FIXED CODE ###

s = list(input())
t = list(input())

ls = len(s)
lt = len(t)
match = -1

for i in range(ls-lt+1):
    for j in range(lt):
        if s[i+j] == t[j] or s[i+j] == '?':
            pass
            #continueはここで処理が終わってしまう
        else:
            break
            
        if j == lt - 1:
            match = i
        
for i in range(ls):
    if s[i] == '?':
        s[i] = 'a'
        
for i in range(lt):
    s[match+i] = t[i]
        
if match < 0:
    print("UNRESTORABLE")
else:
    print(''.join(s))
l = [input() for i in range(n)]
l.sort()
i = 0
max = 1
count = 1
ans = []

while i < n-1:
  if l[i] == l[i+1]:
    count += 1
    i += 1
    if i == n-1 and count >= max:
      ans.append(l[n-1])

  else:
    if count >= max:
      max = count
      ans.append(l[i])
      count = 1
      i += 1
    else:
      count = 1
      i += 1

if max == 1:
  ans.append(l[n-1])
      
for i in ans:
  print(i)


### FIXED CODE ###

n = int(input())
l = [str(input()) for i in range(n)]
l.sort()
i = 0
count = 1
ans = []
max = 1
while i < n-1:
  if l[i] == l[i+1]:
    count += 1
    i += 1
    if count >= max:
      max = count
    if i == n-1:
      ans.append([l[n-1], count])

  else:
      ans.append([l[i],count])
      count = 1
      i += 1

if max == 1:
  ans.append([l[n-1], 1])
      
for i in ans:
  if i[1] == max:
    print(i[0])
S = list(input())
N = len(S)
# N 文字の文字列 S から、長さ N+1 の ---累積和--- s[0], s[1], ..., s[N] を作る
# これを 2019 で割ったあまりで分類する (具体的には counter[ r ] := あまりが r のやつが何個あるか)
# 各 r ごとに、counter[r] 個から 2 個選ぶ方法の数を、足し上げる

counter = [0] * 2019
indices = []
k = 10
for i in range(N + 1):
    if i == 0:
        sub = 0
        counter[i] = 0
    elif i == 1:
        sub = int(S[N - 1])
        counter[i] = sub % 2019
    else:
        # sub = int(S[N - i] + str(sub))
        sub += int(S[N - i]) * k
        k *= 10

        counter[i] = counter[i-1] + sub
        counter[i] %= 2019
        k %= 2019

    # rest = sub % 2019  # N桁のあまりを求めるのにO(N)かかる．前の桁を有効活用する(dp)
    # counter[rest] += 1

ans = 0
for r in counter:
    ans += r * (r - 1) // 2
print(ans)

### FIXED CODE ###

S = list(input())
N = len(S)
# N 文字の文字列 S から、長さ N+1 の ---累積和--- s[0], s[1], ..., s[N] を作る
# これを 2019 で割ったあまりで分類する (具体的には counter[ r ] := あまりが r のやつが何個あるか)
# 各 r ごとに、counter[r] 個から 2 個選ぶ方法の数を、足し上げる

counter = [0] * 2019
k = 10
for i in range(N + 1):
    if i == 0:
        sub = 0
    elif i == 1:
        sub = int(S[N - 1])
    else:
        sub += int(S[N - i]) * k
        k *= 10
        k %= 2019
    rest = sub % 2019
    counter[rest] += 1

ans = 0
for r in counter:
    ans += r * (r - 1) // 2
print(ans)