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 MOD = 1e9 + 7;
const long long LINF = 2e16;
const int INF = 2e9;
const int magic = 348;
const double eps = 1e-10;
const double pi = 3.14159265;
inline int getint() {
  char ch;
  int res;
  bool f;
  while (!isdigit(ch = getchar()) && ch != '-') {
  }
  if (ch == '-')
    f = false, res = 0;
  else
    f = true, res = ch - '0';
  while (isdigit(ch = getchar())) res = res * 10 + ch - '0';
  return f ? res : -res;
}
int len, slen;
char s[300048], ss[300048];
int RL[300048], maxright, pos, maxlen[300048], mlen[300048], minpos[300048];
int fail[300048];
int f[300048];
void getfail() {
  int k = -1, j = 0;
  fail[0] = -1;
  while (j <= slen) {
    if (k == -1 || ss[j + 1] == ss[k + 1])
      fail[++j] = ++k;
    else
      k = fail[k];
  }
}
void getRL() {
  memset(ss, '\0', sizeof(ss));
  int i, cur = 1;
  for (i = 1; i <= len; i++) {
    ss[cur++] = '#';
    ss[cur++] = s[i];
  }
  ss[cur] = '#';
  slen = cur;
  maxright = pos = 0;
  for (i = 1; i <= slen; i++) {
    if (i < maxright)
      RL[i] = min(maxright - i, RL[2 * pos - i]);
    else
      RL[i] = 1;
    while (i - RL[i] >= 1 && i + RL[i] <= slen &&
           ss[i - RL[i]] == ss[i + RL[i]])
      RL[i]++;
    if (i + RL[i] > maxright) {
      maxright = i + RL[i];
      pos = i;
    }
  }
}
int main() {
  int i, j;
  scanf("%s", s + 1);
  len = strlen(s + 1);
  for (i = 1; i <= len; i++) ss[i] = s[len - i + 1];
  ss[len + 1] = '$';
  for (i = len + 2; i <= len + 2 + len - 1; i++) ss[i] = s[i - len - 1];
  slen = strlen(ss + 1);
  getfail();
  for (i = len + 2; i <= slen; i++)
    mlen[i - len - 1 - fail[i] + 1] =
        max(mlen[i - len - 1 - fail[i] + 1], fail[i]);
  for (i = 1; i <= len; i++)
    for (j = mlen[i]; j >= 1 && !minpos[j]; j--) minpos[j] = i;
  getRL();
  for (i = 1; i <= slen; i++)
    if (ss[i] != '#') maxlen[i / 2] = RL[i] - 1;
  for (i = len; i >= 1; i--)
    if (minpos[i])
      for (j = minpos[i] + i; j <= len && !f[j]; j++) f[j] = i;
  pair<int, int> ans1 = make_pair(-1, -1), ans2 = make_pair(-1, -1),
                 ans3 = make_pair(-1, -1);
  int anslen = 0;
  for (i = 1; i <= len; i++) {
    int ll = i - (maxlen[i] - 1) / 2, rr = i + (maxlen[i] - 1) / 2;
    int add = min(len - rr, f[ll]);
    if (maxlen[i] + add + add > anslen) {
      anslen = maxlen[i] + add + add;
      ans2 = make_pair(i - (maxlen[i] - 1) / 2, maxlen[i]);
      if (add) {
        ans1 = make_pair(minpos[add], add);
        ans3 = make_pair(len - add + 1, add);
      } else
        ans1 = ans3 = make_pair(-1, -1);
    }
  }
  if (ans1.first == -1) {
    printf("1\n");
    printf("%d %d\n", ans2.first, ans2.second);
  } else {
    printf("3\n");
    printf("%d %d\n", ans1.first, ans1.second);
    printf("%d %d\n", ans2.first, ans2.second);
    printf("%d %d\n", ans3.first, ans3.second);
  }
  return 0;
}