#include #include #include using std::string; typedef unsigned long long ull; struct Data { string pattern, text; }; Data read_input() { Data data; std::cin >> data.pattern >> data.text; return data; } void print_occurrences(const std::vector& output) { for (size_t i = 0; i < output.size(); ++i) std::cout << output[i] << " "; std::cout << "\n"; } std::vector get_occurrences(const Data& input) { const string& s = input.pattern, t = input.text; std::vector ans; for (size_t i = 0; i + s.size() <= t.size(); ++i) if (t.substr(i, s.size()) == s) ans.push_back(i); return ans; } int main() { std::ios_base::sync_with_stdio(false); print_occurrences(get_occurrences(read_input())); return 0; }