include "stdafx.h"

#include<iostream>
#include<vector>
#include<string>
#include<math.h>
#include<iomanip>
using namespace std; int main()
{
float L, R;
while (cin>>L>>R)
{
float len = 2 * 3.1415926*R;
int nums = L / len;
// cout << "nums:" << nums << endl;
float distance = L - nums*len;
float jiaodu = distance / R;
// cout << "jiaodu" << jiaodu << endl;
if (jiaodu <= 90)
{
float x1 = R*cos(jiaodu);
// cout << "cos(90):" << acos(90) << endl;
float y1 = R*sin(jiaodu);
// cout << "x1:" << x1 << endl;
// cout << "y1:" << y1 << endl; float x2 = x1;
float y2 = -y1; // cout << "x2:" << x2 << endl;
// cout << "y2:" << y2 << endl; cout << setiosflags(ios::fixed) << setprecision(3);
cout << x2 << " " << y2 << endl;
cout << x1 << " " << y1 << endl; }
else if (jiaodu > 90 && jiaodu <= 180)
{
float x1 = R*sin(jiaodu-90);
float y1 = R*cos(jiaodu-90); float x2 = x1;
float y2 = -y1;
cout << setiosflags(ios::fixed) << setprecision(3);
cout << x2 << " " << y2 << endl;
cout << x1 << " " << y1 << endl; }
else if (jiaodu > 180 && jiaodu <= 270)
{
float x1 = R*cos(jiaodu - 180);
float y1 = R*sin(jiaodu-180); float x2 = x1;
float y2 = -y1;
cout << setiosflags(ios::fixed) << setprecision(3);
cout << x2 << " " << y2 << endl;
cout << x1 << " " << y1 << endl; }
else
{
float x1 = R*sin(jiaodu - 270);
float y1 = R*cos(jiaodu - 270); float x2 = x1;
float y2 = -y1;
cout << setiosflags(ios::fixed) << setprecision(3);
cout << x2 << " " << y2 << endl;
cout << x1 << " " << y1 << endl; } } return 0;
}
05-08 08:13