#include <iostream>
using namespace std;
int main() {
int n, age;
string name;
cin >> n;
for(int i = 0;i<n;i++) {
cin >> name;
cin >> age;
cout << name << " ";
cout << age + 1 << endl;
}
#include <iostream>
using namespace std;
int main() {
int n, age;
string name;
cin >> n;
for(int i = 0;i<n;i++) {
cin >> name;
cin >> age;
cout << name << " ";
cout << age + 1 << endl;
}
}