#include<bits/stdc++.h>
using namespace std;
#define rep(i,s, n) for(int i = s; i < (int)(n); i++)
#define co(x) cout<<x<<endl
#define SQvec(i,j) vector<vector<int>> data(i, vector<int>(j))
#define mod 1000000007
typedef long long int lint;

int main() {
  string S;
  cin >> S;
  int ans=0;
  bool fin = false;
  rep(i,0,S.size() - 1){
    if(S[i] == S[i + 1]){
      cout << i + 1 << " " << i + 2 << endl; 
      fin = true; 
      break;
    }
  }
  if(fin == false){
    rep(i,0,S.size() - 2){
      if(S[i] == S[i + 2]){
        cout << i + 1 << " " << i + 3 << endl; 
        fin = true; 
        break;
      }
    }
    if(fin == false){cout << -1 << " " << -1 << endl;}
  }
}
#include<iostream>
#include<cstdio>
#include<cstring>

namespace ShengXianTi
{
	const int N=301000,MOD=1000000007;
	inline void inc(int a,int &b){b=(a+b)%MOD;}

	int f[N][2][3][3];
	char s[N];
	int n;

	void dp()
	{
		s[n+1]='1',f[0][1][0][0]=1;

		for(int p=0;p<=n;p++)
			for(int r=0;r<2;r++)
				for(int k=0;k<3;k++)
					for(int sta=0;sta<3;sta++)
					{
						int v=f[p][r][k][sta];
						if(s[p+1]=='?' || s[p+1]=='0')
						{
							if(k==0)inc(v,f[p+1][r][1][sta]);
							else inc(v,f[p+1][r][k^3][sta]);
						}
						if(s[p+1]=='?' || s[p+1]=='1')
						{
							if(sta==2)
								inc(v,f[p+1][r^(k!=1)][0][sta]);
							else if(sta==1)
								inc(v,f[p+1][r^(k!=1)][0][sta+(r==0 && k==0)]);
							else if(sta==0)
								inc(v,f[p+1][r^(k!=1)][0][sta+(r==1 && k==0)]);
						}
					}
	}

	void solve()
	{
		scanf("%s",s+1);
		n=strlen(s+1);
		dp();

		int ans=0;
		inc(f[n+1][0][0][2],ans);
		inc(f[n+1][1][0][2],ans);
		printf("%d\n",ans);
	}
}

int main()
{
	ShengXianTi::solve();
	return 0;
}
