#include<iostream>
#include<string>
using namespace std;
void BS(string& s) {
for (int i = 0; i < s.size(); i++)
if (s[i] >= 'a') s[i] -= 32;
}
int main() {
int num = 0, x;
string str, s;
getline(cin,str);
getline(cin, s);
BS(str); BS(s);
str.insert(0, " "); s.insert(0, " ");
str += ' '; s += ' ';
int a = s.find(str);
x = a;
while (a != -1) {
num++;
a = s.find(str, a + str.size() - 1);
}
cout << x << ' ';
if (x != -1) cout << num;
return 0;
}