public static void main() throws Exception{
        BufferedReader br = new BufferedReader(new FileReader("Staves.input"));
        String s = br.readLine();
        int n = s.length();
        int[] sections = new int[n];
        for(int i=0; i<n; i++){
            sections[i] = Integer.parseInt(s.charAt(i)+"");
        }
        int k = n/2;
        int[] firstIndex = new int[5*k*k];
        for(int l=k; l>0; l--){
            Arrays.fill(firstIndex, -1);
            for(int i=0; i<n-l+1; i++){
                int j=i+l-1;
                int afterL = n-1-j;
                int beforeL = i;
                if(afterL<k && beforeL<k) continue;

                int sum = forwardSum(sections, i, j);
                if(firstIndex[sum]>=0){
                    if(firstIndex[sum]+l<i){
                        System.out.println(firstIndex[sum] + " " + i + " " + l);
                        return;
                    }
                } else{
                    firstIndex[sum] = i;
                }

                sum = backwardSum(sections, i, j);
                if(firstIndex[sum]>=0){
                    if(firstIndex[sum]+l<i){
                        System.out.println(firstIndex[sum] + " " + i + " " + l);
                        return;
                    }
                } else{
                    firstIndex[sum] = i;
                }

            }
        }
    }