import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        for(int i=0;i<t;i++){
            int a=sc.nextInt(),
                b=sc.nextInt(),
                c=sc.nextInt();
            int sum1=0,sum2=0;


            int num3=Math.min(b,c/2);
            sum2+=3*num3;
            b=b-num3;
            int num4 = Math.min(a,b/2);
            sum2+=3*num4;

            int num1=Math.min(a,b/2);
            sum1+=3*num1;
            b=b-2*num1;
            int num2 = Math.min(b,c/2);
            sum1+=3*num2;

            System.out.println(sum1 + "    "+sum2);
            System.out.println(sum1>sum2?sum1:sum2);
        }
    }
}
