using System;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int[ , ] a = new int[3,4];
int[] b = new int[4];
for(int i=0;i<3;i++)
for (int j = 0; j < 4; j++)
{
a[i,j] = Convert.ToInt32(Console.ReadLine());
if(j == 3)
{
Console.WriteLine("");
}
}
for (int i = 0, j = 0; j < 4; j++)
{
b[j] = a[i, j];
}
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 3; j++)
{
if (b[i] > a[j, i])
{
b[i] = a[j, i];
}
}
Console.WriteLine(b[i]);
}
Console.ReadLine();
}
}
}