#include<iostream> #include<cstring> using namespace std; const int N = 200; int a[N]; int e[N][N]; int main(){ string str; cin >> str; memset(e, -1, sizeof e); for(int i = 0; i < str.size(); i ++){ int x = str[i]; e[x][a[x]] = i; a[x] ...