#include <iostream>
#include <string>
using namespace std;

int main()
{
	string word;
	int length, n;
	cin>>n;
	for(int i=0; i<n; ++i)
	{
		cin>>word;
		length=word.size();
		if(length>10)
			cout<<word[0]<<length-2<<word[length-1]<<endl;
		else
			cout<<word<<endl;
	}
	return 0;
}

  

 posted on 2019-11-06 10:10  ComMario  阅读(100)  评论(0编辑  收藏  举报