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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
import java.io.IOException;
import java.util.Deque;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.LinkedList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        r30E solver = new r30E();
        solver.solve(1, in, out);
        out.close();
    }

    static class r30E {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            String s = in.ns();
            int n = s.length();

            String sp = s + new StringBuilder().append(s).reverse();
            int logN = 0;
            int spn = 2 * n;
//        System.out.println("spn = " + spn);
            while ((1 << logN) < spn) {
                logN++;
            }
//        System.out.println("logN = " + logN);
            String ps = new StringBuilder().append(s).reverse() + s;
            int[] z = StringUtil.z(ps);
            int[] best = new int[n];
            int[] bestIdx = new int[n];
            Arrays.fill(bestIdx, -1);
            Deque<Pair> dq = new LinkedList<>();
            for (int i = 0; i < n; i++) {
                while (!dq.isEmpty() && dq.peekLast().a + dq.peekLast().b - 1 < i) {
                    dq.pollLast();
                }
                if (z[i + n] != 0) {
                    dq.addFirst(new Pair(i, z[i + n]));
                }
                if (!dq.isEmpty() && (i == 0 || i - dq.peekLast().a + 1 > best[i - 1])) {
                    best[i] = i - dq.peekLast().a + 1;
                    bestIdx[i] = dq.peekLast().a;
                } else if (i != 0) {
                    best[i] = best[i - 1];
                    bestIdx[i] = bestIdx[i - 1];
                }

            }
            int[] p = new int[spn];
            int[][] c = StringUtil.lcpArray(sp, logN, p);
            int bestAns = 0;
            int bestMidFrom = 0;
            int bestMidLen = 0;
            int rightLen = -1;
            int leftStart = -1;
            for (int i = 0; i < n; i++) {
                int len = StringUtil.lcp(i, 2 * n - i - 1, logN, 2 * n, c);

                int left = i - len + 1;
                int right = i + len - 1;
                if (left <= 0 || right >= n - 1 || best[left - 1] == 0) {
                    len = Math.min(len, i + 1);
                    len = Math.min(len, n - i);
                    left = i - len + 1;
                    len = len * 2 - 1;
                    if (len > bestAns) {
//                    System.out.println("i = " + i);
//                    System.out.println("len = " + len);
                        bestAns = len;
                        bestMidFrom = left;
                        bestMidLen = len;
                        rightLen = leftStart = -1;
                    }
                } else {
                    int leftLen = best[left - 1];
                    leftLen = Math.min(leftLen, n - 1 - right);
                    if (leftLen * 2 + 2 * len - 1 > bestAns) {
                        bestAns = leftLen * 2 + 2 * len - 1;
                        bestMidFrom = left;
                        bestMidLen = len * 2 - 1;
                        rightLen = leftLen;
                        leftStart = bestIdx[left - 1];
                    }
                }

            }
            if (rightLen == -1) {
                out.println(1);
                out.println((bestMidFrom + 1) + " " + bestMidLen);
            } else {
                out.println(3);
                out.println((leftStart + 1) + " " + rightLen);
                out.println((bestMidFrom + 1) + " " + bestMidLen);
                out.println((n - rightLen + 1) + " " + rightLen);
            }
        }

        class Pair {
            int a;
            int b;

            public Pair(int a, int b) {
                this.a = a;
                this.b = b;
            }

        }

    }

    static class StringUtil {
        public static int[] z(String s) {
            int[] z = new int[s.length()];
            int l = 0, r = 0;
            int j;
            z[0] = s.length();
            for (int i = 1; i < s.length(); i++)
                if (i > r) {
                    for (j = 0; ((j + i) < s.length()) && (s.charAt(i + j) == s.charAt(j)); j++) ;
                    z[i] = j;
                    l = i;
                    r = i + j - 1;
                } else if (z[i - l] < r - i + 1)
                    z[i] = z[i - l];
                else {
                    for (j = 1; ((j + r) < s.length()) && (s.charAt(r + j) == s.charAt(r - i + j)); j++) ;
                    z[i] = r - i + j;
                    l = i;
                    r = r + j - 1;
                }
            return z;
        }

        public static int[][] lcpArray(String s, int logN, int[] p) {
            int n = s.length();
            int abc = 256;
            int[][] c = new int[logN + 1][n];
            int[] cnt = new int[Math.max(n, abc)];
            for (int i = 0; i < n; i++) {
                cnt[s.charAt(i)]++;
            }
            for (int i = 1; i < abc; i++) {
                cnt[i] += cnt[i - 1];
            }
            for (int i = 0; i < n; i++) {
                p[--cnt[s.charAt(i)]] = i;
            }
            int classes = 1;
            for (int i = 1; i < n; i++) {
                if (s.charAt(p[i]) != s.charAt(p[i - 1]))
                    classes++;
                c[0][p[i]] = classes - 1;
            }

            int[] pn = new int[n];

            for (int log = 0; (1 << log) < n; log++) {
                int len = 1 << log;
                for (int i = 0; i < n; i++) {
                    pn[i] = p[i] - len;
                    if (pn[i] < 0) pn[i] += n;
                }
                Arrays.fill(cnt, 0);
                for (int i = 0; i < n; i++) {
                    cnt[c[log][pn[i]]]++;
                }
                for (int i = 1; i < classes; i++) {
                    cnt[i] += cnt[i - 1];
                }
                for (int i = n - 1; i >= 0; i--) {
                    p[--cnt[c[log][pn[i]]]] = pn[i];
                }
                c[log + 1][p[0]] = 0;
                classes = 1;
                for (int i = 1; i < n; i++) {
                    if (c[log][p[i]] != c[log][p[i - 1]] || c[log][(p[i] + len) % n] != c[log][(p[i - 1] + len) % n])
                        classes++;
                    c[log + 1][p[i]] = classes - 1;
                }
            }
            return c;
        }

        public static int lcp(int i, int j, int logN, int n, int[][] c) {
            int ans = 0;
            int maxAns = Math.min(n - i, n - j);
            for (int k = logN; k >= 0 && i < n && j < n; k--) {
                if (c[k][i] == c[k][j]) {
                    ans += 1 << k;
                    i += 1 << k;
                    j += 1 << k;
                }
            }
            ans = Math.min(ans, maxAns);
            return ans;
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

    }
}