Problem: In his very young years the hero of our story, king Copa, decided that his private data was hidden not enough securely, what is unacceptable for the king. That's why he invented tricky and clever password (later he learned that his password is a palindrome of odd length), and coded all his data using it. 

Copa is afraid to forget his password, so he decided to write it on a piece of paper. He is aware that it is insecure to keep password in such way, so he decided to cipher it the following way: he cut x characters from the start of his password and from the end of it (x can be 0, and 2x is strictly less than the password length). He obtained 3 parts of the password. Let's call it prefix, middle and suffix correspondingly, both prefix and suffix having equal length and middle always having odd length. From these parts he made a string A + prefix + B + middle + C + suffix, where A, B and C are some (possibly empty) strings invented by Copa, and « + » means concatenation.

Many years have passed, and just yesterday the king Copa found the piece of paper where his ciphered password was written. The password, as well as the strings A, B and C, was completely forgotten by Copa, so he asks you to find a password of maximum possible length, which could be invented, ciphered and written by Copa.

Input

The input contains single string of small Latin letters with length from 1 to 105 characters.

Output

The first line should contain integer k — amount of nonempty parts of the password in your answer (<image>). In each of the following k lines output two integers xi and li — start and length of the corresponding part of the password. Output pairs in order of increasing xi. Separate the numbers in pairs by a single space.

Starting position xi should be an integer from 1 to the length of the input string. All li must be positive, because you should output only non-empty parts. The middle part must have odd length.

If there are several solutions, output any. Note that your goal is to maximize the sum of li, but not to maximize k.

Examples

Input

abacaba


Output

1
1 7


Input

axbya


Output

3
1 1
2 1
5 1


Input

xabyczba


Output

3
2 2
4 1
7 2

Solution (in JAVA):

Solution:


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class E {
    static BufferedReader br = new BufferedReader(new InputStreamReader(
            System.in));
    static StringTokenizer st = new StringTokenizer("");

    static int nextInt() throws Exception {
        return Integer.parseInt(next());
    }

    static String next() throws Exception {
        while (true) {
            if (st.hasMoreTokens()) {
                return st.nextToken();
            }
            String s = br.readLine();
            if (s == null) {
                return null;
            }
            st = new StringTokenizer(s);
        }
    }

    public static int[] calc_z(char[] s) {
        int[] z = new int[s.length];
        int l = 0, r = 0;
        for (int i = 1; i < s.length; ++i) {
            if (z[i - l] + i <= r)
                z[i] = z[i - l];
            else {
                l = i;
                if (i > r)
                    r = i;
                for (z[i] = r - i; r < s.length; ++r, ++z[i])
                    if (s[r] != s[z[i]])
                        break;
                --r;
            }
        }
        return z;
    }

    public static int[] longestOddPlaindrome(char[] str) {
        int[] res = new int[str.length];
        int startFrom = 1;
        int i = 0;
        loop: for (; i + startFrom < str.length; i++) {
            int before = i - startFrom;
            int after = i + startFrom;
            while (before >= 0 && after < str.length
                    && str[before] == str[after]) {
                before--;
                after++;
            }
            before++;
            after--;
            res[i] = after - before + 1;
            for (int j = 1; j + i <= after; j++) {
                int toBePrefix = (i - j) - before;
                if (res[i - j] / 2 >= toBePrefix) {
                    startFrom = toBePrefix + 1;
                    i = i + j - 1;
                    continue loop;
                } else {
                    res[i + j] = res[i - j];
                }
            }
            startFrom = 1;
        }
        if (i < str.length) {
            res[i] = 2 * (startFrom - 1) + 1;
        }
        for (int j = 1; i + j < str.length; j++) {
            res[i + j] = Math.min(res[i - j],
                    2 * (str.length - (i + j) - 1) + 1);
        }
        return res;
    }

    public static void main(String[] args) throws Exception {
        char[] str = next().toCharArray();
        char[] charAr = new char[str.length * 2 + 1];
        int idx = 0;
        for (int i = str.length - 1; i >= 0; i--) {
            charAr[idx++] = str[i];
        }
        charAr[idx++] = '#';
        for (int i = 0; i < str.length; i++) {
            charAr[idx++] = str[i];
        }
        int[] z = calc_z(charAr);
        int[] best = new int[str.length + 1];
        Arrays.fill(best,-1);
        int startFill = 1;
        for (int i = str.length + 1; i < z.length; i++) {
            if (z[i] >= startFill) {
                for (int j = startFill; j <= z[i]; j++) {
                    best[j] = i - str.length - 1;
                }
                startFill=z[i]+1;
            }
        }
        int[] longestOdd = longestOddPlaindrome(str);
        int maxLen = Integer.MIN_VALUE;
        ArrayList<Integer> res = new ArrayList<Integer>();
        for (int i = 0; i < str.length; i++) {
            int curLen = longestOdd[i];
            int l = 1, h = str.length - (i + longestOdd[i] / 2), mid;
            while (l < h) {
                mid = l + (h - l) / 2;
                if (best[mid]!=-1&&best[mid] + mid - 1 < i - (longestOdd[i] / 2)) {
                    l = mid + 1;
                } else {
                    h = mid;
                }
            }
            l--;
            curLen += 2 *l;
            if (curLen > maxLen) {
                maxLen = curLen;
                if (l == 0) {
                    res = new ArrayList<Integer>();
                    res.add(i);
                } else {
                    res = new ArrayList<Integer>();
                    res.add(best[l]);
                    res.add(i);
                    res.add(l);
                }
            }
        }
        System.out.println(res.size());
        if (res.size() == 1) {
            int start = res.get(0);
            int len = longestOdd[start];
            System.out.println((start - len / 2 + 1) + " " + len);
        } else {
            int st = res.get(0);
            int mid = res.get(1);
            int len = res.get(2);
            System.out.println((st + 1) + " " + len);
            System.out.println((mid - longestOdd[mid] / 2 + 1) + " "
                    + longestOdd[mid]);
            System.out.println((str.length - len + 1) + " " + len);
        }
    }
}