using System;
public class RootOfSquareMatrix
{
public static void Main()
{
double[,] A = new double[2,2];
double[,] B = new double[2,2];
int[,] I = {{1, 0}, {0, 1}};
for (int i=0; i<2; i++)
{
for (int j=0; j<2; j++)
{
A[i,j] = Convert.ToDouble(Console.ReadLine());
}
}
double tr_A = A[0,0]+ A[1,1];
double sqrt_det_A = Math.Sqrt(A[0,0]*A[1,1] - A[0,1]*A[1,0]);
double divisor = Math.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;
}
}
Console.WriteLine("Matrix A:\n{0} {1}\n{2} {3}", A[0,0], A[0,1], A[1,0], A[1,1]);
Console.WriteLine("Square root of matrix A:\n{0} {1}\n{2} {3}", B[0,0], B[0,1], B[1,0], B[1,1]);
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFJvb3RPZlNxdWFyZU1hdHJpeAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CgkJZG91YmxlWyxdIEEgPSBuZXcgZG91YmxlWzIsMl07CgkJZG91YmxlWyxdIEIgPSBuZXcgZG91YmxlWzIsMl07CgkJaW50WyxdIEkgPSB7ezEsIDB9LCB7MCwgMX19OwoJCWZvciAoaW50IGk9MDsgaTwyOyBpKyspCgkJewoJCQlmb3IgKGludCBqPTA7IGo8MjsgaisrKQoJCQl7CgkJCQlBW2ksal0gPSBDb252ZXJ0LlRvRG91YmxlKENvbnNvbGUuUmVhZExpbmUoKSk7CgkJCX0KCQl9CgkJZG91YmxlIHRyX0EgPSBBWzAsMF0rIEFbMSwxXTsKCQlkb3VibGUgc3FydF9kZXRfQSA9IE1hdGguU3FydChBWzAsMF0qQVsxLDFdIC0gQVswLDFdKkFbMSwwXSk7CgkJZG91YmxlIGRpdmlzb3IgPSBNYXRoLlNxcnQodHJfQSArIDIqc3FydF9kZXRfQSk7CgkJZm9yIChpbnQgaT0wOyBpP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