#include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; string s; mapm; for (int i = 0; i > s; m[s] = i; } vectorans; for (int i = 0; i > s; ans.push_back(s); } string p, q; int cnt = 0; for (int i = 0; i < n; i++) { p = ans[i]; for (int j = i + 1; j < n; j++) { q = ans[j]; if (m[p..