#include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int i = m; i < n; ++i)

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