#include <iostream>
#include <cmath>
using std::cin;
int main() {
double A[2][2], B[2][2];
int I[2][2] = {1,0,0,1};
for (int i=0; i<2; i++) {
for (int j=0; j<2; j++) {
cin>>A[i][j];
}
}
double tr_A = A[0][0]+ A[1][1];
double sqrt_det_A = sqrt(A[0][0]*A[1][1] - A[0][1]*A[1][0]);
double divisor = sqrt(tr_A + 2*sqrt_det_A);
for (int i=0; i<2; i++) {
for (int j=0; j<2; j++) {
B[i][j] = (A[i][j] + sqrt_det_A*I[i][j]) / divisor;
}
}
printf("Matrix A:\n%f %f\n%f %f\n", A[0][0], A[0][1], A[1][0], A[1][1]);
printf("Square root of matrix A:\n%f %f\n%f %f", B[0][0], B[0][1], B[1][0], B[1][1]);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+Cgp1c2luZyBzdGQ6OmNpbjsKCmludCBtYWluKCkgewoJZG91YmxlIEFbMl1bMl0sIEJbMl1bMl07CglpbnQgSVsyXVsyXSA9IHsxLDAsMCwxfTsKCWZvciAoaW50IGk9MDsgaTwyOyBpKyspIHsKCQlmb3IgKGludCBqPTA7IGo8MjsgaisrKSB7CgkJCWNpbj4+QVtpXVtqXTsKCQl9Cgl9Cglkb3VibGUgdHJfQSA9IEFbMF1bMF0rIEFbMV1bMV07Cglkb3VibGUgc3FydF9kZXRfQSA9IHNxcnQoQVswXVswXSpBWzFdWzFdIC0gQVswXVsxXSpBWzFdWzBdKTsKCWRvdWJsZSBkaXZpc29yID0gc3FydCh0cl9BICsgMipzcXJ0X2RldF9BKTsKCWZvciAoaW50IGk9MDsgaTwyOyBpKyspIHsKCQlmb3IgKGludCBqPTA7IGo8MjsgaisrKSB7CgkJCUJbaV1bal0gPSAoQVtpXVtqXSArIHNxcnRfZGV0X0EqSVtpXVtqXSkgLyBkaXZpc29yOwoJCX0KCX0KCXByaW50ZigiTWF0cml4IEE6XG4lZiAlZlxuJWYgJWZcbiIsIEFbMF1bMF0sIEFbMF1bMV0sIEFbMV1bMF0sIEFbMV1bMV0pOwoJcHJpbnRmKCJTcXVhcmUgcm9vdCBvZiBtYXRyaXggQTpcbiVmICVmXG4lZiAlZiIsIEJbMF1bMF0sIEJbMF1bMV0sIEJbMV1bMF0sIEJbMV1bMV0pOwoJcmV0dXJuIDA7Cn0=