import java.util.Scanner;
public class Test1013
{
    public static void main (String[] args)
    {
        Scanner in=new Scanner(System.in);
        int x=in.nextInt();
        System.out.println("输入x次:"+x);
        for (int i=1;i<=x ;i++ )
        {
            int a=in.nextInt();
            int b=in.nextInt();
            int c=in.nextInt();
            int d=in.nextInt();
            int max=a;
            if(a<b)
            {
                max=b;
            }
            if(max<c)
            {
                max=c;
            }
            if (max<d)
            {
                max=d;
            }
            System.out.println("最大值为:"+max);
        }
    }
}