#include <bits/stdc++.h>

using namespace std;

string s;
long d[100],n;

int main()
{
    cin >> s;
    n=s.length();
    s=" "+s;
    for (long i=1;i<=n;i++){
        if (s[i]==s[i+2]) {
            cout << i << " " << i+2;
            return 0;
        }
        if (s[i]==s[i+1]) {
            cout <<i << " " << i+1;
            return 0;
        }

    }

    cout << -1 << " " << -1;
    return 0;
}
