#include <iostream>
#include <vector>
#include <string>
using namespace std;

vector<int> naiveSearch(const string& A, const string& B) {
    vector<int> positions;
    int n = A.length();
    int m = B.length();

    // Duyệt qua từng vị trí có thể bắt đầu của xâu B trong xâu A
    for (int i = 0; i <= n - m; i++) {
        bool match = true;

        // So sánh đoạn con A[i:i+m] với B
        for (int j = 0; j < m; j++) {
            if (A[i + j] != B[j]) {
                match = false;
                break;
            }
        }

        // Nếu đoạn con khớp, lưu lại vị trí
        if (match) {
            positions.push_back(i + 1); // Chỉ số 1-based
        }
    }
    return positions;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string a;
  string b;
  cin >> a >> b;
  vector<int> positions = naiveSearch(a, b);
  for (int pos : positions) {
    cout << pos << ' ';
  }
}