#include <bits/stdc++.h>

using namespace std;

int main(){
    string s;
    cin >> s;
    for(int i=1;i<s.size();i++){
        if(1<i && s[i-2]==s[i]){
            cout << i-1 << " " << i+1 << endl;
            return 0;
        }

        if(s[i-1]==s[i]){
            cout << i << " " << i+1 << endl;
            return 0;
        }
    }

    cout << -1 << " " << -1 << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    string S; cin >> S;
    OUT(S.substr(0,S.size()-8))

    return 0;
}