#define _CRT_SECURE_NO_WARNINGS
#pragma _attribute_((optimize("-O2")))

#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <cstdio>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <string>
#include <sstream>
#include <time.h>
#include <iomanip>

#define ll long long

//#define Local

using namespace std;

string in;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input1.txt", "r", stdin);
	//freopen("output1.txt", "w", stdout);

	while (cin >> in)
	{

		int cont = 0;
		bool f = 0;
		if (in.length() == 2)
		{
			if (in[0] == in[1])
			{
				cout << "1 2" << endl;
				continue;
			}
		}
		else
			for (int a = 2; a < in.length(); a++)
			{
				if (in[a - 2] == in[a - 1] || in[a - 2] == in[a] || in[a - 1] == in[a])
				{
					cout << a - 1 << " " << a + 1 << endl;
					f = 1;
					break;
				}
			}
		if (!f)
			cout << "-1 -1" << endl;
	}

#ifdef Local
	cout << "time: " << (long long)clock() * 1000 / CLOCKS_PER_SEC << " ms" << endl;
#endif
	return 0;
}