Harryxun/stf_run huggingface dataset:
while True:
  for i in range(1,31):
    n=int(input())
    if n%7==0:
      print('{}'.format('thu'))
    elif n%7==1:
      print('{}'.format('fri'))
    elif n%7==2:
      print('{}'.format('sat'))
    elif n%7==3:
      print('{}'.format('san'))
    elif n%7==4:
      print('{}'.format('mon'))
    elif n%7==5:
      print('{}'.format('tue'))  
    else:
      print('{}'.format('wed'))


### FIXED CODE ###

x=int(input())
week=["thu","fri","sat","sun","mon","tue","wed"]
print(week[x%7])
import sys
def printans(t):
    print(t)
    sys.exit()

N=int(input())
A=[int(i) for i in input().split()]

if all([a==A[0] for a in A]):#全部同じ
    shurui=A[0]
    if shurui==N-1 or shurui*2<=N:
        printans("Yes")
    else:printans("No")
else:#少ないやつは自分だけの色、そいつら以外で上と同じ処理
    maxshurui = max(A)
    if all([a in (maxshurui,maxshurui-1)]):
        unique = A.count(maxshurui-1)
        shurui = maxshurui-unique
        if shurui<=0:
            printans("No")
        if shurui*2<=N-unique:
            printans("Yes")
        else:printans("No")

### FIXED CODE ###

import sys
def printans(t):
    print(t)
    sys.exit()

N=int(input())
A=[int(i) for i in input().split()]

if all([a==A[0] for a in A]):#全部同じ
    shurui=A[0]
    if shurui==N-1 or shurui*2<=N:
        printans("Yes")
    else:printans("No")
else:#少ないやつは自分だけの色、そいつら以外で上と同じ処理
    maxshurui = max(A)
    if all([a in (maxshurui,maxshurui-1) for a in A]):
        unique = A.count(maxshurui-1)
        shurui = maxshurui-unique
        if shurui<=0:
            printans("No")
        if shurui*2<=N-unique:
            printans("Yes")
        else:printans("No")
    else:printans("No")
k = 1
ans = 0
 
if b == 1:
  print(0)
else:
  while k<b:
    k += a-1
    ans += 1
  print(ans)

### FIXED CODE ###

a, b = map(int, input().split())
 
k = 1
ans = 0
 
if b == 1:
  print(0)
else:
  while k<b:
    k += a-1
    ans += 1
  print(ans)
from functools import reduce
from itertools import combinations
from fractions import gcd

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

def get_gcd(number_list):
    return reduce(gcd, number_list)

def L_gcd(i):
    if i == -1:
        return 0
    else:
        return gcd(A[i - 1], L_gcd(i - 1))
        
def R_gcd(i):
    if i == N:
        return 0
    else:
        return gcd(A[i], R_gcd(i + 1))


gcd_list = []
for i in range(N):
    Left = L_gcd(i)
    Right = R_gcd(i)
    gcd_list.append(gcd(Left, Right))


print(int(max(gcd_list)))

### FIXED CODE ###

from functools import reduce
from itertools import combinations
from fractions import gcd

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


Left = [0] * (N + 1)
Right = [0] * (N + 1)

for i in range(N):
    Left[i + 1] = gcd(Left[i], A[i])
    Right[N - i - 1] = gcd(Right[N - i], A[N - i - 1])
ans = 0
for i in range(N):
    ans = max(ans, gcd(Left[i], Right[i + 1]))
    
print(ans)
N = int(input())
count = 0
ans = 0
lis = [0]*N

for i in range(N):
  s = input()
  for j in range(10):
    count += ord(s[j])
  lis[i] += count
  count = 0

dic = collections.Counter(lis)
newlis = list(dic.values())

for i in newlis:
  ans += i*(i-1)/2

print(int(ans))

### FIXED CODE ###

from collections import defaultdict

N = int(input())
S = defaultdict(int)

for i in range(N):
  s = sorted(input())
  w = "".join(s)
  S[w] += 1

ans = sum([(i*(i-1))//2 for i in list(S.values())])

print(ans)
print(int(raw_input())**3)

### FIXED CODE ###

print(int(raw_input())**3)
import numpy as np

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




S=[0]*(N+1)
for i in range(N):
    S[i+1]=(A[i]+S[i])%M


def tr(k):
    return k*(k-1)//2


countlist=np.zeros(M)
check=set()


for i in range(1,N+1):
    countlist[S[i]]+=1
    check=check|{S[i]}
    
    





ANS=int(countlist[0])



for i in check:
    ANS+=tr(int(countlist[i]))



print(ANS)






### FIXED CODE ###

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

S=[0]*(N+1)
for i in range(N):
    S[i+1]=(A[i]+S[i])%M


def tr(k):
    return k*(k-1)//2


countlist=dict()
check=set()


for i in range(1,N+1):
    countlist[S[i]]=countlist.get(S[i],0)+1

    
    


ANS=countlist.get(0,0)

for i in countlist.keys():
    ANS+=tr(countlist[i])



print(ANS)
import math

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

def lcm(A, B):
    return (A * B) // math.gcd(A, B)

print(lcm(a, b))

### FIXED CODE ###

from fractions import gcd 

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

def lcm(A, B):
    return (A * B) // gcd(A, B)

print(lcm(A, B))
A, B = map(int,input().split())

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)
  
def Eratosthenes(n):
    if n == 1:
      return [1]
    if n == 2:
      return [1, 2]
    dp = [False]*n
    dp[0] = dp[1] = True
    prime = []
    l = [1]
    for i in range(2, n):
        if dp[i]:
            continue
        prime.append(i)
        if n%i==0:
          l.append(i)
        for j in range(i*2, n, i):
            dp[j] = True
            i += 1
    return l
  
print(len(Eratosthenes(gcd(A,B))))

### FIXED CODE ###

A, B = map(int,input().split())
def factorization(n):
    if n == 1:
      return [1]
    elif n == 2:
      return [1, 2]
    arr = [1]
    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)
    if temp!=1:
        arr.append(temp)
    if arr==[]:
        arr.append(n)
    return arr
print(len(set(factorization(A))&set(factorization(B))))
import copy
import collections


def score(list):
    tl, dl = zip(*list)
    t_s = len(set(tl)) ** 2
    d_s = sum(dl)
    return t_s + d_s


def r(n, k, sl):
    
    tl, dl = zip(*sl)
    ztd = collections.Counter(tl)
    for _ in range(len(sl) - k):
        d_idx = dl.index(min(dl))
        tlv = tl[d_idx]
        if ztd[tlv] >= 2:
            del sl[d_idx]
        else:
            break

    for _ in range(len(sl) - k):

        ckl = {}
        for v in sl:
            if v[0] in ckl:
                if ckl[v[0]][1] > v[1]:
                    ckl[v[0]] = v
            else:
                ckl[v[0]] = v

        s_c = 0
        dtl = []
        for delckl in ckl.values():
            c_sl = copy.copy(sl)
            del c_sl[c_sl.index(delckl)]
            soe = score(c_sl)
            if s_c < soe:
                s_c = soe
                dtl = delckl

        del sl[sl.index(dtl)]

    return score(sl)


def main():
    n, k = list(map(int, input().split()))
    sl = [list(map(int, input().split())) for i in range(n)]
    print(r(n, k, sl))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

def r(n, k, sl):

    sl.sort(key=lambda x: -x[1])

    gmk = set()
    gop = 0
    ce = []
    for ti, di in sl[:k]:
        if ti in gmk:
            ce.append(di)
        gmk.add(ti)
        gop += di

    gscr = len(gmk)**2 + gop

    for ti, di in sl[k:]:
        if 0 >= len(ce):
            break
        if ti in gmk:
            continue
        gmk.add(ti)
        odi = ce.pop()
        gop = gop - odi + di
        nscr = len(gmk)**2 + gop
        gscr = max(gscr, nscr)

    return gscr


def main():
    input = sys.stdin.readline
    n, k = list(map(int, input().split()))
    sl = [tuple(map(int, input().split())) for _ in range(n)]
    print(r(n, k, sl))


if __name__ == '__main__':
    main()
def binaryinsertion(A,x):
    left=0;right=len(A)-1;centre = 1 + len(A)//2
    while(True):
        if(right - left < 2):
            if(x[0]<A[left][0]):A.insert(left,x)
            else :
                if(x[0]<A[right][0]):A.insert(right,x)
                else:A.insert(right+1,x)
            break
        else:
            if(x[0] < A[centre][0]) :
                right = centre - 1
            elif(A[centre][0] < x[0]) :
                left = centre + 1
            else : 
                A.insert(centre,x)
                break
            centre = left + (right-left)//2

[N,L] = [int(x) for x in input().split()]
A = [[int(x),int(i)] for i,x in enumerate(input().split())]
sweep = A[:L]
sweep = sorted(sweep)
ans = [str(sweep[0][0])]
for i in range(L,N) :
    sweep.remove(A[i-L])
    binaryinsertion(sweep,A[i])
    ans.append(str(sweep[0][0]))
print(" ".join(ans))

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import deque
from copy import deepcopy
def main():
    n, *a = map(int, read().split())
    if n == 2:
        if a[0] == a[1]:
            print(0)
            sys.exit()
        elif max(a) % min(a) == 0:
            print(0)
            sys.exit()
        else:
            print(2)
            sys.exit()
    a.sort()
    notdiv = [True] * n
    for i1, ae in enumerate(a):
        if notdiv[i1]:
            for i2, ae2 in enumerate(a[i1+1:]):
                if notdiv[i1 + i2 + 1]:
                    notdiv[i1 + i2 + 1] = ae2 % ae != 0
    if a[0] == a[1]:
        notdiv[0] = False
    if a[-1] == a[-2]:
        notdiv[-1] = False
    for j1 in range(1, n - 1):
        if a[j1-1] == a[j1] or a[j1] == a[j1+1]:
            notdiv[j1] = False
    r = sum(notdiv)
    print(r)
if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())
    a = list(map(int, input().split()))

    a.sort()
    tf = [0] * (a[-1] + 1)
    for ea in a:
        tf[ea] = 1
    for i1 in range(n - 1):
        if a[i1] == a[i1 + 1]:
            tf[a[i1]] = 0

        for i2 in range(2, a[-1]//a[i1] + 1):
            tf[a[i1] * i2] = 0
    r = sum(tf)
    print(r)


if __name__ == '__main__':
    main()
print("AB" + ("C" if int(input()) <= 999 else "D"))

### FIXED CODE ###

flag = input()

print(1 * flag.count("+") + -1 * flag.count("-"))
import queue
N,M = map(int,input().split())
tree = [[] for _ in range(M+1)]
for i in range(M):
    a,b = map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)

que = queue.Queue()
que.put(1)

result = [-1]*(N+1)
while(True):
    if que.empty():
        break
    start = que.get()
    for i in tree[start]:
        if result[i] == -1:
            result[i] = start
            que.put(i)

if -1 in result[2:]:
    print("No")
else:
    print("Yes")
    for i in range(2,N+1):
        print(result[i])






### FIXED CODE ###

import queue
N,M = map(int,input().split())
tree = [[] for _ in range(N+1)]
for i in range(M):
    a,b = map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)

que = queue.Queue()
que.put(1)
result = [-1]*(N+1)
result[1] = 0
while(True):
    if que.empty():
        break
    start = que.get()
    for i in tree[start]:
        if result[i] == -1:
            result[i] = start
            que.put(i)

if -1 in result[2:]:
    print("No")
else:
    print("Yes")
    for i in result[2:]:
        print(i)
import sys
from collections import *

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

if not n:
    print(0)
    sys.exit()

n1 = Counter(v[::2])
n2 = Counter(v[1::2])

max1 = 0

n1 = sorted([(count, k) for k, count in n1.items()], reverse=True)
n2 = sorted([(count, k) for k, count in n2.items()], reverse=True)

if n1[0][1] == n2[0][1]:
    if len(n1) == 1 and len(n2) == 1:
        print(n//2)
        sys.exit()
    if len(n1) == 1 or n1[0][0] > n2[0][0]:
        print(n - n1[0][0] - n2[1][0])
        sys.exit()
    if len(n2) == 1 or n1[0][0] < n2[0][0]:
        print(n - n1[1][0] - n2[0][0])
        sys.exit()
    if n1[0][0] == n2[0][0]:
        if n1[1][0] >= n2[1][0]:
            print(n - n1[1][0] - n2[0][0])
        elif n1[1][0] < n2[1][0]:
            print(n - n1[0][0] - n2[1][0])
        sys.exit()

count = n1 - n1[0][0] - n2[0][0]
print(count)


### FIXED CODE ###


import sys
from collections import *

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

if not n:
    print(0)
    sys.exit()

n1 = Counter(v[::2])
n2 = Counter(v[1::2])

max1 = 0

n1 = sorted([(count, k) for k, count in n1.items()], reverse=True)
n2 = sorted([(count, k) for k, count in n2.items()], reverse=True)

if n1[0][1] == n2[0][1]:
    if len(n1) == 1 and len(n2) == 1:
        print(n//2)
        sys.exit()
    if len(n1) == 1 or n1[0][0] > n2[0][0]:
        print(n - n1[0][0] - n2[1][0])
        sys.exit()
    if len(n2) == 1 or n1[0][0] < n2[0][0]:
        print(n - n1[1][0] - n2[0][0])
        sys.exit()
    if n1[0][0] == n2[0][0]:
        if n1[1][0] >= n2[1][0]:
            print(n - n1[1][0] - n2[0][0])
        elif n1[1][0] < n2[1][0]:
            print(n - n1[0][0] - n2[1][0])
        sys.exit()

count = n - n1[0][0] - n2[0][0]
print(count)
import numpy as np

N=int(input())
A=np.ones(N)
a=np.ones(N)

A=map(int,input().rstrip().split())


a=sorted(A,reverse=True)

a_product=1
flag_1e18=False
flag_0=False

if a[N-1]==0:
  flag_0=True

for i in range(0,N,1):
  a_product=a_product*a[i]
  if a_product>1e18:
    flag_1e18=True
  else:
    continue
    
if flag_1e18==True and flag_0==False:
  print(-1)
elif flag_0==True:
  print(0)
else:
  print(A_product)
  


### FIXED CODE ###

import numpy as np

N=int(input())
A=np.ones(N)
a=np.ones(N)

A=map(int,input().rstrip().split())


a=sorted(A,reverse=True)

a_product=1
flag_1e18=False
flag_0=False

if a[N-1]==0:
  flag_0=True

for i in range(0,N,1):
  a_product=a_product*a[i]
  if a_product>1e18:
    flag_1e18=True
    break
  else:
    continue
    
if flag_1e18==True and flag_0==False:
  print(-1)
elif flag_0==True:
  print(0)
else:
  print(a_product)
def func(n):
    if n < 2:
        return 1
    else:
        return n * func(n - 2)

N = int(input())

count5 = 0
count2 = 0
A = func(N)
B = func(N)
while True:
    if A % 5 == 0:
        A = int(A / 5)
        count5 += 1
    else:
        break

while True:
    if B % 2 == 0:
        B = int(B / 2)
        if count2 >= count5:
            break
        count2 += 1
    else:
        break

if count5 <= count2:
    ans = count5
else:
    ans = count2

print(ans)

### FIXED CODE ###

n = int(input())

def g1(n, p):
    if n == 0:
        return 0
    else:
        return n // p + g1(n // p, p)

def g2(n, p):
    res = 0
    if n % 2 == 1:
        return g1(n, p) - g2(n - 1, p)
    else:
        res = g1(n // 2, p)
        if p == 2:
            res += n // 2
        return res


ans = min(g2(n, 2), g2(n, 5))
print(ans)
# -*- coding: utf-8 -*-
n, x, y = map(int, input().split())
x -= 1
y -= 1
ans = [0]*n
for i in range(n):
    for j in range(i + 1, n):
        dist1 = j - i
        dist2 = abs(X - i) + abs(Y - j) + 1
        ans[min(dis1, dist2)] += 1
print(*ans[1:], sep='\n')


### FIXED CODE ###

# -*- coding: utf-8 -*-
n, x, y = map(int, input().split())
x -= 1
y -= 1
ans = [0]*n
for i in range(n):
    for j in range(i + 1, n):
        dist1 = j - i
        dist2 = abs(x - i) + abs(y - j) + 1
        ans[min(dist1, dist2)] += 1
print(*ans[1:], sep='\n')
n=int(input())
d=list(map(int,input().split()))
d.sort()
e=d[n//2]
f=d[n//2+1]
print(f-e)

### FIXED CODE ###

n=int(input())
d=list(map(int,input().split()))
d.sort()
e=d[n//2-1]
f=d[n//2]
print(f-e)
a, b, c = map(int, input().split())
if a < b:
 if b < c:
  print "Yes"
else:
 print "No"

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
if a < b and b < c:
 print "Yes"
else:
 print "No"
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import heapq
import fractions


def cmb(n, r):
    if n - r < r:
        r = n - r
    if r == 0:
        return 1
    if r == 1:
        return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

N = int(input())
s = []
n = 0
for i in range(N):
    s.append(list(input()))
ans = 0


for i in range(N):
    s[i]=set(s[i])
    s[i].sort()
s.sort()

for i in range(1,N):

    if s[i]==s[i-1]:
        n += 1
        if i == N-1:
            ans += cmb(n+1, 2)
    else:
        if n > 0:
            ans += cmb(n+1,2)
            n = 0
print(ans)


### FIXED CODE ###

#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import heapq
import fractions


def cmb(n, r):
    if n - r < r:
        r = n - r
    if r == 0:
        return 1
    if r == 1:
        return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

N = int(input())
s = []
n = 0
for i in range(N):
    s.append(list(input()))
ans = 0


for i in range(N):
    s[i].sort()
s.sort()

for i in range(1,N):

    if s[i]==s[i-1]:
        n += 1
        if i == N-1:
            ans += cmb(n+1, 2)
    else:
        if n > 0:
            ans += cmb(n+1,2)
            n = 0
print(ans)
S=input()
n=0
#print(S)
while S[:]!=S[:n]:
    if S[n:n+5]=="dream" or S[n:n+8]=="dreamera":
        n+=5 #dream
    elif S[n:n+7]=="dreamer" and S[n+7]!="a":
        n+=7 #dreamer
    elif S[n:n+5]=="erase" and S[n+6]!="eraser":
        n+=5 #erase
    elif S[n:n+6]=="eraser" and S[n+6]!="a":
        n+=6 #eraser
    #elif S[:]==S[:n-1]:
        #print("YES")
        #exit()
    else:
        print("NO")
        exit()
else:
    print("YES")

### FIXED CODE ###

S=input()
n=0
#print(S)
while S[:]!=S[:n]:
    if S[n:n+7]=="dreamer" and S[n:n+8]!="dreamera":
        n+=7 #dreamer
    elif S[n:n+5]=="dream":
        n+=5 #dream
    elif S[n:n+5]=="erase" and S[n:n+6]!="eraser":
        n+=5 #erase
    elif S[n:n+6]=="eraser":
        n+=6 #eraser
    #elif S[:]==S[:n-1]:
        #print("YES")
        #exit()
    else:
        print("NO")
        exit()
else:
    print("YES")
import sys
s = sys.stdin.readline()
i = 0
l = len(s)
flag = True
while flag:
  if s[i] != s[l-1]:
    flag = False
  i += 1
  l -= 1
l = len(s)
a = s[0:(l-1)/2 - 1]
i = 0
l = len(a)
while flag:
  if a[i] != a[l-1]:
    flag = False
  i += 1
  l -= 1
b = s[(len(s) + 3)/2 - 1: -1]
i = 0
l = len(b)
while flag:
  if b[i] != b[l-1]:
    flag = False
  i += 1
  l -= 1
if flag:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import sys
s = sys.stdin.readline().rstrip()
i = 0
l = len(s)
flag = True
while flag and i <= l:
  if s[i] != s[l-1]:
    flag = False
  i += 1
  l -= 1
l = len(s)
a = s[0:-(-(l-1)//2)]
i = 0
l = len(a)
while flag and i <= l:
  if a[i] != a[l-1]:
    flag = False
  i += 1
  l -= 1
b = s[(len(s) + 3)//2 - 1:]
i = 0
l = len(b)
while flag and i <= l:
  if b[i] != b[l-1]:
    flag = False
  i += 1
  l -= 1
if flag:
  print('Yes')
else:
  print('No')
day1 = map(int, input().split())
day2 = map(int, input().split())

if day2[1] == 1:
    print("1")
else:
    print("0")

### FIXED CODE ###

day1 = list(map(int, input().split()))
day2 = list(map(int, input().split()))

if day2[1] == 1:
    print("1")
else:
    print("0")
s = input()
a, b, c = [int(x) for x in s.split(' ')]
if a+b < c:
    return 'No'
else:
    return 'Yes'

### FIXED CODE ###

s = input()
a, b, c = [int(x) for x in s.split(' ')]
if a+b < c:
    print('No')
else:
    print('Yes')
A,B= input().split()
A = int(A)
B2 = B*1000
#print(A*B*100000)
print(int(A*B2/1000))

### FIXED CODE ###

#C - Multiplication 3
from decimal import Decimal
A,B= map(str,input().split())
A2 = Decimal(A)
B2 = Decimal(B)
#print(A*B*100000)
print(int(A2*B2))
import math
import itertools

n = int(input())

vectors = dict()
for i in range(n):
    a, b = map(int, input().split())
    gcd = math.gcd(a, b)

    key = (0, 0)
    if a * b < 0:
        key = (abs(b) // gcd, abs(a) // gcd)
        if key not in vectors:
            vectors[key] = (0, 1)
        else:
            vectors[key] = (vectors[key][0], vectors[key][1]+1)
    else:
        key = (abs(a) // gcd, abs(b) // gcd)
        if key not in vectors:
            vectors[key] = (1, 0)
        else:
            vectors[key] = (vectors[key][0]+1, vectors[key][1])


mod = 1000000007
# total = (pow(2, len(vectors)) - 1) % mod

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

total = 1
for vec in vectors.values():

    total *= (1 + (2**(vec[0])-1 if vec[0] > 0 else 0)
              + (2**(vec[1])-1 if vec[1] > 0 else 0)) % mod

print(total- 1)

### FIXED CODE ###

import math
import itertools

n = int(input())
mod = 1000000007

def Sign(n):
    if n > 0:
        return 1
    elif n < 0:
        return -1
    else:
        return 0

allZeros = 0
vectors = dict()


def add_positive(_):
    if _ not in vectors:
        vectors[_] = (1, 0)
    else:
        vectors[_] = (vectors[_][0] + 1, vectors[_][1])


def add_negative(_):
    if _ not in vectors:
        vectors[_] = (0, 1)
    else:
        vectors[_] = (vectors[_][0], vectors[_][1] + 1)


for i in range(n):
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        allZeros += 1
        continue
    gcd = math.gcd(a, b)

    key = (0, 0)
    if a == 0:
        key = (1, 0)
        add_negative(key)
    elif b == 0:
        key = (1, 0)
        add_positive(key)

    elif Sign(a) * Sign(b) > 0:
        key = (abs(a) // gcd, abs(b) // gcd)
        add_positive(key)
    else:
        key = (abs(b) // gcd, abs(a) // gcd)
        add_negative(key)

total = 1
for vec in vectors.values():

    total *= ((2**(vec[0]))
              + (2**(vec[1])) - 1) % mod

print(((total- 1) % mod + allZeros % mod) % mod)
r = input().split()
max_i= max(r)
min_i= min(r)
print(max_i - min_i)

### FIXED CODE ###

n = input()
r = input().split()
r =list(map(int,r))
max_i= max(r)
min_i= min(r)
print(max_i - min_i)
while True:
 a, op, b = input().split()
 a = int(a)
 b = int(b)

 if op == '?':
  break
 if op == '+':
  ans = a + b
 elif op == '-':
  ans = a-b
 elif op == '*':
  ans = a*b
 else op == '/':
  ans = a/b

 print(ans)


### FIXED CODE ###

while True:
 a, op, b = input().split()
 a = int(a)
 b = int(b)

 if op == '?':
  break

 if op == '+':
  ans = a+b
 elif op == '-':
  ans = a-b
 elif op == '*':
  ans = a*b
 else:
  ans = a/b

 print('%d' %(ans))
W,H,x,y ==map(int ,raw_input().split())
i = 0
if x*2 == W and y +2 ==H:
    i = 1
print float(W*H)/2,i

### FIXED CODE ###

W,H,x,y =map(int ,raw_input().split())
i = 0
if x*2 == W and y*2 ==H:
    i = 1
print float(W*H)/2,i
import numpy as np

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

b=np.array([int, input().split()])
count=0
for _ in range(M):
    a=np.array([map(int, input().split())])
    e=a*b
    d=np.sum(e,axis=0)+C
    if d>0:
        count+=1
print(count)

### FIXED CODE ###

import numpy as np

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

b=list(map(int, input().split()))
b=np.array(b)
count=0
for _ in range(N):
    a=list(map(int, input().split()))
    a=np.array(a)
    e=a*b
    d=np.sum(e,axis=0)+C
    if d>0:
        count+=1
print(count)