#include <iostream>
using namespace std;
int main(){
int n, nr, maxim;
cout << " N : ";
cin >> n;
while(n--){
maxim = 0;
//Citeste numarul
cout << "\nNumarul : ";
cin >> nr;
//Daca numarul are 3 cifre
if(nr>99 & nr<1000){
while(nr){
if(nr%10>maxim) maxim=nr%10;
nr=nr/10;
}
cout << "\t Cifra maxima = " << maxim;
}
}
}