#include <bits/stdc++.h>
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);

	string s;
	cin >> s;

	set <string> res;

	int n = s.length();

	for (int i = 0; i < n; i++) {
		string temp;
		
		for (int j = i; j < n; j++) {
			temp += s[j];

			res.insert(temp);
		}
	}

	for (string r : res ) cout << r << "\n";
	
	return 0;
}
