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.util.Scanner;

public class Main {

	public static char[] chs;
	public static char[] p;
	
	public static int[] rad=new int[200000];//manacher算法用到的回文半径数组
	
	private static int[] m=new int[200000];
	
	private static int[] max_m=new int[200000];
	
	public static int[] next=new int[200000];//kmp算法next数组
	
	//xabyczba
	
	//axbya
	
	//abacaba
	
	//abbabab
	
	//dfserfvbbbdddvbbbobifdppplpppewibo
	
	//dfserfvbbbdddvbbbobifdppplpppewibodfserfvbbbdddvbbbobifdppplpppewibodfserfvbbbdddvbbbobifdppplpppewibo
	
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner scn=new Scanner(System.in);
		String s=scn.next();
		chs=s.toCharArray();		
		StringBuffer sb=new StringBuffer(s);
		sb.reverse();//逆置
		p=sb.toString().toCharArray();
		scn.close();
		
//		for(int i=0;i<chs.length;i++){
//			System.out.printf("%3d", i);
//		}
//		
//		System.out.println();		
//
//		for(int i=0;i<chs.length;i++){
//			System.out.printf("%3c", chs[i]);
//		}
//		
//		System.out.println();
	
		solve();

	}
	
	private static void solve() {
		// TODO Auto-generated method stub
		
		int preIndex=0,preLen=0;
		int midIndex=0,midLen=0;
		int sufIndex=0,sufLen=0;
				
		manacher();


//		for(int i=0;i<chs.length;i++){
//			System.out.printf("%3d", rad[i]);
//		}
//		
//		System.out.println();
		getNext();
	
		kmp();
		
		max_m[0]=0;

		for (int i = 1; i< chs.length; i++){
			if(m[i]>m[max_m[i-1]]){
				max_m[i]=i;
			}else{
				max_m[i]=max_m[i-1];
			}
		}
		
		for (int i = 0; i < chs.length; i++) {
			
			int left=i-rad[i]+1;
			int right=i+rad[i]-1;			
			
			int L=0;
			if(left>0){
				L=min(m[max_m[left-1]], chs.length-right-1);
			}
			
			if(2*L+2*rad[i]-1>preLen+midLen+sufLen){

				preIndex=left==0?0:max_m[left-1]-m[max_m[left-1]]+1;				
				preLen=L;
				
				midIndex=left;
				midLen=2*rad[i]-1;
				
				sufIndex=chs.length-L;
				sufLen=L;

			}
			
		}
		
		if(preLen==0){
			System.out.println(1);
			System.out.println((midIndex+1)+" "+midLen);			
		}else{
			System.out.println(3);
			System.out.println((preIndex+1)+" "+preLen);			
			System.out.println((midIndex+1)+" "+midLen);			
			System.out.println((sufIndex+1)+" "+sufLen);			
		}
		
	}
	
	private static void kmp() {
		// TODO Auto-generated method stub
		
		int i=0,j=0;
		
		while(i<chs.length){
			
			if(j==-1||chs[i]==p[j]){
				m[i]=j+1;
				j++;		
				i++;
			}else{
				j=next[j];
			}
			
		}
		
	}
	
	public static void getNext(){
		
		int i=0;
		int j=1;
		next[0]=-1;
		next[1]=0;
		while(j<p.length){
			if(i==-1||p[i]==p[j]){
				i++;
				j++;
				next[j]=i;
			}else{
				i=next[i];
			}
		}
		
	}
	
	public static void manacher(){
		
		int maxRight=0;
		int pos=0;
		
		for(int i=0;i<chs.length;i++){
//			System.out.println("pos = "+pos+" , maxRight = "+maxRight+" , i = "+i);
			if(i<=maxRight){
				rad[i]=min(rad[2*pos-i],maxRight-i+1);
			}else{
				rad[i]=1;
			}
			while(i-rad[i]>=0&&i+rad[i]<chs.length&&chs[i-rad[i]]==chs[i+rad[i]]){
				rad[i]++;
			}
			if(i+rad[i]>maxRight){
				pos=i;
				maxRight=i+rad[i]-1;
			}
			
		}
		
	}
	
	private static int min(int a,int b) {
		// TODO Auto-generated method stub
		return a<b?a:b;
	}
	
}