#include #include #include #include #include using namespace std; typedef long long ll; int ansx = 0, ansy = 0; void init() { ansx=ansy=0; } int main() { int T; cin >> T; while(T --) { int n; cin>>n; init(); for(int i = 0; i < n; i ++) { int x, y; scanf("%d%d", &x, &y); ansx = max(ansx, x); ansy = max(ansy, y); } cout << ansx + ansy << endl; } return 0; }