#include <bits/stdc++.h>
using namespace std;
const int maxn=1500;
struct Student{
string name;
int old,cj;
}student[1009];
int main(){
int n;
cin >> n;
for(int i=1;i<=n;i++){
cin >> student[i].name >>student[i].old >>student[i].cj;
student[i].old++;
student[i].cj=student[i].cj+student[i].cj/5;
if(student[i].cj>600){
student[i].cj=600;
}
cout <<student[i].name << " "<<student[i].old <<" "<< student[i].cj;
}
return 0;
}