#include <bits/stdc++.h>
using namespace std;
int main() {
string word, line;
getline(cin, word);
getline(cin, line);
int sizeWord = word.size();
int sizeLine = line.size();
int cnt = 0, index;
for (int i = 0; i <= sizeLine - sizeWord; ++i) {
int seek = 0;
if (i == 0 || (i > 0 && line[i - 1] == ' ')) {
while (toupper(line[i + seek]) == toupper(word[seek])) {
seek++;
}
}
if (seek == sizeWord) {
if (line[i + seek] == ' ' || i + seek == sizeLine) {
cnt++;
if (cnt == 1) {
index = i;
}
}
}
}
if (cnt == 0) {
cout << "-1" << endl;
} else {
cout << cnt << " " << index << endl;
}
return 0;
}