using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {

    static int profit(int b, int s, int c) 
    {
        int profit = 4;
        
        b = 2 + 7 + profit;
        s = 9 + 5 + profit;
        c = 11 + 7 + profit;
            
        return b;
        return s;
        return c;
        
        // Return the fixed profit.
    }

    static void Main(String[] args) 
    {
        int t = Convert.ToInt32(Console.ReadLine());
        for(int a0 = 0; a0 < t; a0++){
            string[] tokens_b = Console.ReadLine().Split(' ');
            int b = Convert.ToInt32(tokens_b[0]);
            int s = Convert.ToInt32(tokens_b[1]);
            int c = Convert.ToInt32(tokens_b[2]);
            int result = profit(b, s, c);
            Console.WriteLine(result);
        }
    }
}