#include <iostream>
#include <cmath>
using namespace std;
int main() {
double s1, s2, n, x;
cin >> n;
x = n*(5-sqrt(3)-sqrt(6*sqrt(3)-4))/(8*(2-sqrt(3)));
s1 = 4*x; //Длина пути по дороге
s2 = sqrt(2*(n*n - 4*x*n + 8*x*x)); //Длина пути напрямик
cout << s1 <<' ' << s2;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWRvdWJsZSBzMSwgczIsIG4sIHg7CgljaW4gPj4gbjsKCXggPSBuKig1LXNxcnQoMyktc3FydCg2KnNxcnQoMyktNCkpLyg4KigyLXNxcnQoMykpKTsKCXMxID0gNCp4OyAvL9CU0LvQuNC90LAg0L/Rg9GC0Lgg0L/QviDQtNC+0YDQvtCz0LUKCXMyID0gc3FydCgyKihuKm4gLSA0KngqbiArIDgqeCp4KSk7IC8v0JTQu9C40L3QsCDQv9GD0YLQuCDQvdCw0L/RgNGP0LzQuNC6Cgljb3V0IDw8IHMxIDw8JyAnIDw8IHMyOwoJcmV0dXJuIDA7Cn0=