#include <bits/stdc++.h> using namespace std; // 比較兩數字的大小(因為 a, b, c 有可能大於 long long int 的範圍) bool compare(string a, string b) { if (a.size() != b.size()) return a.size() > b.size(); return a > b; } int main() { int S; string a, b, c; cin >> S; while (S--) { cin >> a >> b >> c; if (compare(a, b)) { if (compare(a, c)) cout << a << endl; else cout << c << endl; } else { if (compare(b, c)) cout << b << endl; else cout << c << endl; } } return 0; }