using System;
class Yura
{
static void Main()
{
double []minP= new double [3];
double[,][] M = new double [5, 3][];
for (int k = 0; k < 5; k++)
{
M[k, 0] = new double[3] ;
M[k, 1] = new double[3] ;
M[k, 2] = new double[3] ;
}
Vvid(M);
Console.WriteLine();
Console.WriteLine(" :");
Vuvid(M);
Sort(M);
Console.WriteLine(" :");
Vuvid(M);
VMZ(minP, M);
Console.WriteLine(" 11 1 : {0} {1} {2}", minP[0], minP[1], minP[2]);
Console.ReadKey(true);
}
//===================================================
//Function
//=====================================================
// vvid---------------------------------------
static void Vvid(double[,][] M)
{
string vvid;
for (int k = 0; k < 5; k++)
{
Console.WriteLine();
Console.WriteLine("{0} - 1 :",k+1);
Console.WriteLine();
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
{
vvid = Console.ReadLine();
M[k, i][j] = Convert.ToDouble(vvid);
}
}
}
//------------------------------

// vuvid---------------------------------------
static void Vuvid(double[,][] M)
{
for (int k = 0; k < 5; k++)
{
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
Console.Write("{0} ", M[k, i][j]);
}
Console.WriteLine();
}
Console.WriteLine(); Console.WriteLine();
}
}
//------------------------------
// sort---------------------------------------
static void Sort(double[,][] M)
{
double temp;
for (int k = 0; k < 5; k++)
{
for (int t = 0; t < 9; t++)
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
if (j<2)
{
if (M[k, i][j] < M[k, i][j + 1])
{
temp = M[k, i][j];
M[k, i][j] = M[k, i][j + 1];
M[k, i][j + 1] = temp;
}
else ;
}
else
{
if (i <2)
{
if (M[k, i ][j] < M[k, i+1][j-2])
{
temp = M[k, i + 1][j-2];
M[k, i + 1][j-2] = M[k, i][j];
M[k, i][j] = temp;
}
else ;
}
else ;

}
}

}
}

}
//------------------------------
//
static void VMZ(double []minP, double[,][] M)
{

for (int j = 0; j < 3; j++)
{
double min = M[0, 0][j];
for (int k = 0; k < 5; k++)
{
for (int i = 0; i < 3; i++)
{
if (min > M[k, i][j])
min = M[k, i][j];
else ;
}

}
minP[j] = min;
}
}
//---------------------------------------------
}