#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main() {
char str[11], issue[1000001];
int i = 0, count = 0, firstPosition = -1,len,len1;
scanf("%10s", str);
getchar();
fgets(issue, sizeof(issue), stdin);
for (i = 0; str[i]; i++) {
str[i] = toupper(str[i]);
}
len1 = strlen(str);
len = strlen(issue);
for (i = 0; i < len; i++) {
if (toupper(issue[i]) == str[0]) {
int j;
for (j = 0; j < len1 && (i + j) < len && toupper(issue[i + j]) == str[j]; j++);
if (j == len1 && (i + j == len || !isalpha(issue[i + j]))) {
count++;
if (firstPosition == -1) {
firstPosition = i;
}
}
}
}
if (count == 0) {
printf("-1\n");
} else {
printf("%d %d\n", count, firstPosition);
}
return 0;
}