#include <iostream>
#include <map>
using namespace std;
int main() {
string str;
while(cin >> str){
map<string, int> number;
for(int i = 0; i < str.size(); i ++)
for(int j = 1; i + j <= str.size(); j ++){
number[str.substr(i, j)] ++;
}
for(auto t : number){
if(t.second > 1)
cout << t.first << " " << t.second << endl;
}
}
return 0;
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号