#include<cstdio>
using namespace std;
inline int read() {
char c = getchar(); int x = 0, f = 1;
while(c < '0' || c > '9') {if(c == '-')f =- 1; c = getchar();}
while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
return x * f;
}
int main() {
int tot = 0;
for(int i = 1; i <= 5000000; i++) tot++;
int t = read();
while(t--) {
int a = read(), b = read();
a += tot; b += tot;
printf("%d\n", a + b - 2 * tot);
}
}