#include <iostream>
#include <cmath>
#include <cstdio>
#define EPS 0.000001
using namespace std;
double R;

pair<double,double> rot(double x,double y,double x2,double y2,double U)
{
    x -= x2;
    y -= y2;
    double new_x = x * cos(U) - y * sin(U);
    double new_y = x * sin(U) + y * cos(U);
    new_x += x2;
    new_y += y2;
    return make_pair(new_x,new_y);
}

pair<double,double> sim(double x,double y,double x2,double y2)
{
    return make_pair(x2-x,y2-y);
}

int main()
{
    double pi;
    int x, y;
    pi = atan(1.0) * 4.0;
    cin >> R;
    printf("0 0\n");
    fflush(stdout);
    while(cin >> x)
    {
        cin >> y;
        pair <double, double> now = rot(1.0 * x, 1.0 * y, 0.0, 0.0, pi);
        printf("%d %d\n", (int)floor(now.first + EPS), (int)floor(now.second + EPS));
    }
    return 0;
}