#include <fstream>
using namespace std;
ifstream fin (“numere.in”);
ofstream fout(“numere.out”);
int main()
{int n,x,maxcif=0-1;
fin>>n;
for (int i=1;i<=n;i++)
{
fin>>x;
while (x)
{if (maxcif<x%10)
maxcif=x%10;
if (maxcif==9)
break;
x/=10;}
fout<<maxcif<<’ ‘;
}
return 0;
}