#include <iostream>
#include<vector>
#include<string>
#include<math.h>
/***** S. M. Sabiul Hajjaj Sabit *****/
using namespace std;
template <typename T>long long int power(T a, T b)
{
long long int pow=1;
for(int i=0; i<b; i++)
{
pow *= a;
}
return pow;
}
///*********Write Code From Here*********///
int main()
{
int n;
cin>>n;
for(int i=0; i<n; i++)
{
string s;
cin>>s;
if(s.size()>10)
{
cout<<s[0]<<s.size()-2<<s[s.size()-1]<<endl;
}
else
{
cout<<s<<endl;
}
}
}
Add your comment