#include <vector>
#include <queue>
#include <list>
#include <iostream>
#include <array>
#include <string>
#include <numeric>
using namespace std;
using ll = long long;
using ld = long double;
const ll MULT = 1000000000000;
ll round(ll x)
{
ll md = x % MULT;
if (md < MULT / 2)
return x / MULT;
return (x + MULT - 1) / MULT;
}
int main()
{
int n;
cin >> n;
vector<ll> x(n);
vector<ll> a(n);
for (ll &i : x)
{
string s;
cin >> s;
s.erase(s.begin() + 1);
i = stoll(s);
}
auto check = [&x, &a, &n](ll d)
{
a[0] = round(x.front() * d);
ll gcded = a[0];
for (int i = 1; i < n; ++i)
{
a[i] = round(x[i] * d);
gcded = gcd(a[i], gcded);
}
if (gcded != 1)
return false;
ll sum = 0;
for (ll i : a)
sum += i * i;
ld nd = sqrtl(sum);
for (int i = 0; i < n; ++i)
{
ll nx = roundl((a[i] / nd) * MULT);
if (abs(x[i] - nx) > 1000000)
return false;
}
return true;
};
for (ll a1 = 0; a1 <= 10000; ++a1)
{
if (check((a1 * MULT) / x.front()))
break;
if (check((a1 * MULT + x.front() - 1) / x.front()))
break;
}
for (ll i : a)
cout << i << '\n';
return 0;
}