Codeforces-SolutionsA/Codes/71 A - Way Too Long Words/71A.cpp
2023-12-31 14:54:40 +06:00

17 lines
249 B
C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,len;
string s;
cin>>t;
while(t--)
{
cin>>s;
len=s.size();
if(len>10) cout<<s[0]<<len-2<<s[len-1]<<endl;
else cout<<s<<endl;
}
}