Harryxun/stf_run huggingface dataset:
n=int(input())???#?????????????????????????????°
for i in range(n)
        s=input().split(" ")
        s=[int(j) for j in s]
        s.sort()
        
        if(s[0]**2+s[1]**2==s[2]**2):
            print("YES")

        else:
            print("NO")
        

  

### FIXED CODE ###

n=int(input())
for i in range(n):
        s=input().split(" ")
        s=[int(j) for j in s]
        s.sort()
        
        if(s[0]**2+s[1]**2==s[2]**2):
            print("YES")

        else:
            print("NO")
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline

def dfs(p, v, num):
    global g, plus_list, ans
    tmp = num + plus_list[v]
    for x in g[v]:
        if x == p:
            continue
        dfs(v, x, tmp)
    ans[v] = tmp
    
def main():
    global g, plus_list, ans
    N, Q = map(int, input().split())
    g = [[] for i in range(N)] 
    for i in range(N-1):
        a, b = map(int, readline().split())
        a -= 1
        b -= 1
        g[a].append(b)
        g[b].append(a)

    plus_list = [0] * N
    for i in range(Q):
        q, y = map(int, input().split())
        plus_list[q-1] += y

    ans = [0] * N
    
    dfs(-1, 0, 0)
    print(*ans)
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline

def dfs(fr, now, num):
    global graph, addsum, ans
    tmp = num + addsum[now]
    for a in graph[now]:
        if a == fr:
            continue
        dfs(now, a, tmp)
    ans[now] = tmp


def main():
    global graph, addsum, ans
    N, Q = map(int, readline().split())
    graph = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, readline().split())
        a -= 1; b -= 1
        graph[a].append(b)
        graph[b].append(a)
    addsum = [0]*N
    for _ in range(Q):
        p, x = map(int, readline().split())
        p -= 1
        addsum[p] += x
    
    ans = [0]*N
    dfs(-1, 0, 0)

    print(*ans)


if __name__ == "__main__":
    main()
a = int(input())
b = int(input())
c = int(input())
map_ = {}
map_[a] = 1
map_[b] = 1
map_[c] = 1
print len(map_)

### FIXED CODE ###

l = raw_input().split()
map_ = {}
for data in l:
    map_[l[0]] = 1
    map_[l[1]] = 1
    map_[l[2]] = 1
print len(map_)
H,W = map(int,input().split())
s = [list(input()) for i in range(W)]
w = [1,0,0,-1]
h = [0,1,-1,0]
for i in range(H):
    for j in range(W):
        if s[i][j] == '#':
            flag = False
            for k in range(4):
                if j+w[k] >= 0 and j+w[k] < H and i+h[k] >= 0 and i+h[k] < W:
                    if s[i+h[k]][j+w[k]] == '#':
                        flag = True
            
            if not flag:
                print('No')
                exit()

            
        
print('Yes')



### FIXED CODE ###

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

s=[list(str(input())) for _ in range(H)]

di=[1,-1,0,0]
dj=[0,0,1,-1]
for i in range(H):
    for j in range(W):
        if s[i][j]=='#':
            found=False
            for k in range(4):
                i2=i+di[k]
                j2=j+dj[k]
                if 0<=i2 and i2<H and 0<=j2 and j2<W:
                    if s[i2][j2]=='#':
                        found=True
            if not found:
                print('No')
                exit()

print('Yes')
S=input()
S=int(S)

W=input()
W=int(W)

if W>=S:
  print("unsafe")
else:
    print("safe")


### FIXED CODE ###

s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")
import math
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
minA = math.inf
minB = math.inf
for reizou in a:
    if reizou < minA:
        minA = reizou
for renzi in b:
    if renzi < minB:
        minB = renzi
min = minA + minB
for i in range(M):
    x,y,c = map(int,input().split())
    sum = a[x-1] + b[y-1] - c
    if sum < min:
        min = sum

print(sum)

### FIXED CODE ###

A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
minA = a[0]
for reizou in a[1:]:
    if reizou < minA:
        minA = reizou
minB = b[0]
for renzi in b:
    if renzi < minB:
        minB = renzi
kakaku = minA + minB
for i in range(M):
    x,y,c = map(int,input().split())
    sumKakaku = a[x-1] + b[y-1] - c
    if sumKakaku < kakaku:
        kakaku = sumKakaku

print(kakaku)
from collections import defaultdict

class Tree:
  def __init__(self):
    self.edges = defaultdict(set)
  
  def add(self, x, y, w):
    self.edges[x].add((y, w))
    self.edges[y].add((x, w))
  
  def traverse(self, start):
    return self._traverse(start, 0, set([start]), [])
  
  def _traverse(self, start, dist, already_visited, result):
    out_nodes = self.edges[start]
    for out_node, w in out_nodes:
      if out_node in already_visited:
        continue
      result.append((out_node, dist+w))
      self._traverse(out_node, dist+w, already_visited | set([out_node]), result)
    return result
      
n = int(input())
tree = Tree()
for _ in range(n-1):
  xyw = list(map(int, input().split()))
  tree.add(*xyw)

node_dists = list(tree.traverse(1))
node_dists.append((1, 0))
node_dists = sorted(node_dists, key=lambda x: x[0])

for node, dist in node_dists:
  print(1 if dist % 2 == 0 else 0)

### FIXED CODE ###

#!/usr/bin/env python
import bisect
from collections import defaultdict
import math

def main():
    #N = map(int, input().split())
    N = int(input())

    edges = defaultdict(list)
    for _ in range(N-1):
        u, v, w = map(int, input().split())
        edges[u-1].append((v-1, w))
        edges[v-1].append((u-1, w))

    colors = [None]*N
    colors[0] = 0
    colored = [(0, 0)]
    while colored:
        new_colored = []
        for n, d in colored:
            nodes = edges[n]
            for m, w in nodes:
                if colors[m] is None:
                    dist = d + w
                    if dist % 2 == 0:
                        colors[m] = 0
                    else:
                        colors[m] = 1
                    new_colored.append((m, dist))
        colored = new_colored

    for n in range(N):
        print(colors[n])

if __name__ == '__main__':
    main()
n,l=map(int, input().split())
t=0
c=0
for i in range(n):
  if i==0:
    t=abs(l+(i+1)-1)
    c=0
  else:
    t=min(t, abs(l+(i+1)-1))
    if t=abs(l+(i+1)-1):
      c=i+1
g=0
for i in range(n):
  g+=(l+(i+1)-1)
print(g-l-c)

### FIXED CODE ###

n,l=map(int, input().split())
t=0
c=0
for i in range(n):
  if i==0:
    t=abs(l+(i+1)-1)
    c=i+1
  else:
    t=min(t, abs(l+(i+1)-1))
    if t==abs(l+(i+1)-1):
      c=i+1
#print(c)
g=0
for i in range(n):
  g+=(l+(i+1)-1)
#print(g)
print(g-l-c+1)
n=int(input())
a=[int(input()) for i in range(n)]
m=set(sorted(a,reverse=True))
M=m[0]
indexes=[j for j,x in enumerate(a) if x==M]
for k in range(n):
  if a[k]==M and len(indexes)==1:
    print(m[1])
  else:
    print(M)



### FIXED CODE ###

import collections
n=int(input())
a=[]
for i in range(n):
  a.append(int(input()))
b=collections.Counter(a)
d=list(b.items())
d.sort(key=lambda x:-int(x[0]))
if d[0][1]==1:
  for i in range(n):
    if a[i]==int(d[0][0]):
      print(int(d[1][0]))
    else:
      print(int(d[0][0]))
else:
  for i in range(n):
    print(int(d[0][0]))
from math import gcd
N,M=map(int,input().split())
S=input()
T=input()
s=M//gcd(N,M)
t=N//gcd(N,M)
if s==1:SS=S
else:SS=("?"*(s-1)).join(list(S))+"?"*(s-1)
if t==1:TT=T
else:TT=("?"*(t-1)).join(list(T))+"?"*(t-1)
for i in range(len(SS)):
    if SS[i]==TT[i] or SS[i]=="?" or TT[i]=="?":pass
    else:
        print(-1)
        exit()
print(len(SS))

### FIXED CODE ###

from fractions import gcd
N,M=map(int,input().split())
S=input()
T=input()
s=(M//gcd(N,M))
t=(N//gcd(N,M))
SS=[i*s for i in range(N)]
TT=[j*t for j in range(M)]
p,q=0,0
ans=N*s
while True:
    if SS[p]==TT[q]:
        if S[p]!=T[q]:ans=-1
        p+=1
        q+=1
    elif SS[p]>TT[q]:
        q+=1
    else:
        p+=1
    if p==N or q==M:
        break
print(ans)
x = list(map(str,input().split()) for i in range(3))
print(x[0][0]+x[1][1]+x[2][2])

### FIXED CODE ###

x = [input() for i in range(3)]
print(x[0][0]+x[1][1]+x[2][2])
def main():
    import sys
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines

    N, K, C = map(int, readline().split())
    S = list(map(int, readline().split()))
    ans = []

    def solve(index, K):
        i = 0
        cnt = 0
        while i < N:
            if S[i] == 'o' and i != index:
                cnt += 1
                i += C + 1
            else:
                i += 1
        return cnt < K

    if not (solve(-1, K+1)):
        pass
    else:
        index = 0
        while index < N:
            if S[index] == 'x':
                index += 1
            elif solve(index, K):
                ans.append(index + 1)
                index += C + 1
            else:
                index += 1

        for i in ans:
            print(i)
        
if __name__ == '__main__':
    main()

### FIXED CODE ###

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

def solve(List):
    ans = []
    i = 0
    while i < N:
        if List[i] == 'o':
            ans.append(i+1)
            i += C
        i += 1
    return ans

n = solve(S)

if len(n) > K:
    pass
else:
    r = solve(S[::-1])
    r = list(map(lambda x: N+1-x, r[::-1]))
    ans = list(set(n) & set(r))
    ans.sort()
    for i in ans:
        print(i)
import math
h, w = map(int, input().split())

if h == 1 or w == 1:
  print(1)
elif h % 2 == 0 or w % 2 ==0:
  print(int((h * w) // 2))
else:
  print(int(math.ceil((h * w) // 2)))

### FIXED CODE ###

a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(a[k-1])
a, b, c = map(int, input().split())
print("YES" if b - a=c - b else "NO")

### FIXED CODE ###

a, b, c = map(int, input().split())
print("YES" if b - a == c - b else "NO")
A, B, C = map(int, input().split())
K = int(input())
M = max([A, B, C])
print(M ** K + A + B+ C - M)

### FIXED CODE ###

a,b=map(int,input().split())
if b<a:
 print(a-1)
else:
 print(a)
N=int(input())
num=0
for j in range(1,N+1,2):
	cnt=0
	for i in range(1,j+1):
#        print(i)
#        print(j)
        if j%i==0 :
            cnt=cnt+1
    if cnt==8 :
#        print(cnt)
        num+=1
#    print("---")
print(num)


### FIXED CODE ###

N=int(input())
num=0
for j in range(1,N+1,2):
    cnt=0
    for i in range(1,j+1):
#        print(i)
#        print(j)
        if j%i==0 :
            cnt=cnt+1
    if cnt==8 :
#        print(cnt)
        num+=1
    cnt=0
#    print("---")
print(num)
S=input()
T="AKIHABARA"
c=0
t=0
while(True):
    if(len(S)==c):
        if(T[t]=="A"):
            t+=1
        else:
            print("NO")
            exit()
    elif(S[c]==T[t]):
        c+=1
        t+=1
    else:
        if(T[t]=="A"):
            t+=1
        else:
            print("NO")
            exit()
    if(len(S)==c and t==9):
        print("YES")
        exit()

### FIXED CODE ###

S=input()
T="AKIHABARA"
c=0
t=0
while(True):
    if(len(S)==c):
        if(T[t]=="A"):
            t+=1
        else:
            print("NO")
            exit()
    elif(S[c]==T[t]):
        c+=1
        t+=1
    else:
        if(T[t]=="A"):
            t+=1
        else:
            print("NO")
            exit()
    if(len(S)==c and t==9):
        print("YES")
        exit()
    elif(t==9):
        print("NO")
        exit()
import sys
input = sys.stdin.readline

def main():
  s = input()
  n = len(s)
  mod = 10**9+7
  dp = [[0]*13 for _ in range(n+1)]
  dp[0][0] = 1
  d = {(j, k):(10*j+k)%13 for k in range(10) for j in range(13)}
  for i in range(n):
    if s[i] != "?":
      t = int(s[i])
      for j in range(13):
        dp[i+1][d[(j, t)]] += dp[i][j]
        dp[i+1][d[(j, t)]] %= mod
    else:
      for k in range(10):
        for j in range(13):
          dp[i+1][d[(j, k)]] += dp[i][j]
          dp[i+1][d[(j, k)]] %= mod
  print(dp[n][5]%mod)
if __name__ == '__main__':
  main()

### FIXED CODE ###

s = input()
n = len(s)
mod = 10**9+7
dp = [[0]*13 for _ in range(n+1)]
dp[0][0] = 1
d = {(j, k):(10*j+k)%13 for k in range(10) for j in range(13)}
for i in range(n):
  if s[i] != "?":
    t = int(s[i])
    for j in range(13):
      dp[i+1][d[(j, t)]] += dp[i][j]
      dp[i+1][d[(j, t)]] %= mod
  else:
    for k in range(10):
      for j in range(13):
        dp[i+1][d[(j, k)]] += dp[i][j]
        dp[i+1][d[(j, k)]] %= mod
print(dp[n][5]%mod)
lst = []
V = 0

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

for f in lst:
    V += f
print(int(V - (l/2)))

### FIXED CODE ###

n = int(input())
p = [int(input()) for i in range(n)]
p.sort()
print(int(p[-1]/2+sum(p[:-1])))
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    a = list(set(a))
    a.sort()

    if len(a) < 2:
        print(0)
        return

    ans = 0
    for i in range(n):
        for j in range(min(i+1,n)):
            if i == j: continue
            
            if a[i] % a[j] == 0:
                break
        else:
            ans += 1

    print(ans)

resolve()

### FIXED CODE ###

def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    max_a = max(A)
    m = set()
    checked = set()
    duplicated = set()

    for a in A:
        if a in checked:
            duplicated.add(a)
            continue

        i = 2
        while a*i <= max_a:
            m.add(a*i)
            i += 1

        checked.add(a)

    ans = 0
    for a in A:
        if a in duplicated: continue

        if a not in m:
            ans += 1
    
    print(ans)
 
resolve()
n = input()
m = []
for i in range(n):
    m.append(input())

interest = [m[1]-m[0]]
for i in range(n):
    for j in range(i+1,n):
        if interest[-1] < m[j]-m[i]:
        interest.append(m[j]-m[i])
print(interest[-1])
 

### FIXED CODE ###

n = int(input())
a = [0 for i in range(n)]
for i in range(n):
    a[i] = int(input())
minimum = a[0]
profit = a[1]-a[0]

for i in range(1,n):
    if profit < a[i]- minimum:
        profit = a[i] - minimum
    if minimum > a[i]:
        minimum = a[i]
        
print(profit)
s = map(input())
if (s[:4] == 2019 and s[5] == 0 and s[6] <= 4) or (s[:4] < 2019):
    print("Heisei")
else:
    print("TBD")

### FIXED CODE ###

s = input()
 
if s <= '2019/04/30':
    print('Heisei')
else:
    print('TBD')
a,b=[int(input()) for i in range(2)]
c=[str(input()) for i in range(a)]
for i in range(a):
  c[i]="."+c[i]+"."
c=["."*(b+2)]+c +["."*(b+2)]
d=[["0"for i in range(b)]for j in range(a)]
for i in range(1,a+1):
  for j in range(1,b+1):
    f=0
    for k in range(-1,2):
      for l in range(-1,2):
        if c[i+k][j+l]=="#":
          f+=1
    d[i-1][j-1]=str(f)
for i in range(1,a+1):
  for j in range(1,b+1):
    if c[i][j]=="#":
      d[i-1][j-1]="#"
for i in range(a):
  dd=""
  for j in range(b):
    dd+=str(d[i][j])
  print(dd)

### FIXED CODE ###

a,b=map(int,input().split())
c=[str(input()) for i in range(a)]
for i in range(a):
  c[i]="."+c[i]+"."
c=["."*(b+2)]+c +["."*(b+2)]
d=[["0"for i in range(b)]for j in range(a)]
for i in range(1,a+1):
  for j in range(1,b+1):
    f=0
    for k in range(-1,2):
      for l in range(-1,2):
        if c[i+k][j+l]=="#":
          f+=1
    d[i-1][j-1]=str(f)
for i in range(1,a+1):
  for j in range(1,b+1):
    if c[i][j]=="#":
      d[i-1][j-1]="#"
for i in range(a):
  dd=""
  for j in range(b):
    dd+=str(d[i][j])
  print(dd)
a = int(input())
b = int(input())
ans = a * b - a - b + 1
print(ans)

### FIXED CODE ###

inp = input()
l = list(map(int, inp.split()))
a = l[0]
b = l[1]

ans = a * b - a - b + 1
print(ans)
N,M = map(int,input().split())
graph = {i:[] for i in range(N)}
for _ in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    graph[x].append(y)
    graph[y].append(x)

color = [0 for _ in range(N)]

def f(u,c):
    color[u] = c
    for v in graph[u]:
        if color[v] == c: # 隣接している頂点が同色の場合 二部グラフではない
            return False
        elif (color[v] ==0 and not f(v,-c)):
            return False
    return True 

bipartite = True
for i in range(N):
    if color[i] == 0:
        if not f(i,1):
            bipartite = False

if bipartite: # 二部グラフ
    ans = color.count(1)*color.count(-1) - M
else:
    ans = M*(M-1)/2 - M

print(int(ans))

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

N,M = map(int,input().split())
graph = {i:[] for i in range(N)}
for _ in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    graph[x].append(y)
    graph[y].append(x)


def f(u,c):
    color[u] = c
    for v in graph[u]:
        if color[v] == 0: # まだ塗られていない場合
            if not f(v,-c):
                return False
        else:
            if color[v] == c: # 隣接している頂点が同色の場合 二部グラフではない
                return False
    return True 

flag = True
color = [0 for _ in range(N)]
for i in range(N):
    if color[i] == 0:
        if not f(i,1):
            flag = False
            break

if flag: # 二部グラフ
    ans = color.count(1)*color.count(-1) - M
else:
    ans = N*(N-1)//2 - M

print(int(ans))
N, K = map(int, input().split())
S = input()
print(S[:K]+S[K].lower()+S[K+1:])

### FIXED CODE ###

N,K = map(int, input().split())
S = input()
print(S[:K-1]+S[K-1].lower()+S[K:])
N = int(input())
An = [int(x) for x in input().split()]
 
L = [0,0]
for i in range(N):
    if i > 1:
        L.append(int(math.factorial(i) / (math.factorial(i-2) * 2)))

Cn = [An.count(i) for i in range(1,N+1)]
s = sum([L[Cn[i]] for i in range(N)])

for k in range(N):
    print(sum(Dn) - (Cn[An[k]-1]-1))

### FIXED CODE ###

import collections as c

# 入力
N = int(input())
An = [int(x) for x in input().split()]
 
# 各数字の個数を求める
Cn = c.Counter(An)
 
# 全部の組み合わせ
s = 0
for v in Cn.values():
    s += int(v*(v-1) / 2)

for i in range(0,N):
    print(s - (Cn[An[i]] - 1))
from collections import defaultdict
def ReadInput():
	return [int(i) for i in input().split(" ")]
(R, C) = ReadInput()
N = int(input())
VectorSet = set() 
Grid = defaultdict(list)
for i in range(N):
	(r, c, a) = ReadInput()
	Grid[("R", r)].append((("C", c), a))
	Grid[("C", c)].append((("R", r), a))
	VectorSet.add(("R", r))
	VectorSet.add(("C", c))
def iteration(vector):
	VectorSet.discard(vector)
	for (v, a) in Grid[vector]:
		temp = a - VectorCover[vector]
		if (v in VectorCover):
			if(temp != VectorCover[v]):
				print("No")
				exit()
		else:
			VectorCover[v] = temp
			iteration(v) 
while(len(VectorSet) != 0):
	vector = VectorSet.pop()
	VectorCover = dict() 
	VectorCover[vector] = 0
	iteration(vector)
	minR = min(a for (p, a) in VectorCover.items() if (p[0] == "R"))
	minC = min(a for (p, a) in VectorCover.items() if (p[0] == "C"))
	if (minR + minC < 0):
		print("No")
		exit()
print("Yes")

### FIXED CODE ###

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

def ReadInput():
	return [int(i) for i in input().split(" ")]

(R, C) = ReadInput()
N = int(input())
VectorSet = set() 
Grid = defaultdict(list)
for i in range(N):
	(r, c, a) = ReadInput()
	Grid[("R", r)].append((("C", c), a))
	Grid[("C", c)].append((("R", r), a))
	VectorSet.add(("R", r))
	VectorSet.add(("C", c))

def iteration(vector):
	VectorSet.discard(vector)
	for (v, a) in Grid[vector]:
		temp = a - VectorCover[vector]
		if (v in VectorCover):
			if(temp != VectorCover[v]):
				print("No")
				exit()
		else:
			VectorCover[v] = temp
			iteration(v) 

while(len(VectorSet) != 0):
	vector = VectorSet.pop()
	VectorCover = dict() 
	VectorCover[vector] = 0
	iteration(vector)
	minR = min(a for (p, a) in VectorCover.items() if (p[0] == "R"))
	minC = min(a for (p, a) in VectorCover.items() if (p[0] == "C"))
	if (minR + minC < 0):
		print("No")
		exit()

print("Yes")
a=input()
if a == A:
  print(T)
elif a == T:
  print(A)
elif a == C:
  print(G)
else:
  print(C)


### FIXED CODE ###

a=input()
if a=="A":
  print("T")
elif a=="T":
  print("A")
elif a=="C":
  print("G")
else:
  print("C")
N = int(input())
k = [2,1]
if N == 1:
  print(1)
else:
  for i in range(N-1):
    S = k[i]+k[i+1]
    k.append(S)
print(S)

### FIXED CODE ###

L = [2,1]
for i in range(100):
  L.append(L[i+1]+L[i])
n = int(input())
print(L[n])
n = int(input())
h = list(map(int,input().split()))
 
ans = [0] * n
ans[1] = abs(h[1] - h[0])
for i in range(2,n):
  ans[i] = min(abs(h[i] - h[i-1]) + ans[i-1], abs(h[i] - h[i-2]) + ans[i-2])
print(a[-1])

### FIXED CODE ###

n = int(input())
h = list(map(int,input().split()))
ans = [0] * n
ans[1] = abs(h[1] - h[0])
for i in range(2,n):
  ans[i] = min(abs(h[i] - h[i-1]) + ans[i-1], abs(h[i] - h[i-2]) + ans[i-2])
print(ans[-1])
N = int(input())
A_list = list(map(int, input().split()))

ans = 1

for i in A_list:
    if i == 0:
        print(0)
        exit(1)

for i in A_list:
    ans = ans * i
    if ans > 10 ** 18:
        ans = -1
        break

print(ans)

### FIXED CODE ###

N = int(input())
A_list = list(map(int, input().split()))

ans = 1

for i in A_list:
    if i == 0:
        ans = 0

if ans != 0:
    for i in A_list:
        ans = ans * i
        if ans > 10 ** 18:
            ans = -1
            break

print(ans)
a=int(input())
for x in range(a**0.5,0,-1)
	if a%x==0:
    s=a+x-2
    break
print(s)

### FIXED CODE ###

a=int(input())
for x in range(int(a**0.5),0,-1):
  if a%x==0:
    b=int(a//x)
    break
print(b+x-2)
N = int(input())
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
C = []

S = sum(A2) + A1[0]

for i in range(1,N):
  C.append(S)
  S += A1[i]-A2[i-1]
  
print(max(C))

### FIXED CODE ###

N = int(input())
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
C = []

S = sum(A2) + A1[0]

for i in range(1,N):
  C.append(S)
  S += A1[i]-A2[i-1]
  
if N != 1:
  print(max(C))
else:
  print(A1[0]+A2[0])
%%time
H = int(input())
counter = 0
i = H
while i > 1:
    i = i//2
    counter += 1
    
ans = 2**(counter+1)-1
print(ans)

### FIXED CODE ###

H = int(input())
counter = 0
i = H
while i > 1:
    i = i//2
    counter += 1
    
ans = int(2**(counter+1)-1)
print(ans)
n = int(input())
alist = list(map(int,input().split()))
dic = {}
for i in range(n):
    if alist[i] not in dic:
        dic[alist[i]] = 0
    dic[alist[i]] += 1

k = -2
while n-1-k >= 2:
    k += 2
    if n-1-k != 0:
        if dic[n-1-k] != 2:
            print(0)
            exit()
    else:
        if dic[0] != 1:
            print(0)
            exit()

p = n//2
print(2**p)

### FIXED CODE ###

n = int(input())
cnts = [0]*n
alist = list(map(int,input().split()))
mod = 10**9+7

for i in range(n):
    cnts[alist[i]] += 1

p = n%2
if p == 1:
    cnts[0] += 1

for i in range(n):
    if p != (i%2):
        if cnts[i] != 2:
            print(0)
            exit()
    else:
        if cnts[i] != 0:
            print(0)
            exit()
print(pow(2,(n//2))%mod)