#include <iostream>
#include <string>
using namespace std;
int main() {
string txt, pat;
cin >> txt;
cin >> pat;
int m = pat.size();
int n = txt.size();
for (int i = 0; i <= n - m; i++) {
int j;
for (j = 0; j < m; j++) {
if (txt[i + j] != pat[j]) {
break;
}
}
if (j == m) {
cout << "Pattern found at index " << i << endl;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBzdHJpbmcgdHh0LCBwYXQ7CmNpbiA+PiB0eHQ7CmNpbiA+PiBwYXQ7CgogICAgaW50IG0gPSBwYXQuc2l6ZSgpOwogICAgaW50IG4gPSB0eHQuc2l6ZSgpOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPD0gbiAtIG07IGkrKykgewogICAgICAgIGludCBqOwpmb3IgKGogPSAwOyBqIDwgbTsgaisrKSB7CmlmICh0eHRbaSArIGpdICE9IHBhdFtqXSkgewogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKGogPT0gbSkgewogICAgICAgICAgICBjb3V0IDw8ICJQYXR0ZXJuIGZvdW5kIGF0IGluZGV4ICIgPDwgaSA8PCBlbmRsOwogICAgICAgIH0KICAgIH0KCiAgICByZXR1cm4gMDsKfQoK