Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
A, B = list(zip(*[list(map(int, input().split())) for _ in range(M)]))

G = []
m = {}
for a, b in zip(A, B):
    if a not in m and b not in m:
        G.append({a, b})
        m[a] = len(G) - 1
        m[b] = len(G) - 1
    elif a in m:
        gid = m[a]
        G[gid].add(b)
        m[b] = gid
    elif b in m:
        gid = m[b]
        G[gid].add(a)
        m[a] = gid

if M == 0:
    print(1)
else:
    print(max(len(g) for g in G))


### FIXED CODE ###

class UnionFind:

    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {root: self.members(root) for root in self.roots()}

    def __str__(self):
        return '\n'.join(f'{root}: {self.members(root)}' for root in self.roots())


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

uf = UnionFind(N)
for _ in range(M):
    a, b = map(int, input().split())
    uf.union(a - 1, b - 1)

print(max(uf.size(i) for i in range(N)))
s = list(input())
if s[0] = "R":
  print("Sunny")
elif s[0] = "S":
  print("Cloudy")
else:
  print("Rainy")

### FIXED CODE ###

s = list(input())
if s[0] == "R":
  print("Sunny")
elif s[0] == "S":
  print("Cloudy")
else:
  print("Rainy")
a, b=map(int,imput().split())
if(a<b):
  print("a<b")
elif(a>b):
  print("a>b")
else:
  print("a=b")

### FIXED CODE ###

a, b=map(int,input().split())
if a<b:
 print("a < b")
elif a>b:
 print("a > b")
elif a==b:
 print("a == b")
else:
 pass
n=int(input())
n=list(map(int,input().split()))
count=0
while True:
  for i in range(n):
    if n[i]%2!=0:
      print(count)
      exit()
    n[i]//2
  count+=1
print(count)



### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
count=0
while True:
  for i in range(n):
    if a[i]%2!=0:
      print(count)
      exit()
    else:
      a[i]//=2
  count+=1
print(count)
i=list(map(int,input(),split()))
a=i[0]*i[1]
if a%2==0:
  print("Evwn")
else:
  print("Odd")

### FIXED CODE ###

i=list(map(int,input().split()))
a=i[0]*i[1]
if a%2==0:
  print("Even")
else:
  print("Odd")
s = input()

P = 0
for c in s:
  if c == 'p':
    P += 1

print(N//2 - P)

### FIXED CODE ###

s = input()

P = 0
for c in s:
  if c == 'p':
    P += 1

print(len(s)//2 - P)
N, L= map(int,input().split())
alldata = sorted([input() for i in range(N)])
print("".join(data))


### FIXED CODE ###

N, L= map(int,input().split())
data = sorted([input() for i in range(N)])
print("".join(data))
from networkx import*
N,*t=map(str.split,open(0))
s=shortest_path_length
x=s(G:=Graph(t),'1')
y=s(G,N)
print('FSennunkeec'[sum(x[k]>y[k]for k in x)*2>=int(*N)::2])

### FIXED CODE ###

from collections import*
input=open(0).readline
n=int(input())
e=[[]for _ in range(n)]
for _ in range(n-1):
    a,b=map(int,input().split())
    e[a-1].append(b-1)
    e[b-1].append(a-1)
f=[0]*n
v=[1]+[0]*~-n
q=deque([(0,0)])
while q:
    t,c=q.pop()
    v[t]=1
    f[t]=c
    for i in e[t]:
        if not v[i]:
            q.append((i,c+1))
s=[0]*n
v=[0]*~-n+[1]
q=deque([(n-1,0)])
while q:
    t,c=q.pop()
    v[t]=1
    s[t]=c
    for i in e[t]:
        if not v[i]:
            q.append((i,c+1))
a=b=0
for i,j in zip(f,s):
    if i<=j:
        a+=1
    else:
        b+=1
if a>b:
    print('Fennec')
else:
    print('Snuke')
c = a*b
if c%2 == 0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a,b = map(int,input().split())
c = a*b
if c % 2 ==0:
  print("Even")
else:
  print("Odd")
N = input()

N = N.splitlines()

N_num = int(N[0])

AC_num = 0
WA_num = 0
TLE_num = 0
RE_num = 0

for i in range(N_num):
    
    
    if 'AC' == N[i+1]:
        AC_num += 1
        
    
    elif 'WA' == N[i+1]:
        WA_num += 1
        

    elif 'TLE' == N[i+1]:
        TLE_num += 1
        
    
    elif 'RE' == N[i+1]:
        RE_num += 1
        


print('AC x {}'.format(AC_num))
print('WA x {}'.format(WA_num))
print('TLE x {}'.format(TLE_num))
print('RE x {}'.format(RE_num))

### FIXED CODE ###

N_num = int(input())

N = []

for i in range(N_num):
    N.append(input())
    

AC_num = 0
WA_num = 0
TLE_num = 0
RE_num = 0

for i in range(N_num):
    #print(i+1)
    
    if 'AC' == N[i]:
        AC_num += 1
        #print(AC_num)
    
    elif 'WA' == N[i]:
        WA_num += 1
        #print(WA_num)

    elif 'TLE' == N[i]:
        TLE_num += 1
        #print(TLE_num)
    
    elif 'RE' == N[i]:
        RE_num += 1
        #print(RE_num)


print('AC x {}'.format(AC_num))
print('WA x {}'.format(WA_num))
print('TLE x {}'.format(TLE_num))
print('RE x {}'.format(RE_num))
n = int(input())
a = [int(input()) for i in range(n)]

ans = 0
max_a = max(a)
b = [0]*(max_a + 2)

for i in a:
    b[i] += 1

for i in b:
    if i % 2 != 0:
        ans += 1

print(ans)

### FIXED CODE ###

n = int(input())

myset = set()
for i in range(n):
    a = int(input())
    if a in myset:
        myset.remove(a)
    else:
        myset.add(a)
ans = len(myset)

print(ans)
N, P = map(int, input().split())

if N == 1:
    print(P)
else:
    prime = [0] * (10**6+1)
    index = 2
    tmp = 0
    while P > 1:
        if P % index == 0:
            tmp += 1
            P //= index
            if P == 1:
                prime[index] = tmp
        else:
            prime[index] = tmp
            tmp = 0
            if index == 2:
                index += 1
            else:
                index += 2
    
    
    if prime[2] >= N:
        ans = 2
    else:
        ans = 1
    for i in range(3, 10**6+1, 2):
        if prime[i] >= N:
            ans *= i
    
    print(ans)

### FIXED CODE ###

N, P = map(int, input().split())

if N == 1:
    print(P)
else:
    prime = [0] * (10**6+1)
    index = 2
    tmp = 0
    while P > 1 and index < 10**6+1:
        if P % index == 0:
            tmp += 1
            P //= index
            if P == 1:
                prime[index] = tmp
        else:
            prime[index] = tmp
            tmp = 0
            if index == 2:
                index += 1
            else:
                index += 2
    
    
    if prime[2] >= N:
        ans = 2 ** (prime[2]//N)
    else:
        ans = 1
    for i in range(3, 10**6+1, 2):
        ans *= max(1, i ** (prime[i]//N))
    
    print(ans)
n = int(input())
for i range(10):
    num = n % i
    if num != 0:
        print('No')
else:
    print('Yes')


### FIXED CODE ###

n = int(input())
for i in range(1, 10):
    if n % i ==0 and n/i <10:
        print('Yes')
        break
else:
    print('No')
a = [int(i) for i in list(input())]
enzan = ['+', '+', '+']
res = 0
for i in range(2):
	if i == 0:
		enzan[0] = '+'
		b = a[0] + a[1]
	else:
		enzan[0] = '-'
		b = a[0] - a[1]
	for j in range(2):
		if j == 0:
			enzan[1] = '+'
			c = b + a[2]
		else:
			enzan[1] = '-'
			c = b - a[2]
		for k in range(2):
			if k == 0:
				enzan[2] = '+'
				d = c + a[3]
			else:
				enzan[2] = '-'
				d = b - a[3]
			if d1 == 7:
				print(str(a[0])+enzan[0]+str(a[1])+enzan[1]+str(a[2])+enzan[2]+str(a[3])+'=7')

### FIXED CODE ###

a = list(input())
if ((a[0] == a[1]) and (a[1] == a[2])) or ((a[1] == a[2]) and (a[2] == a[3])):
	print("Yes")
else:
	print("No")
s,t=map(input().split())
a,b=map(int,input().split())
c=input()
d=""
if s==c:
  print("{}""{}""{}".format(a-1,d,b))
else:
  print("{}""{}""{}".format(a,d,b-1))

### FIXED CODE ###

s,t=input().split()
a,b=map(int,input().split())
c=input()
d=" "
if s==c:
  print("{}""{}""{}".format(a-1,d,b))
else:
  print("{}""{}""{}".format(a,d,b-1))
s = input()
l = len(s)
if(s[l - 1]) == 's':
	l.append(es)
else:
 	l.append(s)
print(s)

### FIXED CODE ###

s = input()
if s[-1] == "s":
	s += "es"
else:
 	s += "s"
print(s)
#dame datta...
from scipy.sparse.csgraph import floyd_warshall, csgraph_from_dense
def main():
    N, M, L = map(int, input().split())
    l = [[-1] * N for _ in range(N)]
    for _ in range(M):
        a, b, c = map(int, input().split())
        if c > L:
            continue
        l[a-1][b-1] = c
        l[b-1][a-1] = c
    G = csgraph_from_dense(l, null_value=-1)
    d = floyd_warshall(G)
    l = [[-1] * N for _ in range(N)]
    for i in range(N):
        for j in range(N):
            if d[i][j] <= L:
                l[i][j] = 1
    G = csgraph_from_dense(l, null_value=-1)
    d = floyd_warshall(G)
    Q = int(input())
    for _ in range(Q):
        s, t = map(int, input().split())
        s -= 1
        t -= 1
        x = d[s][t]
        if x != float('inf'):
            print(int(x)-1)
        else:
            print(-1)
main()


### FIXED CODE ###

#dame datta...
from scipy.sparse.csgraph import floyd_warshall
from scipy.sparse import csr_matrix
def main():
    N, M, L = map(int, input().split())
    l = [[0] * N for _ in range(N)]
    for _ in range(M):
        a, b, c = map(int, input().split())
        if c > L:
            continue
        l[a-1][b-1] = c
        l[b-1][a-1] = c
    G = csr_matrix(l)
    d = floyd_warshall(G)
    l = [[0] * N for _ in range(N)]
    for i in range(N):
        for j in range(N):
            if d[i][j] <= L:
                l[i][j] = 1
    G = csr_matrix(l)
    d = floyd_warshall(G)
    Q = int(input())
    for _ in range(Q):
        s, t = map(int, input().split())
        s -= 1
        t -= 1
        x = d[s][t]
        if x != float('inf'):
            print(int(x)-1)
        else:
            print(-1)
main()
input_line = list(map(int, input().split()))
a = input_line[0]
b = input_line[1]

x = b - a

for i in range(1, x):
    x += i;
print(x-b)
    

### FIXED CODE ###

# coding: utf-8
# Your code here!

input_line = int(input())

if input_line < 1000:
    print("ABC")
else:
    print("ABD")
if eval('1') == 1:
 raise Exception("a")
print("b")

### FIXED CODE ###

import re

p = 0
class N(int):
    def __add__(self,n):
        return N((int(self) + int(n)) % p)
    def __sub__(self,n):
        return N((int(self) - int(n)) % p)
    def __mul__(self,n):
        return N((int(self) * int(n)) % p)
    def __floordiv__(self,n):
        if not n:
            raise ZeroDivisionError
        return self*pow(int(n),p-2,p)

while True:
    s = input()
    p,s = s.split(':')
    p = int(p)
    if not p:
        break
    s = s.replace(' ','')
    try:
        n = eval(re.sub(r'(\d+)',r'N(\1)',s).replace('/','//'))
        print('%s = %s (mod %s)'%(s,n,p))
    except ZeroDivisionError:
        print('NG')
n,m = map(int,input().split())
nm = ['#'] * n
nm.insert(0,0)
nm.insert(n+1,0)
nm = [nm]*m
nm.insert(0,[0]*(m+2))
nm.insert(m+1,[0]*(m+2))
total = []
ans = 0

for i in range(1,m+1):
    for j in range(1,n+1):
        cnt = 0
        if nm[i+1][j+1] == '#':
            cnt += 1
        if nm[i+1][j] == '#':
            cnt += 1
        if nm[i+1][j-1] == '#':
            cnt += 1
        if nm[i][j+1] == '#':
            cnt += 1
        if nm[i][j] == '#':
            cnt += 1
        if nm[i][j-1] == '#':
            cnt += 1
        if nm[i-1][j+1] == '#':
            cnt += 1
        if nm[i-1][j] == '#':
            cnt += 1
        if nm[i-1][j-1] == '#':
            cnt += 1
        total.append(cnt)

for i in range(n*m):
    if total[i] % 2 != 0:
        ans += 1

print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
print(abs((n-2)*(m-2)))
import math

a =  int(input())
b =  int(input())
c =  int(input())
d =  int(input())
e =  int(input())
x = []
s = 0

if a % 10 != 0:
  x.append(a % 10)
  if min(x) == a % 10:
      s = math.ceil(a/10)*10

if b % 10 != 0:
  x.append(b % 10)
  if min(x) == b % 10:
      s = math.ceil(b/10)*10

if c % 10 != 0:
  x.append(c % 10)
  if min(x) == c % 10:
      s = math.ceil(c/10)*10


if d % 10 != 0:
  x.append(d % 10)
  if min(x) == d % 10:
      s = math.ceil(d/10)*10


if e % 10 != 0:
  x.append(e % 10)
  if min(x) == e % 10:
      s = math.ceil(e/10)*10

s = 0

if min(x) !=0:
  s = 10

print(math.ceil(a/10)*10 +  math.ceil(b/10)*10 +  math.ceil(c/10)*10 +  math.ceil(d/10)*10 +  math.ceil(e/10)*10 + min(x) -s )




### FIXED CODE ###

import math
import numpy as np

a =  int(input())
b =  int(input())
c =  int(input())
d =  int(input())
e =  int(input())
x = []
s = 0

if a % 10 != 0:
  x.append(a % 10)

if b % 10 != 0:
  x.append(b % 10)

if c % 10 != 0:
  x.append(c % 10)


if d % 10 != 0:
  x.append(d % 10)


if e % 10 != 0:
  x.append(e % 10)

s = 0

if len(x) != 0:
  if np.amin(x) !=0:
    s = 10
  y = np.amin(x)
else:
  s = 0
  y = 0

print(math.ceil(a/10)*10 +  math.ceil(b/10)*10 +  math.ceil(c/10)*10 +  math.ceil(d/10)*10 +  math.ceil(e/10)*10 +  y -s )
N,K=map(int, input().split())

num = 1

if N<K:
  print(num)
else:
  N // K = N
  num = num + 1

  


### FIXED CODE ###

N,K=map(int, input().split())

num = 1

while N >= K:
  N = N//K 
  num = num + 1
  
print(num)
n, m = map(int, input().split())
A = sorted(list(map(int, input().split())))

bc = []
for i in range(2):
    b, c = map(int, input().split())
    bc.append([b,c])

from operator import itemgetter
bc.sort(key=itemgetter(1))
k = 0
c = bc[0][1]
b = bc[0][1]
bn = 0
while A[k] < c:
    A[k]=c
    k+=1
    if k >= len(A):
        break
    b-=1
    if b  == 0:
        bn += 1
        if bn > len(bc):
            break
        b = bc[bn][0]
        c = bc[bn][1]
print(sum(A))

### FIXED CODE ###

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

bc = []
for i in range(m):
    b, c = map(int, input().split())
    bc.append([b,c])

from operator import itemgetter
bc.sort(key=itemgetter(1), reverse = True)
k = 0
c = bc[0][1]
b = bc[0][0]
bn = 0
while A[k] < c:
    A[k]=c
    k+=1
    if k == len(A):
        break
    b-=1
    if b  == 0:
        bn += 1
        if bn == len(bc):
            break
        b = bc[bn][0]
        c = bc[bn][1]
print(sum(A))
target = int(input())
possibleAns = []
 
for i in range(1,10):
  for j in range(1,10):
    if i*j == target:
		possibleAns.append(i+j)
print(min(possibleAns))

### FIXED CODE ###

n=int(input())
ans=n
for i in range(int(n**0.5),0,-1):
    if n%i==0:
        ans=n//i+i-2
        break
print(ans)
class Node():
    def __init__(self,index):
        self.index = index
        self.parent = self 
        self.size = 1

    @staticmethod
    def find_set(node):
        if node.parent == node:
            return node 
        root = Node.find_set(node.parent)
        node.parent = root
        root.size += 1
        return root

    @staticmethod
    def union(node_a,node_b):
        root_a = Node.find_set(node_a)
        root_b = Node.find_set(node_b)
        if root_a != root_b:
            if root_a.size < root_b.size:
                root_a.parent = root_b
            else:
                root_b.parent = root_a



if __name__ == "__main__":
    n,m = [int(val) for val in input().split()]
    
    persons = []
    count = []
    for i in range(n):
        persons.append(Node(i))
        count.append(0)
    
    for i in range(m):
        a,b = [int(val) for val in input().split()]
        if a > b:
            Node.union(persons[a-1],persons[b-1])
        else:
            Node.union(persons[b-1],persons[a-1])


    for idx,person in enumerate(persons):
        count[Node.find_set(person).index] += 1
    
    # print(count)
    result = max(count)
    print(result)



### FIXED CODE ###

class Node():
    def __init__(self,index):
        self.index = index
        self.parent = self 
        self.size = 1

    @staticmethod
    def find_set(node):
        if node.parent == node:
            return node 
        root = Node.find_set(node.parent)
        node.parent = root
        return root

    @staticmethod
    def union(node_a,node_b):
        root_a = Node.find_set(node_a)
        root_b = Node.find_set(node_b)
        if root_a != root_b:
            if root_a.size < root_b.size:
                root_a.parent = root_b
                root_b.size == root_a.size
            else:
                root_b.parent = root_a
                root_a.size += root_b.size



if __name__ == "__main__":
    n,m = [int(val) for val in input().split()]
    
    persons = []
    count = []
    for i in range(n):
        persons.append(Node(i))
        count.append(0)
    
    for i in range(m):
        a,b = [int(val) for val in input().split()]
        if a > b:
            Node.union(persons[a-1],persons[b-1])
        else:
            Node.union(persons[b-1],persons[a-1])


    for idx,person in enumerate(persons):
        count[Node.find_set(person).index] += 1
    
    # print(count)
    result = max(count)
    print(result)
s=int(input())
print(i*800-(i//15)*200)

### FIXED CODE ###

s=int(input())
print(s*800-(s//15)*200)
n = int(input())
V = list(map(int, input().split()))
if len(set(V)) == 1:
    print(n//2)
else:
    A = V[::2]
    B = V[1::2]
    for _ in range(N//2):
        countA = [A.count(a) for a in set(A)]
        countB = [B.count(b) for b in set(B)]
    max_countA = max(countA)
    max_countB = max(countB)
    
    print(len(A)-max_countA + len(A)-max_countB)

### FIXED CODE ###

from collections import Counter
from statistics import mode


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

A = V[::2]
B = V[1::2]
countA = sorted(list(Counter(A).items()), key=lambda x: -x[1])
countB = sorted(list(Counter(B).items()), key=lambda x: -x[1])
if len(set(V)) == 1:
    print(n//2)
elif countA[0][0] != countB[0][0]:
    print(len(A)-countA[0][1] + len(B)-countB[0][1])
else:
    print(min(
        len(A)-countA[0][1] + len(B)-countB[1][1],
        len(A)-countA[1][1] + len(B)-countB[0][1]
        ))
N, M = [int(i) for i in input().split()]
A = {int(input()) for _ in range(M)}

dp = [0] * 10100
dp[0] = 1
dp[1] = 0 if 1 in A else 1

for i in range(2, N+1):
    if not i-1 in A:
        dp[i] += dp[i-1]
    if not i-2 in A:
        dp[i] += dp[i-2]
    dp[i] %= 1000000007

print(dp[N])


### FIXED CODE ###

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

dp = [0, 1]
for i in range(N):
    if i+1 in A: dp.append(0)
    else: dp.append(dp[i]+dp[i+1])
print(dp[N+1]%1000000007)
n = [0]*3
for i in range(len(n)):
  while n[i]<1 or 100<n[i]:
    n[i] = int(input())

n[0], n[1] = n[1], n[0]
n[0], n[2] = n[2], n[0]

print(n[0], n[1], n[2])

### FIXED CODE ###

a,b,c=(int(x) for x in input().split())

a,b = b,a
a,c = c,a

print(a, b, c)
import sys
s = sys.stdin.read().split()
print(s[1:].split().count(s[0]))


### FIXED CODE ###

import sys
s = input().lower()
t = sys.stdin.read().lower().split()
print(t.count(s))
N = int( input())
ans = len(N)
for i in range(N//2,N):
    if N%i == 0:
        ans = min( ans, len(i))
        break
print(ans)

### FIXED CODE ###

N = int( input())
ans = len( str(N))
for i in range(1,int( N**(1/2))+1):
    if N%i == 0:
        ans = min( ans, max( len( str(i)), len( str(N//i))))
print(ans)
import statistics
import math
N = int(input())
AS = input().split()
AS = [int(i) for i in AS]
BS = [int(AS[j-1] - j) for  i in range(1,N+1)]
b = int('{0:8.0f}'.format(statistics.median(BS)))
result_a = 0
result_b = 0
result_c = 0
for j in range (1, N+1):
    result_a += abs(int(AS[j-1]) - b - j)
for j in range (1, N+1):
    result_b += abs(int(AS[j-1]) - b - 1 - j)
for j in range (1, N+1):
    result_c += abs(int(AS[j-1]) - b + 1 - j)
print (int(min(result_a,result_b,result_c)))

### FIXED CODE ###

N = int(input())
AS = input().split()
AS = [int(i) for i in AS]
BS = [int(AS[j-1] - j) for j in range(1,N+1)]
BS_s = BS.sort()
b = BS[N//2]
result_a = 0
result_b = 0
result_c = 0
for j in range (1, N+1):
    result_a += abs(int(AS[j-1]) - b - j)
for j in range (1, N+1):
    result_b += abs(int(AS[j-1]) - b - 1 - j)
for j in range (1, N+1):
    result_c += abs(int(AS[j-1]) - b + 1 - j)
print (int(min(result_a,result_b,result_c)))
from collections import deque
n = int(input())
mins = [1000 for i in range(n+1)]
used = [0 for i in range(n+1)]
deq = deque()
deq.append((1,1))
while deq:
  x,cnt = deq.popleft()
  mins[x] = min(mins[x],cnt)
  used[x] = 1
  if used[10*x%n] == 0:
    deq.appendleft((10*x%n,cnt))
  if used[(x+1)%n] == 0:
    deq.append(((x+1)%n,cnt+1))
print(mins[0])

### FIXED CODE ###

a=input()
b=input()
if a == b[::-1]:
  print("YES")
else:
  print("NO")
from collections import Counter

n =int(input())
slist = []
for _ in range(n):
  s = input()
  slist.appemd(s)

Counter(slist)

### FIXED CODE ###

from collections import defaultdict

n =int(input())

d = defaultdict(int)

for _ in range(n):
    s = input()
    d[s] += 1

result = sorted(d.items(), key=lambda x: -x[1])

max_val = 0
maxes = []
for r in result:
    if max_val > r[1]:
        break
    else:
        max_val = r[1]
        maxes.append(r[0])

print("\n".join(sorted(maxes)))
def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

import sys
sys.setrecursionlimit(4100000)
input = sys.stdin.readline

N = Int()
AB = []
mod = 1000000007
ans = 1
C = 0

from collections import defaultdict
XX = defaultdict(list)
YY = defaultdict(list)

for i in range(N):
    A,B = Ints()
    if A!=0 or B!=0:
        AB.append([A,B])
        C += 1
        XX[A/B].append(i)
        YY[-B/A].append(i)

D = {}

for key in XX:
    if not key in D:
        l = len(XX[key])
        m = len(YY[key])
        ans *= (pow(2,l,mod)+pow(2,m,mod)-1)
        ans %= mod
        D[key] = 1
        D[-1/key] = 1
    
ans -= 1
ans %= mod
print(ans)

### FIXED CODE ###

def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

import sys
sys.setrecursionlimit(4100000)
input = sys.stdin.readline

N = Int()
mod = 1000000007
ans = 1
import math

from collections import defaultdict
XX = defaultdict(list)
YY = defaultdict(list)

zeros = 0

for i in range(N):
    A,B = Ints()
    if A!=0 and B!=0:
        GCD = math.gcd(A,B)
        A //=GCD
        B //=GCD
        if A<0 and B<0:
            A *= -1
            B *= -1
        elif A>0 and B<0:
            A *= -1
            B *= -1
        XX[(A,B)].append(i)
        
        B *= -1
        if A<0 and B<0:
            A *= -1
            B *= -1
        elif A<0 and B>0:
            A *= -1
            B *= -1
        YY[(B,A)].append(i)
        
    elif A==0 and B!=0:
        XX[(0,1)].append(i)
        YY[(1,0)].append(i)
    elif A!=0 and B==0:
        XX[(1,0)].append(i)
        YY[(0,1)].append(i)
    else:
        zeros += 1


D = {}

for key in XX:
    if not key in D:
        l = len(XX[key])
        m = len(YY[key])
        ans *= (pow(2,l,mod)+pow(2,m,mod)-1)
        ans %= mod
        D[key] = 1
        
        a,b = key
        if a==0 and b==1:
            D[(1,0)] = 1
        elif a==1 and b==0:
            D[(0,1)] = 1
        else:
            b *= -1
            if a < 0:
                b*=-1
                a*=-1
            D[(b,a)] = 1
    
ans -= 1
ans += zeros
ans %= mod
print(ans)
s = input()
n = len(s)
l = (n - 1) // 2
m = n // 4
for i in range(m):
  if s[i] != s[l - i - 1] or s[i] != s[l + i + 1] or s[i] != s[n - i - 1]:
    

### FIXED CODE ###

import sys
s = input()
n = len(s)
l = (n - 1) // 2
s1 = s[:l]
s2 = s[l+1:][::-1]
if s1 != s2:
    print('No')
    sys.exit()
m = l // 2
if l % 2 == 0:
    a1 = s1[:m]
    b1 = s2[:m]
    a2 = s1[m:][::-1]
    b2 = s2[m:][::-1]
else:
    a1 = s1[:m]
    b1 = s2[:m]
    a2 = s1[m+1:][::-1]
    b2 = s2[m+1:][::-1]
if a1 != a2 or b1 != b2:
    print('No')
    sys.exit()
print('Yes')