/*
LIFE WOULD BE SO BEAUTIFUL IF BRUTE WORKED EVERYTIME
*/
#include <bits/stdc++.h>
#include <string.h>
#define int long long
#define MAX 1000
#define itn int
#define inf 1e9
#define mod 1000000007
#define pb push_back
#define all(x) x.begin(), x.end()
#define sitr set<int>::iterator
#define mitr map<int, int>::iterator
#define pii pair<int, int>
#define vii vector<pii>
#define vi vector<int>
#define vll vector<unsigned int>
#define sortall(x) sort(x.begin(), x.end());
#define fori(i, n) for (int i = 0; i < n; i++)
#define test  \
    int t;    \
    cin >> t; \
    while (t--)
#define fast                       \
    ios_base ::sync_with_stdio(0); \
    cin.tie(NULL);                 \
    cout.tie(NULL)
using namespace std;
void __print(int x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V>
void __print(const pair<T, V> &x)
{
    cerr << '{';
    __print(x.first);
    cerr << ',';
    __print(x.second);
    cerr << '}';
}
template <typename T>
void __print(const T &x)
{
    int f = 0;
    cerr << '{';
    for (auto &i : x)
        cerr << (f++ ? "," : ""), __print(i);
    cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v)
{
    __print(t);
    if (sizeof...(v))
        cerr << ", ";
    _print(v...);
}
#ifndef ONLINE_JUDGE
#define see(x...)                 \
    cerr << "[" << #x << "] = ["; \
    _print(x)
#else
#define see(x...)
#endif


int a[1000007];
vi v;
void seive()
{for(int i=0;i<=1000000;i++)
a[i] = 1;
a[0]=a[1]=0;
for(int i=2;i<=1000;i++){
if(a[i] == 1)
{v.pb(i);for(int j=2*i;j<=1000000;j+=i)a[j] = 0;}
}
for(int i=1001;i<=1000000;i++){
if(a[i] == 1)
v.pb(i);
}
}


//int palindrome (int n){int x;string s = tostring(n); if(!(s.length()%2)) x = s.length()/2 - 1; else x = s.length()/2; for(int i=0;i<=x;i++) {if(s[i] != s[s.length()-1-i]) return 0; } return 1; }
//int nCr(int n,int r){if(r>n) return 0;  int k = r; if((n-r)<r) k = (n-r); int g = k; int ans = 1; for(int i=n;i>=n-k+1;i--) { ans *= i; if(ans%g == 0){ans /= g; g--;}} while(g>=1) { ans /= g; g--;} return ans;}
//int fpow(int a,int n){if(n == 0)return 1;if(n == 1) return a; if(n%2) return (a%mod * fpow(a,n-1)%mod)%mod; return (fpow(a,n/2)%mod * fpow(a,n/2)%mod)%mod;}
int toint(const string &s) {stringstream ss; ss << s; int x; ss >> x; return x;}
//int negativemod(int a,int n){return (a%n)+n;}
//int palindrome (string s){int x; if(!(s.length()%2)) x = s.length()/2 - 1; else x = s.length()/2; for(int i=0;i<=x;i++) {if(s[i] != s[s.length()-1-i]) return 0; } return 1; }
//int fpow(int a,int n,int modd){if(n == 1) return a; if(n%2) return (a%modd * fpow(a,n-1,modd)%modd)%modd; return (fpow(a,n/2,modd)%modd * fpow(a,n/2,modd)%modd)%modd;}
//int I_fpow(int a,int n){int x=a;int ans = 1;while(n){if(n%2)ans = (ans%mod * x%mod)%mod;x = (x%mod * x%mod)%mod;n /= 2;}return ans;}
//int fact(int n){int ans=1;if(n==0 || n==1)return 1;for(int i=2;i<=n;i++)ans*=i;return ans;}
string tostring ( int number ){stringstream ss; ss<< number; return ss.str();}
//int nCrmodp(int n, int r, int p){if (r == 0)return 1;int fac[n + 1];fac[0] = 1;for (int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % p;return (fac[n] * modInverse(fac[r], p) % p *modInverse(fac[n - r], p) % p) %p;}
// Addition of 2 strings ... based on the addition performed with the help of carry.
string add2strings(string s1,string s2){if(s1.length()>s2.length())swap(s1,s2);int n = s1.length();int m = s2.length();int carry = 0;reverse(all(s1));reverse(all(s2));string ans = "";for(int i=0;i<n;i++){int sum = (char)(s1[i]-'0')+(char)(s2[i]-'0')+carry;ans += (char)(sum%10 + '0');carry = sum/10;}for(int i=n;i<m;i++){int sum = (char)(s2[i]-'0')+carry;ans += (char)(sum%10 + '0');carry = sum/10;}if(carry)ans += (char)(carry+'0');reverse(all(ans));return ans;}

//key to euclids extended --> gcd(a,b) = gcd(b,a%b)
//also a%b = a-(a/b)*b;
//hence ax+by = bx1+(a%b)y1.. ax+by = bx1+(ay1-(a/b)*by1)..
//comparing x = y1;
//y = x1-(a/b)*y1
//void extendedEuclid(int a,int b,int &x,int &y){int res;if(b == 0){res = a;x = 1;y = 0;}else{extendedEuclid(b,a%b,x,y);int t = x;x = y;y = t - (a/b)*x;}}

//if m is prime fermats little theorem can be used
//int modInverse(int a,int m){return I_fpow(a,m-2);}

//if not
//In extendedGCD x is the mod mult inverse of a under b and y is the mod mult inverse of b under a
//Inverse exist if a,m is co-prime
//int mod__Inverse(int a,int m){int x,y;extendedEuclid(a,m,x,y); return (x%m+m)%m;}
bool prime(int n) {
    if(n == 1) return false;
    if(n == 2 || n == 3 ) return true;
    for(int i=2;i*i<=n;i++) {
        if(n%i == 0) return false;
    } 
    return true;
}

signed main()
{
    fast;
    string s;
    cin>>s;
    int n = s.size();
    if(n == 1) return cout<<-1<<" "<<-1, 0;
    if(n == 2 && s[0] == s[1]) return cout<<1<<" "<<2 ,0;
    if(n == 2 && s[0] != s[1]) return cout<<-1<<" "<<-1 ,0;
    if(n == 3) {
        if(s[0] == s[1]) return cout<<1<<" "<<2 ,0;
        if(s[1] == s[2]) return cout<<2<<" "<<3 ,0;
        if(s[1] == s[3]) return cout<<1<<" "<<3 ,0;
        return cout<<-1<<" "<<-1 ,0;
    } 
    int in1 = -2, in2 = -2;
    for(int j=0;j<n-3;j++) {
        if(s[j] == s[j+1]) in1 = j, in2 = j + 1;
        else if(s[j] == s[j+2]) in1 = j, in2 = j + 2;
        else if(s[j+1] == s[j+2]) in1 = j + 1, in2 = j + 2;

        if(in1 != -2 && in2 != -2) break;
    }
    cout<<in1+1<<" "<<in2+1;
    return 0;   
}

Measured memory_bytes: 512