#include <iostream>
#include <cmath>

// int a;
// int *p = &a;
// *p
// int &r = a;
// r = 123; 

/*void swap(int&a, int&b)
{
  int c=a;
  a=b;
  b=c;
}
void swap(float&a, float&b)
{
  float c=a;
  a=b;
  b=c;
}*/

template<typename T>
struct complex {
  T real;
  T imag;

  complex() {};
  complex(T a, T b) { real = a; imag = b; };

  complex operator+(const complex &b) const {
    /*complex result;
    result.real = real + b.real;
    result.imag = imag + b.imag;
    return result;*/

    return complex(real + b.real, imag + b.imag);
  }

  complex operator*(const complex &b) const {
    return complex(real * b.real - imag * b.imag, real * b.imag + imag * b.real);
  }

  complex operator*(const T &number) {
    return complex(number*real, number*imag);
  }

  complex operator/(const T &number) {
    return complex(real/number, imag/number);
  }

  float length() const {
    return sqrt(real * real + imag * imag);
  }

  complex normalized() const {
    return *this/length();
  }

  friend std::ostream& operator<<(std::ostream &o, complex a){
    o << a.real << " " << a.imag;
    return o;
  }

  friend std::istream& operator>>(std::istream &i, complex &a){
    i >> a.real;
    i >> a.imag;
    return i;
  }
};

// a + b
// operator+(a,b)
// a.operator+(b)


template<typename T>
complex<T> operator*(T num, complex<T> c) {
  return c * num;
  //return complex(num*c.real, num*c.imag);
}


template<typename T>
void swap(T&a, T&b)
{
  T c=a;
  a=b;
  b=c;
}

int main() {
  complex<float> a;
  std::cin >> a;
  // a.operator+(a);
  // operator+(a,a)
  // std::cout : std::ostream
  std::cout << (complex<float>(0,2)*(a+a)).length() << std::endl;
  std::cout << (complex<float>(0,2)*(a+a)).normalized() << std::endl;
  /*double a = 6, b = 9;*
  std::cin >> a >> b;

  
  swap(a, b);
  
  std::cout << a << " " << b << std::endl;*/
  return 0;
} 
