import sys
input = sys.stdin.readline

n = int(input())
ab = [list(map(int, input().split())) for _ in range(n)]
mod = 1000000007

adivb = [ab[i][0] / ab[i][1] for i in range(n)]
bdiva = [float('inf') if ab[i][0] == 0 else ab[i][1] / ab[i][0]
         for i in range(n)]

print(adivb, bdiva)
ans = pow(2, n) - 1

