#include <bits/stdc++.h>
using namespace std;

int main() {
    string str;
    cin >> str;

    int x = -1, y = -1;
    for (int i = 0; i < str.size(); i++) {
        if (i > 0 && str[i] == str[i-1]) x = i, y = i+1;
        if (i > 1 && str[i] == str[i-2]) x = i-1, y = i+1;
    }

    cout << x << " " << y << endl;

    return 0;
}
