# include <bits/stdc++.h>

using namespace std;

#define pii pair<int, int>
#define pll pair<ll, ll>

#define pb push_back
#define eb emplace_back
#define mp make_pair

#define fi first
#define se second

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int inf = (int)1e9 + 7;
const int maxn = (int)6e5 + 7;
const int lmaxn = (int)6e6 + 7;
const ll linf = (ll)1e16 + 7;

const ld eps = ld(1e-11);

const ll dx[] = {-1, 0, 0, 1};
const ll dy[] = {0, -1, 1, 0};

ll gcd(ll a, ll b){
    while(b) a %= b, swap(a, b);
    return a | b;
}

ll lcm(ll a, ll b){
    return a * b / gcd(a, b);
}

string a;

bool ok(string x){
    vector < ll > cnt(27, 0);
    for(ll i : x)
        cnt[i - 'a']++;
    for(ll i : x){
        if(cnt[i - 'a'] > (ll)x.size() / 2)
            return 1;
    }
    return 0;
}

int main(){
  	ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> a;
    for(ll len = 2; len <= min((ll)a.size(), 5ll); ++len){
        for(ll i = 0; i + len - 1 < (ll)a.size(); ++i){
            if(ok(a.substr(i, len))){
                cout << i + 1 << " " << i + len;
                return 0;
            }
        }
    }
    cout << -1 << " " << -1;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long 
const long long inf=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;
#define FORR(x,arr) for(auto& x:arr)
#define ZERO(a) memset(a,0,sizeof(a))





//3111111111111111111111111111111

	
	void solve(){

		ins(morty);
		int tmp = -1;
		int tmp1 = -1;
		FOR(i,0,morty.size()-1){
			if(morty[i] == morty[i+1]){tmp = i+1;tmp1 = i+2;break;}
		}
		FOR(i,0,morty.size()-2){
			if(morty[i] == morty[i+2]){tmp = i+1;tmp1 = i+3;break;}
		}
		out(tmp,tmp1);




















	}























int32_t main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall 
	oneforall

	solve();
	


	return 0;
}
