text: #include <iostream>
  
  void answer(unsigned v)
  {
      std::cout << v << '\n';
  }
  
  void solve(unsigned a, unsigned b, unsigned c, unsigned d)
  {
      answer(std::max(a+b, c+d));
  }
  
  void test_case()
  {
      unsigned a, b, c, d;
      std::cin >> a >> b >> c >> d;
  
      solve(a, b, c, d);
  }
  
  int main()
  {
      size_t t;
      std::cin >> t;
  
      while (t-- > 0)
          test_case();
  
      return 0;
  }
  
  