#include <bits/stdc++.h>
using namespace std;
char a[20], s[1000010];
int main() {
cin>>a+1;
cin>>s+1;
a[0] = ' '; strcat(a, " ");
s[0] = ' '; strcat(s, " ");
for (int i = 0; a[i]; i++)
if (a[i] >= 'A' && a[i] <= 'Z') a[i] += 32;
for (int i = 0; s[i]; i++)
if (s[i] >= 'A' && s[i] <= 'Z') s[i] += 32;
int first, cnt = 0, p = 0;
while ( (p = strstr(s + p, a) - s) >= 0) {
cnt++;
if (cnt == 1) first = p;
p++;
}
if (cnt == 0) printf("-1\n");
else printf("%d %d\n", cnt, first);
return 0;
}