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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
char S[MAXN];
char RevS[MAXN];
int Slen;
char MS[2 * MAXN];
int MSlen;
int Palindrome[2 * MAXN];
int SMatch[MAXN];
int SMatchAid[MAXN];
int SMatchMaxPos[MAXN];
int ans;
int ansarrlen;
int ansarr[3][2];
void ManacherInit(char *from, char *to, int len) {
  to[0] = '@';
  for (int i = 0; i < len; i++) to[2 * i + 1] = '#', to[2 * i + 2] = from[i];
  to[2 * len + 1] = '#';
  to[2 * len + 2] = '$';
  to[2 * len + 3] = '\0';
  return;
}
void Manacher(char *st, int *palindrom, int len) {
  int mx = 0, ans = 0, po = 0;
  for (int i = 1; i <= len; i++) {
    if (mx > i)
      palindrom[i] = min(mx - i, palindrom[2 * po - i]);
    else
      palindrom[i] = 1;
    while (st[i - palindrom[i]] == st[i + palindrom[i]]) palindrom[i]++;
    if (palindrom[i] + i > mx) {
      mx = palindrom[i] + i;
      po = i;
    }
  }
  return;
}
void ReverseString(char *dst, char *src, int len) {
  for (int i = 0; i < len; i++) dst[len - 1 - i] = src[i];
  dst[len] = '\0';
  return;
}
void KMP(char *A, char *B, int len, int *match, int *aid) {
  int i = 0, j = -1;
  aid[0] = -1;
  while (i < len) {
    if (j == -1 || B[i] == B[j]) {
      i++;
      j++;
      aid[i] = j;
    } else
      j = aid[j];
  }
  i = j = 0;
  while (i < len && j < len) {
    if (j == -1 || A[i] == B[j])
      i++, j++, match[i - 1] = j;
    else
      j = aid[j];
  }
  return;
}
void CalcMaxMatchPos() {
  SMatchMaxPos[0] = 0;
  for (int i = 1; i < Slen; i++)
    if (SMatch[i] > SMatch[SMatchMaxPos[i - 1]])
      SMatchMaxPos[i] = i;
    else
      SMatchMaxPos[i] = SMatchMaxPos[i - 1];
  return;
}
void IteratePalindrome() {
  int l, r, palinlen;
  int matchlen, nowlen;
  ans = 0;
  for (int i = 0; i < Slen; i++) {
    palinlen = (Palindrome[2 * i + 2] - 1) / 2;
    l = i - palinlen;
    r = i + palinlen;
    if (l > 0)
      matchlen = min(SMatch[SMatchMaxPos[l - 1]], Slen - 1 - r);
    else
      matchlen = 0;
    nowlen = palinlen * 2 + 1 + matchlen * 2;
    if (nowlen > ans) {
      ans = nowlen;
      if (matchlen == 0) {
        ansarrlen = 1;
        ansarr[0][0] = l + 1;
        ansarr[0][1] = 2 * palinlen + 1;
      } else {
        ansarrlen = 3;
        ansarr[0][0] =
            SMatchMaxPos[l - 1] - SMatch[SMatchMaxPos[l - 1]] + 1 + 1;
        ansarr[0][1] = matchlen;
        ansarr[1][0] = l + 1;
        ansarr[1][1] = 2 * palinlen + 1;
        ansarr[2][0] = Slen - matchlen + 1;
        ansarr[2][1] = matchlen;
      }
    }
  }
  return;
}
int main() {
  scanf("%s", S);
  Slen = strlen(S);
  MSlen = Slen * 2 + 1;
  ManacherInit(S, MS, Slen);
  Manacher(MS, Palindrome, MSlen);
  ReverseString(RevS, S, Slen);
  KMP(S, RevS, Slen, SMatch, SMatchAid);
  CalcMaxMatchPos();
  IteratePalindrome();
  printf("%d\n", ansarrlen);
  for (int i = 0; i < ansarrlen; i++)
    printf("%d %d\n", ansarr[i][0], ansarr[i][1]);
  return 0;
}