#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main() {
char str[100], sent[100000];
int pos, counts = 0, ans;
fgets(str, sizeof(str), stdin);
fgets(sent, sizeof(sent), stdin);
for (int i = 0; i < strlen(str); i++) {
if (isupper(str[i])) {
str[i] = tolower(str[i]);
}
}
for (int i = 0; i < strlen(sent); i++) {
if (isupper(sent[i])) {
sent[i] = tolower(sent[i]);
}
}
strcat(str, " ");
strcat(sent, " ");
pos = strstr(sent, str) - sent;
ans = pos;
while (pos != -1) {
counts++;
pos = strstr(sent + pos + 1, str) - sent;
}
if (ans == -1) {
printf("-1");
} else {
printf("%d %d", counts, ans);
}
return 0;
}