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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.*;

public class Main implements Runnable {
	private static final int INF = Integer.MAX_VALUE;
	private boolean _READ_FROM_FILE = false; //System.getSecurityManager() == null; //System.getProperty("ONLINE_JUDGE") == null;
	private boolean _WRITE_TO_FILE = false;
	static final String _TASK_ID = "in";
	static final String _IN_FILE = _TASK_ID + ".in";
	static final String _OUT_FILE = _TASK_ID + ".out";
	BufferedReader reader;
	StringTokenizer tokenizer;

	private void core() throws Exception {
		String input = nextToken();
		int[] endSuffix = buildEndSuffix(input);
		int[] palin = buildPalin(input);

		int best = 0;
		int[][] res = null;
		for (int i = 0; i < palin.length; i++) {
			int l = i - palin[i] + 1;
			int r = i + palin[i] - 1;
			int s = find(0, palin.length - 1 - r, endSuffix, l - 1);
			if (2 * s + (r - l + 1) > best) {
				best = 2 * s + (r - l + 1);
				if (s != 0) {
					res = new int[3][2];
					res[0][0] = endSuffix[s] - s + 1;
					res[0][1] = s;
					res[1][0] = l;
					res[1][1] = r - l + 1;
					res[2][0] = palin.length - s;
					res[2][1] = s;
				}
				else {
					res = new int[1][2];
					res[0][0] = l;
					res[0][1] = r - l + 1;
				}
			}
		}
		System.out.println(res.length);
		for (int[] is : res) {
			System.out.println((is[0]+1) + " " + is[1]);
		}
	}
	private int find(int d, int u, int[] endSuffix, int max) {
		if (d == u) return d;
		int m = (d + u + 1) / 2;
		if (endSuffix[m] <= max)
			return find(m, u, endSuffix, max);
		else
			return find(d, m - 1, endSuffix, max);
	}
	private int[] buildPalin(String input) {
		char[] c = input.toCharArray();
		int[] palin = new int[c.length];
		int l = 0, r = -1;
		for (int i = 0; i < palin.length; i++) {
			int j = i > r ? 1 : Math.min(r - i + 1, palin[l + r - i]);
			while(i + j < palin.length && i - j >= 0 && c[i + j] == c[i - j])
				++j;
			palin[i] = j;
			if (i + palin[i] - 1 > r) {
				r = i + palin[i] - 1;
				l = i - palin[i] + 1;
			}
		}
		return palin;
	}
	private int[] buildEndSuffix(String input) {
		int len = input.length();
		input = reverse(input) + "#" + input;
		int[] pi = prefixFunction(input);
		int[] endSuffix = new int[len+1];
		Arrays.fill(endSuffix, INF);
		endSuffix[0] = -1;
		for (int i = len + 1; i < pi.length; i++) {
			int now = pi[i];
			if (endSuffix[now + 1] == INF)
				endSuffix[now + 1] = i - (len + 1);
		}
		return endSuffix;
	}
	private int[] prefixFunction(String input) {
		char[] c = input.toCharArray();
		int[] pi = new int[c.length];
		pi[0] = -1;
		for (int i = 1; i < pi.length; i++) {
			int j = pi[i - 1];
			while(j != -1 && c[i] != c[j + 1]) 
				j = pi[j];
			if (c[i] == c[j + 1]) 
				pi[i] = j + 1;
			else
				pi[i] = -1;
		}
		return pi;
	}
	private String reverse(String input) {
		char[] c = input.toCharArray();
		StringBuilder res = new StringBuilder();
		for (int i = c.length - 1; i >= 0; i--) {
			res.append(c[i]);
		}
		return res.toString();
	}
	void debug(Object...os) {
		System.out.println(Arrays.deepToString(os));
	}
	//--------------------- IO stuffs ---------------------
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(new Main());
        thread.start();
        thread.join();
    }
	public void run() {
        try {
        	reader = new BufferedReader(_READ_FROM_FILE ? new FileReader(_IN_FILE) : new InputStreamReader(System.in));
        	System.setOut(new PrintStream(new BufferedOutputStream(_WRITE_TO_FILE ? new FileOutputStream(_OUT_FILE) : System.out)));
            tokenizer = new StringTokenizer("");
            core();
            reader.close();
            System.out.flush();
            System.out.close();
            System.exit(0);
        } catch (Exception e) {
        	System.out.flush();
            e.printStackTrace();
            System.exit(1);
        }
    }
    int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }
    long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }
    double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
    String nextToken() throws Exception {
        while (!tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(reader.readLine());
        return tokenizer.nextToken();
    }
    boolean nextIsAvailable() throws Exception {
    	while (!tokenizer.hasMoreElements()) {
    		String line = reader.readLine();
    		if (line == null) return false;
    		tokenizer = new StringTokenizer(line);
    	}
    	return true;
    }
}