Harryxun/stf_run huggingface dataset:
from math import gcd 
n=int(input())
mod = 10**9+7
count = {}

num=0
for _ in range(n):
    a,b = map(int,input().split())
    if a==0 and b==0:
        num+=1
        continue
    if a*b != 0:
        g=gcd(a,b)*(b//abs(b))
    elif a != 0:
        g=a
    else:
        g=b
        
    x=a//g,b//g
    count[x]=count.get(x,0)+1
        
mem=set()
ans=1
for (x,y),z in count.items():
    k=(-1*x//abs(x)*y,abs(x))
    if k in mem:
        continue
    mem.add((x,y))
    ans*=pow(2,z)+pow(2,count.get(k,0))-1
    ans%=mod

print((ans+num-1)%mod)

### FIXED CODE ###

from math import gcd 
n=int(input())
mod = 10**9+7
count = {}

num=0
for _ in range(n):
    a,b = map(int,input().split())
    if a==0 and b==0:
        num+=1
        continue
    if a*b != 0:
        g=gcd(a,b)*(b//abs(b))
    elif a != 0:
        g=a
    else:
        g=b
        
    l=a//g,b//g
    count[l]=count.get(l,0)+1
        
mem=set()
ans=1
for (x,y),z in count.items():
    if x*y==0:
        k=(y,x)
    else:
        k=(-1*x//abs(x)*y,abs(x))
    if k in mem:
        continue
    mem.add((x,y))
    ans*=(pow(2,z)+pow(2,count.get(k,0))-1)
    ans%=mod

print((ans+num-1)%mod)
N = int(input())
L = [list(map(int, input().split())) for _ in range(N)]
D = [[0]*N for _ in range(N)]
for i in range(N):
    for j in range(i+1, N):
        D[i][j] = D[j][i] = ( (L[i][0]-L[j][0])**2 + (L[i][1]-L[j][1])**2 )**0.5

M = [-1]*N
pathlist = []
def makepath(k, prev):
    if k==8: pathlist.append(M[:])
    for i in range(N):
        if M[i]>=0: continue
        M[i] = k
        makepath(k+1, i)
        M[i] = -1

makepath(0, -1)

s = 0
for p in pathlist:
    for i in range(N-1):
        s += D[p[i]][p[i+1]]
        
print(s/len(pathlist))

### FIXED CODE ###

N = int(input())
L = [list(map(int, input().split())) for _ in range(N)]
D = [[0]*N for _ in range(N)]
for i in range(N):
    for j in range(i+1, N):
        D[i][j] = D[j][i] = ( (L[i][0]-L[j][0])**2 + (L[i][1]-L[j][1])**2 )**0.5

M = [-1]*N
pathlist = []
def makepath(k, prev):
    if k==N: pathlist.append(M[:])
    for i in range(N):
        if M[i]>=0: continue
        M[i] = k
        makepath(k+1, i)
        M[i] = -1

makepath(0, -1)

s = 0
for p in pathlist:
    for i in range(N-1):
        s += D[p[i]][p[i+1]]
        
print(s/len(pathlist))
x,k,d = list(map(int,input().split()))
dis = x
cnt = 0
while cnt<k:
    if abs(dis)<d:
        recnt = k -cnt
        if recnt%2==0:
        else:
            dis = d-abs(dis)
        break
    elif dis>=0:
        dis = dis - d
    else:
        dis = dis + d
    cnt += 1
print(abs(dis))

### FIXED CODE ###

x,k,d = list(map(int,input().split()))
x = abs(x)
point =x % d
num = x//d
if num<k:
    rest = k - num
    if rest%2==0:
        pass
    else:
        point = d -point
else:
    point = x - k*d
print(point)
n = int(input())
m = 2
z = 0

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

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

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

        return arr

    x = 0
    y = 1

    r = factorization(m)
    l = len(r)

    for i in range(l):
        y = y * (r[x][1]+1)
        x+=1


    m+=1
    z = z + y

print(z+1)


### FIXED CODE ###

s = input()
l = len(s)
x = s[l-1]
if x == "s":
    print(s + "es")
else:
    print(s + "s")
import math
from math import pi, sqrt, sin, cos

A = int(input())
B = int(input())
H = int(input())
M = int(input())

theta_H = H / 12 * 2* pi
theta_M = M / 60 * 2* pi

D = sqrt((A*cos(theta_H)-B*cos(theta_M))**2 + (A*sin(theta_H) - B*sin(theta_M))**2)

print(D)

### FIXED CODE ###

import math
from math import pi, sqrt, sin, cos

A,B,H,M=map(int, input().split())

theta_H = H / 12 * 2 * pi + M / 12 / 60 * 2 * pi
theta_M = M / 60 * 2 * pi

D = sqrt((A*sin(theta_H)-B*sin(theta_M))**2+(A*cos(theta_H)-B*cos(theta_M))**2)

print(D)
N,T=map(int,input().split())
t=list(map(int,input().split()))+[10**18]
x=0
for i in range(n):
  x+=min(t[i+1]-t[i],T)
print(x)

### FIXED CODE ###

N,T=map(int,input().split())
t=list(map(int,input().split()))+[10**18]
x=0
for i in range(N):
  x+=min(t[i+1]-t[i],T)
print(x)
import sys
import numpy as np
from numba import njit

#@njit('i8(i8,i8[:],i8[:,:])')
def main(N, S, dp):
    ans = 0
    for i in range(N - 1):
        for j in range(i + 1, N):
            dp[i][j] = min(j - i, dp[i - 1][j - 1] + 1) if S[i] == S[j] else 0
        ans = max(ans, max(dp[i]))
    return ans


if sys.argv[-1] == 'ONLINE_JUDGE' and 0:
    import numba
    from numba.pycc import CC
    cc = CC('my_module')

    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return numba.njit(f)

    main = cc.export('main', 'i8(i8,i8[:],i8[:,:])')
    cc.compile()

from my_module import main

print(0)
exit()
N = int(input())
S = np.array([ord(_) for _ in input()])
dp = np.zeros((N + 1, N + 1), dtype=int)
print(main(N, S, dp))


### FIXED CODE ###

import itertools
N = int(input())
S = input()
dp = [[0] * N for _ in range(N)]
ans = 0
for i, j in itertools.combinations(range(N), 2):
    if S[i] == S[j]:
        dp[i][j] = dp[i - 1][j - 1] + 1
    else:
        dp[i][j] = 0
    ans = max(ans, min(j - i, dp[i][j]))
print(ans)
N = int(input())
XYH = []
for i in range(N):
    tmp = list(map(int, input().split()))
    if tmp[2] == 0:
        continue
    XYH.append(tmp)

def calc(XYH):
    tmp = 0
    res = [0,0,0]
    for tarx in range(101):
        for tary in range(101):
            xyh = XYH[0]
            tarh = xyh[2] + abs(xyh[0] - tarx) + abs(xyh[1] - tary)
            if all(h==max(h - abs(tarx - x) - abs(tary - y), 0) for x, y, h in XYH):
                print(" ".join(x,y,h))
                return
    
calc(XYH)

### FIXED CODE ###

N = int(input())
XYH = []
for i in range(N):
    tmp = list(map(int, input().split()))
    if tmp[2] != 0:
        xyh = tmp
    XYH.append(tmp)

def calc(XYH, xyh):
    for tarx in range(101):
        for tary in range(101):
            tarh = xyh[2] + abs(xyh[0] - tarx) + abs(xyh[1] - tary)
            if all(h==max(tarh - abs(tarx - x) - abs(tary - y), 0) for x, y, h in XYH):
                return list(map(str, [tarx, tary, tarh]))
    
print(" ".join(calc(XYH, xyh)))
n,m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))
fib = [1,1]
#n段登る場合の数がfib[n]になるようにする
for i in range(n):
    fib.append((fib[i]+fib[i+1])%1000000007)
answer = 1
answer *= fib[a[0]-1]
if m > 1:
    if a[0]+1 == a[1]:
        answer = 0
for i in range(m-1):
    if a[i] + 1 == a[i+1]:
        answer = 0
    answer = answer * fib[a[i+1]-a[i]-2] % 1000000007
answer = answer * fib[n - a[m-1] -1] % 1000000007
print(answer)

### FIXED CODE ###

import sys
n,m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))
fib = [1,1]
for i in range(n):
    fib.append((fib[i]+fib[i+1])%1000000007)
if m == 0:
    print(fib[n]%1000000007)
    sys.exit()
answer = fib[a[0]-1]
for i in range(m-1):
    if a[i] + 1 == a[i+1]:
        answer = 0
    else:
        answer = answer * fib[a[i+1]-a[i]-2] % 1000000007
answer = answer * fib[n-a[m-1]-1] % 1000000007
print(answer)
A, B = [int(x) for x in stdin.readline().rstrip().split()]
print(A * B)

### FIXED CODE ###

from sys import stdin
A, B = [int(x) for x in stdin.readline().rstrip().split()]
print(A * B)
import sys
from collections import Counter

print('yes' if all([True if x <= 1 else False for x in list(Counter(sys.argv[1]).values())]) else 'no')

### FIXED CODE ###

from collections import Counter

print('yes' if all([True if x <= 1 else False for x in list(Counter(input()).values())]) else 'no')
H, W = map(int, input().split(" "))
result = True
masu = [["." for i in range(H+2)] for j in range(W+2)]
for h in range(1, H+1):
    s = "0"+input()+"0"
    masu[h] = list(s)
# print(masu)
for h in range(1, H+1):
    for w in range(1, W+1):
        # print(h, w, masu[h][w])
        if masu[h][w] == "#" and masu[h+1][w] != "#" and masu[h][w+1] != "#" and masu[h-1][w] != "#" and masu[h][w-1] != "#":
            result = False
if result:
    print("Yes")
else:
    print("No")

### FIXED CODE ###


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

# result = True
masu = [['.' for i in range(W+2)] for j in range(H+2)]
for h in range(H):
    s = "."+input()+"."
    masu[h+1] = s

# print(masu)

for h in range(1,H+1):
    for w in range(1,W+1):
        if masu[h][w] == "#":
            if "#" == masu[h+1][w] or "#" == masu[h][w+1] or "#" == masu[h-1][w] or "#" == masu[h][w-1]:
                pass
            else:
                # result = False
                print("No")
                exit()

print("Yes")
import sys
 
args = sys.argv
 
length = arg[1]
focus = int(arg[2])
abcs = arg[3]
 
def change_upper_to_lower(str, num):
  if(str[num] == "A"):
    str[num] == "a"
  elif(str[num] == "B"):
    str[num] == "b"
  else:
    str[num] == "c"
    
change_upper_to_lower(abcs, focus)
 
print(abcs)

### FIXED CODE ###

import sys

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

abcs = input()
 
def change_upper_to_lower(str, num):
  
  before = str[:int(num) - 1]
  after = str[int(num):]

  if(str[int(num) - 1] == "A"):
    newstr = before + "a" + after
  elif(str[int(num) - 1] == "B"):
    newstr = before + "b" + after
  else:
    newstr = before + "c" + after
    
  return newstr
 
 
changed_abcs = change_upper_to_lower(abcs, b)
 
print(changed_abcs)
a = int(input())
b = int(input())

if a*b%2 == 0:
  print("Even")
else:
  print("Odd")


### FIXED CODE ###

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

if a*b%2 == 0:
    print("Even")
else:
    print("Odd")
#!usr/bin/env python3

def string_two_numbers_spliter():
    a, b = [int(i) for i in input().split()]
    return a, b


def main():
    a, b = string_two_numbers_spliter()

    if a < b:
        print('a < b')
    elif a > b:
        print('a > b')
    else:
        print('a == b')


if __name__ == '__main__':
    main()

### FIXED CODE ###

#!usr/bin/env python3

def string_two_numbers_spliter():
    a, b = [int(i) for i in input().split()]
    return a, b


def main():
    a, b = string_two_numbers_spliter()

    if a < b:
        print('a < b')
    elif a > b:
        print('a > b')
    else:
        print('a == b')


if __name__ == '__main__':
    main()
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
for i in range(N):
  ans = ans + B[A[i]]
  if i > 0 and A[i] == A[i-1] + 1:
    ans = ans + C[A[i-1]]
print(ans)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
for i in range(N):
  ans = ans + B[A[i] - 1]
  if i > 0 and A[i] == A[i-1] + 1:
    ans = ans + C[A[i-1] - 1]
print(str(ans))
inputs = input().split('\n')
n = inputs[0]
color = inputs[1]

if n >= 3200:
  print(color)
else:
  print('red')

### FIXED CODE ###

n = int(input())
color = input()
 
if n >= 3200:
  print(color)
else:
  print('red')
s = input()
if s.isuper():
    print("A")
else:
    print("a")


### FIXED CODE ###

s = input()
if s.isupper():
    print("A")
else:
    print("a")
no_list=[]
s=input().split()
money,num=int(s[0]),int(s[1])
for i in range(num):
    no_list.append(input())
for i in range(money,10000):
    origin=i
    flag=0
    while i!=0:
        if str(i%10) in no_list:
            flag=1
            break
        i//=10
    if flag==0:
        print(origin)
        break


### FIXED CODE ###

s=input().split()
money,num=int(s[0]),int(s[1])
no_list=input().split()
for i in range(money,100000):
    flag=0
    for money_element in list(str(i)):
        if money_element in no_list:
            flag=1
            break
    if flag==0:
        print(i)
        break
h,w,d = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(h)]
q = int(input())
l = [list(map(int,input().split())) for _ in range(q)]
dic = {}
for i in range(1,h*w):
    list = []
    for j in range(i,h*w,d):
        for y in range(len(a)):
            if j in a[y]:
                for x in range(len(a[y])):
                    if a[y][x]==j:
                        if i==j:
                            list.append(0)
                            x_ = x
                            y_ = y
                            k = 0
                        else:
                            k += abs(x-x_)+abs(y-y_)
                            list.append(k)
                            x_ = x
                            y_ = y
    dic[i] = list
for l_ in l:
    print(dic[l_[0]][(l_[1]-l_[0])//d])

### FIXED CODE ###

h,w,d = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(h)]
q = int(input())
l = [list(map(int,input().split())) for _ in range(q)]
dic = {}
for i in range(len(a)):
    for j in range(len(a[i])):
        dic[a[i][j]] = (i,j)
sum = [0]*(h*w+1)
for i in range(d+1,h*w+1):
    sum[i] = sum[i-d]+abs(dic[i][0]-dic[i-d][0])+abs(dic[i][1]-dic[i-d][1])
for l_ in l:
    print(sum[l_[1]]-sum[l_[0]])
def main():
    def DFS(v):
        if DP[v] != -1: return DP[v]

        res = 0
        for i in G[v]:
            res = max(res, DFS(i) + 1)

        DP[v] = res
        return res


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

    G = [[] for _ in range(N)]
    for x, y in xy:
        G[x - 1].append(y - 1)

    DP = [-1] * N
    for v in range(N):
        DFS(v)

    print(max(DP))


if __name__ == '__main__':
    main()

exit()


### FIXED CODE ###

from collections import deque


def main():
    N, M = map(int, input().split())
    xy = [list(map(int, input().split())) for _ in range(M)]

    G = [[] for _ in range(N)]
    ins = [0] * N
    for i in range(M):
        G[xy[i][0] - 1].append(xy[i][1] - 1)
        ins[xy[i][1] - 1] += 1

    DP = [0] * N
    queue = deque()
    for i in range(N):
        if ins[i] == 0:
            queue.append(i)

    while queue:
        v = queue.popleft()
        for i in G[v]:
            ins[i] -= 1
            if ins[i] == 0:
                DP[i] = max(DP[i], DP[v] + 1)
                queue.append(i)

    print(max(DP))


if __name__ == '__main__':
    main()

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

data = [int(s) for s in input().split()]
data.sort()
l = []
for i in range(m-1):
    l.append(data[i+1]-data[i])
l.sort(reverse = True)

x = 0
for i in range(n-1):
    x += l[i]
print(data[m-1] - data[0] - x)


### FIXED CODE ###

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

data = [int(s) for s in input().split()]
data.sort()
l = []
if n >= m:
    print(0)
else:
    for i in range(m-1):
        l.append(data[i+1]-data[i])
    l.sort(reverse = True)

    x = 0
    for i in range(n-1):
        x += l[i]
    print(data[m-1] - data[0] - x)
k, x = map(int, input().split())
L = []
for i in range(k):
    y = x + i
    z = x - i
    if y > 1000000:
        y = x
    L.append(y)
    if z < -1000000:
        z = x
    L.append(z)
printset((L))


### FIXED CODE ###


# ABC138
# B One Clue
# K個連続黒、Xが黒、座標-1000000+1000000
k, x = map(int, input().split())
L = []
for i in range(k):
    y = x + i
    z = x - i
    if y > 1000000:
        y = x
    L.append(y)
    if z < -1000000:
        z = x
    L.append(z)
I = set(L)
L = list(sorted(I))
for s in L:
    print(s,end = " ")
if __name__ == '__main__':
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    s = sum(a)
    a = sorted(a)[::-1]
    if a[m-1] >= (s / (4 * m)):
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

import sys


if __name__ == '__main__':
    a, b, c = map(int, input().split())
    print(c, a, b)
import numpy as np

N, K = map(int, input().split(' '))
TD = [[int(v) for v in input().split(' ')] for _ in range(N)]

dp = np.zeros((K+1, N+1), dtype=float)
nt = [['']*(N+1) for _ in range(K+1)]
for i in range(1, K+1):
    for j in range(1, N+1):
        
        if str(TD[j - 1][0]) in list(nt[i-1][j-1]):
            t_dp = dp[i - 1, j - 1] + TD[j - 1][1]
        else:
            v = len(nt[i - 1][j - 1])
            t_dp = dp[i - 1, j - 1] + TD[j - 1][1] - v**2 + (v+1)**2

        if dp[i, j-1] >= t_dp:
            dp[i, j] = dp[i, j-1]
            nt[i][j] = nt[i][j-1]
        else:
            dp[i, j] = t_dp
            if str(TD[j-1][0]) not in list(nt[i-1][j - 1]):
                nt[i][j] = nt[i-1][j - 1] + str(TD[j-1][0])
            else:
                nt[i][j] = nt[i - 1][j - 1]

print(int(dp[K, N]))

### FIXED CODE ###

from heapq import heappush, heappop

N, K = map(int, input().split(' '))
h = []
for _ in range(N):
    t, d = map(int, input().split(' '))
    heappush(h, (-d, t))

dsum = 0
used = {}
q = []
for _ in range(K):
    d, t = heappop(h)
    if t not in used:
        used[t] = 1
    else:
        heappush(q, (-d, t))
    dsum += -d
res = len(used)**2 + dsum

while h and q:
    d, t = heappop(h)
    if t not in used:
        used[t] = 1
        m, _ = heappop(q)
        dsum = dsum - m - d
        res = max(res, len(used)**2 + dsum)
print(res)
s = list(map(int, input()))
for i in range(len(s)):
    if i%2 == 0 and s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
        bool = True
    elif i%2 == 1 and s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
        bool = True
    else:
        bool = False
        break
        
if bool == True:
    print('Yes')
elif bool == False:
    print('No')

### FIXED CODE ###

S = list(map(str, input()))

bool = True
i = 0
while i != len(S):
    if i%2 == 0 and S[i] == 'R' or S[i] == 'U' or S[i] == 'D':
        bool = True
        i += 1
    elif i%2 == 1 and S[i] == 'L' or S[i] == 'U' or S[i] == 'D':
        bool = True
        i += 1
    else:
        bool = False
        i = len(S)
        
if bool:
    print('Yes')
else:
    print('No')
N = input()
s = [''.join(sorted(input())) for i in range(N)]
ans=0
dict={}
for i in s:
  if i in dict:
    ans+=dict[i]
    dict[i]+=1
  else:
    dict[i]=1
print(ans)

### FIXED CODE ###

N = int(input())
s = [''.join(sorted(input())) for i in range(N)]
ans=0
dict={}
for i in s:
  if i in dict:
    ans+=dict[i]
    dict[i]+=1
  else:
    dict[i]=1
print(ans)
#! /usr/bin/env python3

# from math import gcd
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
import copy

N, M = [int(_) for _ in input().split()]
AB = [[int(_) for _ in input().split()] for i in range(M)]


goal = 1
rets = []
road = {i:[] for i in range(1, N+1)}

for A, B in AB:
    road[A] += [B]
    road[B] += [A]

ret, retind = [], []

def dfs(ind, inds, dis):

    global goal, ret, retind

    if ind == goal:
        ret += [dis]
        retind += [inds]
    
    if ind in inds:
        return

    inds += [ind]
    dis += 1
    for i in road[ind]:
        dfs(i, copy.copy(inds), dis)

for start in range(2, N+1):
    ret, retind = [], []
    dfs(start, [], 0)
    rets += [retind[ret.index(min(ret))][1]]

if not rets:
    print("No")
else:
    print("Yes")
    for i in rets:
        print(i)

### FIXED CODE ###

#! /usr/bin/env python3

# from math import gcd
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
import copy

N, M = [int(_) for _ in input().split()]
AB = [[int(_) for _ in input().split()] for i in range(M)]

graph = [[] for i in range(N)]

for A, B in AB:
    graph[A-1] += [B]
    graph[B-1] += [A]

D = deque([0])
visited = [0] * N
visited[0] = 1

ret = [0 for i in range(N)]

while D:
    v = D.popleft()
    for i in graph[v]:
        i -= 1
        if visited[i]: continue
        visited[i] = 1
        ret[i] = v + 1
        D.append(i)

if any(ret[1:]):
    print("Yes")
    for i in ret[1:]:
        print(i)
else:
    print("No")
A, B, C, D = map(int,input().split())
if A + B + C + D == 7;
  print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7;
  print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7;
  print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7;
  print('{}+{}-{}-{}=7'.format(A, B, C, D))
elif A - B + C + D == 7;
  print('{}-{}+{}+{}=7'.format(A, B, C, D))
elif A - B + C - D == 7;
  print('{}-{}+{}-{}=7'.format(A, B, C, D))
elif A - B - C + D == 7;
  print('{}-{}-{}+{}=7'.format(A, B, C, D))
elif A - B - C - D == 7;
  print('{}-{}-{}-{}=7'.format(A, B, C, D))

### FIXED CODE ###

abcd = input()
A,B,C,D = int(abcd[0]),int(abcd[1]),int(abcd[2]),int(abcd[3])    
if A + B + C + D == 7:
  print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7:
  print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7:
  print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7:
  print('{}+{}-{}-{}=7'.format(A, B, C, D))
elif A - B + C + D == 7:
  print('{}-{}+{}+{}=7'.format(A, B, C, D))
elif A - B + C - D == 7:
  print('{}-{}+{}-{}=7'.format(A, B, C, D))
elif A - B - C + D == 7:
  print('{}-{}-{}+{}=7'.format(A, B, C, D))
else:
  print('{}-{}-{}-{}=7'.format(A, B, C, D))
_=input()
X=int(eval(input().replace(*' *')))
print(X if X=<1e18 else -1)

### FIXED CODE ###

N=int(input())
X=list(map(int, input().split()))
ans=1
if 0 in X:
    print(0)
else:
    for i in range(N):
        ans *= X[i]
        if 10**18<ans:
            print(-1)
            break
    else:
        print(ans)
if '7' in n:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

def resolve():
    n = input()
    if n[0] == '7' or n[1] == '7' or n[2] == '7':
        print('Yes')
    else:
        print('No')
resolve()
import sys
N,K=map(int,sys.stdin.readline().split())
A=sorted([int(e) for e in sys.stdin.readline().split()] for _ in range(N))
x,y=zip(*A)
Y=sorted(y)
r=(x[-1]-x[0])*(Y[-1]-Y[0])
for i in range(N):
 for j in range(i+1,N):
  for k in range(N):
   for l in range(k+1,N):
    ly=Y[k];ry=Y[l];q=(x[j]-x[i])*(ry-ly)
    if r>q and K<=(j-i+1) and K<=sum(lx<=x[z]<=rx and ly<=y[z]<=ry for z in range(i,j+1)): r=q
print(r)

### FIXED CODE ###

import sys
N,K=map(int,sys.stdin.readline().split())
A=sorted([int(e) for e in sys.stdin.readline().split()] for _ in range(N))
x,y=zip(*A)
Y=sorted(y)
r=(x[-1]-x[0])*(Y[-1]-Y[0])
for i in range(N):
 for j in range(i+1,N):
  for k in range(N):
   for l in range(k+1,N):
    ly=Y[k];ry=Y[l];q=(x[j]-x[i])*(ry-ly)
    if r>q and K<=(j-i+1) and K<=sum(ly<=y[z]<=ry for z in range(i,j+1)): r=q
print(r)