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

#define int long long
#define pb push_back
#define f first
#define s second
#define all(container) container.begin(),container.end()

#define fast ios::sync_with_stdio(0); cin.tie(0)

int32_t main(){
  
    fast;

    string s; cin >> s;

    vector<int> ar[26];

    for(int i=0;i<s.size();i++){
        ar[s[i]-'a'].pb(i+1);
    }

    int maxx = -1;
    pair<int,int> ans =  {-1,-1};

    for(int i=0;i<26;i++){
        if(ar[i].size()>0){
            int fi = ar[i][0];
            int cnt = ar[i].size();
            // cout << fi << " " << cnt << " " << i << " " << '\n';
            for(int j=ar[i].size()-1;j>=1;j--){
                int li = ar[i][j];
                int size = li - fi + 1;
                if(cnt>size/2){
                    if(maxx<size){
                        ans.f = fi;
                        ans.s = li;
                        maxx = size;
                    }
                    break;
                }
                else{
                    cnt--;
                }
            }
        }
    }

    cout << ans.f << " " << ans.s << '\n';
 
 
    return 0;
} 