#include <bits/stdc++.h>
using namespace std;
vector<int> ar[1001];
int vis[1001], dist[1001];
void dfs(int node, int d) {
  vis[node] = 1;
  dist[node] = d;
  for (int child : ar[node]) {
    if (!vis[child]) dfs(child, dist[node] + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long int a[3];
    for (long long int i = 0; i < 3; i++) cin >> a[i];
    sort(a, a + 3);
    cout << a[2] << "\n";
  }
  return 0;
}
