#include <iostream>
#include <math.h>
using namespace std;

int main() {
	double x, eps, left, right, d, s;
	cin >> x >> eps;
	int n=0;
	left=atan(x);
	right=x;
	d=fabs(left-right);
	s=x;
	while(d>eps)
	{
		n++;
		s*=(-1)*x*x;
		right+=s/(2*n+1);
		d=fabs(left-right);
	}
	cout << "left=" << left << " right=" << right << " n=" << n << " d=" << d;
	return 0;
}