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.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class Main {
	public static String in;
	public static int[] A, pre;
	public static int num;
	public static int maxlen;
	public static int[][] ret;
	public static class Pair {
		int a,b;
		Pair(int a, int b){
			this.a = a; this.b = b;
		}
	}
	public static void main(String[] arg) {
		FastScanner scan = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		maxlen = 0;
		in = scan.next();
		
		A = new int[in.length()];
		pre = new int[in.length()];
		manacher();
		kmp();

		int[] premax = new int[in.length()];
		premax[0] = 0;
		for(int i = 1; i < in.length(); i++){
			premax[i] = premax[i-1];
			if(pre[premax[i]] < pre[i]){
				premax[i] = i;
			}
		}
		
		int maxlen = 0;
		List<Pair> ret = new ArrayList<Pair>();
		for(int i = 0; i < in.length(); i++){
			int left = i - A[i];
			int right = i + A[i];
			int maxi = premax[left];
			if(maxi + pre[maxi] >= left || in.length() - pre[maxi] - 1 <= right){
				A[i] = A[i] - Math.max(Math.max(0,maxi+pre[maxi] - left), Math.max(0, right - (in.length() - pre[maxi] - 1)));
				left = i - A[i];
				right = i + A[i];
			}
			
			int midlen = right - left + 1;
			
			if(pre[maxi] > 0 && left >= maxi + pre[maxi] && right <= in.length() - pre[maxi] - 1){
				int len = midlen + pre[maxi] * 2;
				if(maxlen < len){
					maxlen = len;
					ret = new ArrayList<Pair>();
					ret.add(new Pair(maxi, pre[maxi]));
					ret.add(new Pair(i - A[i], A[i]*2+1));
					ret.add(new Pair(in.length() - pre[maxi], pre[maxi]));
				}
			} else {
				int len = 2 * A[i] + 1;
				if(maxlen < len){
					maxlen = len;
					ret = new ArrayList<Pair>();
					ret.add(new Pair(i - A[i], A[i] * 2 + 1));
				}
			}
		}
		out.println(ret.size());
		for(Pair p : ret){
			out.println(p.a+1 + " " + p.b);
		}
		out.close();
	}
	
	public static void manacher(){
		int r = 0, p = 0;
		for(int i = 1; i < in.length(); i++){
			if(i > r){
				A[i] = 0;
			} else {
				A[i] = Math.min(A[2 * p - i], r - i);
			}
			while(i - A[i] - 1 >= 0 && i + A[i] + 1 < in.length() && 
				in.charAt(i - A[i] - 1) == in.charAt(i + A[i] + 1)) A[i]++;
			if(r < i + A[i]){
				r = i + A[i];
				p = i;
			}
		}
	}

	public static void kmp() {
		StringBuilder inr = new StringBuilder();
		for(int i = in.length() - 1; i >= 0; i--) inr.append(in.charAt(i));
		
		int[] jump = new int[inr.length()];
		int i,k = 0;
		for(i = 1; i < inr.length(); i++){
			while(i + k < inr.length() && inr.charAt(i + k) == inr.charAt(k)) {
				jump[i+k] = k + 1;
				k++;
			}
			if(k > 0) i = i + k - 1;
			k = 0;
		}
		k = 0;
		for(i = 0; i < in.length(); i++){
			while(i + k < in.length() && in.charAt(i + k) == inr.charAt(k)) k++;
			if(i + k - 1 >= in.length() - k){
				pre[i] = (in.length() - i) / 2 - 1;
			} else pre[i] = k;
			if(k > 0) {
				i = i + k - jump[k - 1] - 1;
				k = jump[k - 1];
			}
		}
	}
	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;
 
		FastScanner(InputStream is) {
			try {
				br = new BufferedReader(new InputStreamReader(is));
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
 
		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					return null;
				}
			}
			return st.nextToken();
		}
	    
		String nextLine() {
	        try {
	            return br.readLine();
	        }
	        catch (Exception e) {
	            return null;
	        }
	    }
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		double nextDouble() {
			return Double.valueOf(next());
		}
	}
}