#include <iostream>
#include <cmath>
using namespace std;
int main() {
float x, y, u;
scanf("%f%f", &x, &y);
float a=x*x+y*y;
if((y<0)||(a>1)||((x>0)&&(a<0.3)))
{
printf("u=%f", sqrt(abs(x-1)));
}
else
{
printf("u=%f",x*x-1);
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKaW50IG1haW4oKSB7CiAgICBmbG9hdCB4LCB5LCB1OwogICAgc2NhbmYoIiVmJWYiLCAmeCwgJnkpOwogICAgZmxvYXQgYT14KngreSp5OwogICAgaWYoKHk8MCl8fChhPjEpfHwoKHg+MCkmJihhPDAuMykpKQogICAgewogICAgICAgIHByaW50ZigidT0lZiIsIHNxcnQoYWJzKHgtMSkpKTsKICAgIH0KICAgIGVsc2UKICAgIHsKICAgICAgICBwcmludGYoInU9JWYiLHgqeC0xKTsKICAgIH0KIAogICAgcmV0dXJuIDA7Cn0=