#include<iostream>
#include<cmath>
using namespace std;
#define pi 3.141592
int main()
{
double L, R;
cin >> L >> R;
while ((L - 2 * pi*R) >= 0)
{
L -= 2 * pi*R;
}
double x = cos(L / R)*R;
double y = sin(L / R)*R;
printf("%.3f %.3f\n", x, y*(-1));
printf("%.3f %.3f\n", x, y);
return 0;
}