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;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar(), f = 0;
  for (; c < 48 || c > 59; c = getchar())
    if (!(c ^ 45)) f = 1;
  for (; c >= 48 && c <= 57; c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  f ? x = -x : 0;
}
struct Hash {
  unsigned hs1, hs2;
  inline char operator==(Hash b) const { return hs1 == b.hs1 && hs2 == b.hs2; }
  inline Hash operator+(Hash b) const {
    return (Hash){hs1 + b.hs1, hs2 + b.hs2};
  }
  inline Hash operator+(unsigned b) const { return (Hash){hs1 + b, hs2 + b}; }
  inline Hash operator-(Hash b) const {
    return (Hash){hs1 - b.hs1, hs2 - b.hs2};
  }
  inline Hash operator*(Hash b) const {
    return (Hash){hs1 * b.hs1, hs2 * b.hs2};
  }
} bas = {137ull, 1145141ull}, pw[100005], ph[100005], rh[100005];
int n, res = 0, mx[100005], wh[100005], rc[100005];
char a[100005];
inline Hash getp(int l, int r) { return ph[r] - ph[l - 1] * pw[r - l + 1]; }
inline Hash getr(int l, int r) { return rh[l] - rh[r + 1] * pw[r - l + 1]; }
int main() {
  scanf("%s", a + 1), n = strlen(a + 1), pw[0] = (Hash){1ull, 1ull};
  for (int i = 1; i <= n; i++)
    pw[i] = pw[i - 1] * bas, ph[i] = ph[i - 1] * bas + a[i];
  for (int i = n; i; i--) rh[i] = rh[i + 1] * bas + a[i];
  for (int i = 1; i <= n; i++) {
    int le = 0, ri = n - i + 1, rs = 0;
    while (le <= ri) {
      int md = (le + ri) >> 1;
      if (getp(i, i + md - 1) == getr(n - md + 1, n))
        rs = md, le = md + 1;
      else
        ri = md - 1;
    }
    if (mx[i + rs - 1] < rs) mx[i + rs - 1] = rs, wh[i + rs - 1] = i;
  }
  for (int i = n; i; i--)
    if (mx[i] < mx[i + 1] - 1) wh[i] = wh[i + 1], mx[i] = mx[i + 1] - 1;
  for (int i = 1; i <= n; i++)
    if (mx[i] < mx[i - 1]) mx[i] = mx[i - 1], wh[i] = wh[i - 1];
  for (int i = 1; i <= n; i++) {
    int le = 0, ri = min(i - 1, n - i), rs = 0;
    while (le <= ri) {
      int md = (le + ri) >> 1;
      if (getp(i - md, i) == getr(i, i + md))
        rs = md, le = md + 1;
      else
        ri = md - 1;
    }
    res = max(res, rs + min(mx[i - rs - 1], n - i - rs)), rc[i] = rs;
  }
  for (int i = 1; i <= n; i++)
    if (res == rc[i] + min(mx[i - rc[i] - 1], n - i - rc[i])) {
      if (min(mx[i - rc[i] - 1], n - i - rc[i]))
        puts("3");
      else
        return printf("1\n%d %d\n", i - rc[i], rc[i] << 1 | 1), 0;
      int qwq = min(mx[i - rc[i] - 1], n - i - rc[i]);
      return printf("%d %d\n%d %d\n%d %d\n", wh[i - rc[i] - 1], qwq, i - rc[i],
                    rc[i] << 1 | 1, n - qwq + 1, qwq),
             0;
    }
}