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 double PI = acos(-1.0);
const double EPS = 1e-8;
template <class T>
T abs(T a) {
  return a >= 0 ? a : -a;
}
template <class T>
T sqr(T a) {
  return a * a;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T mod(T a, T b) {
  return (a % b + b) % b;
}
template <class T>
T addmod(T a, T b, T c) {
  return (T)mod((long long)a + b, (long long)c);
}
template <class T>
T mulmod(T a, T b, T c) {
  return (T)mod((long long)a * b, (long long)c);
}
template <class T>
T powmod(T a, T b, T c) {
  return (T)mod(
      b ? mulmod(mod(sqr((long long)powmod(a, b >> 1, c)), (long long)c),
                 (b & 1LL) ? a : 1LL, (long long)c)
        : 1LL,
      (long long)c);
}
template <class T>
void maxe(T &a, T b) {
  a = max(a, b);
}
template <class T>
void mine(T &a, T b) {
  a = min(a, b);
}
template <class T>
void mode(T &a, T b) {
  a = mod(a, b);
}
template <class T>
void addmode(T &a, T b, T c) {
  a = addmod(a, b, c);
}
template <class T>
void mulmode(T &a, T b, T c) {
  a = mulmod(a, b, c);
}
template <class T>
void powmode(T &a, T b, T c) {
  a = powmod(a, b, c);
}
int iszero(double a) { return abs(a) <= EPS; }
template <class T>
void geti(T &a) {
  a = 0;
  long long b = 1;
  char c = getchar();
  if (c == '-')
    b = -1;
  else
    a = c - 48;
  while ((c = getchar()) != ' ' && c != '\n') a = a * 10 + c - 48;
  a *= b;
}
void fileio_in_out() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
void fileio_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
char s[100005];
int m[100005], pi[100005], pi1[100005], r[100005], in[100005];
int main() {
  gets(s + 1);
  int ln = strlen(s + 1);
  for (int i = 1, j = 1; i < ln + 1;) {
    while (i - (j - i) > 0 && j <= ln && s[j] == s[i - (j - i)])
      m[i] = j - i + 1, j++;
    int ni = i + 1;
    while (ni < j) {
      if (m[i - (ni - i)] != j - ni) {
        m[ni] = min(j - ni, m[i - (ni - i)]);
        ni++;
      } else {
        m[ni] = m[i - (ni - i)];
        break;
      }
    }
    i = ni;
  }
  pi[ln] = ln + 1;
  for (int i = ln - 1; i > 0; i--) {
    int j = i + 1;
    while (j < ln + 1 && s[i] != s[pi[j] - 1]) j = pi[j];
    if (j == ln + 1)
      pi[i] = ln + 1;
    else
      pi[i] = pi[j] - 1;
  }
  pi[ln + 1] = ln + 2;
  pi1[0] = ln + 1;
  for (int i = 1; i < (ln + 1); ++i) {
    int j = pi1[i - 1];
    while (j - 1 <= ln && s[i] != s[j - 1]) j = pi[j];
    if (j - 1 > ln)
      pi1[i] = ln + 1;
    else
      pi1[i] = j - 1;
  }
  for (int i = 1; i < (ln + 1); ++i) pi1[i] = ln + 1 - pi1[i];
  for (int i = 1; i < (ln + 1); ++i) {
    r[i] = max(pi1[i], r[i - 1]);
    if (pi1[i] > r[i - 1]) {
      r[i] = pi1[i];
      in[i] = i - pi1[i] + 1;
    } else {
      r[i] = r[i - 1];
      in[i] = in[i - 1];
    }
  }
  int mid = 0, mx = 0;
  for (int i = 1; i < (ln + 1); ++i) {
    int ml = m[i];
    int rest = min(r[i - m[i]], ln - (i + m[i] - 1));
    if (ml * 2 - 1 + rest * 2 > mx) {
      mx = ml * 2 - 1 + rest * 2;
      mid = i;
    }
  }
  int rest = min(r[mid - m[mid]], ln - (mid + m[mid] - 1));
  if (rest > 0) {
    cout << 3 << endl;
    cout << in[mid - m[mid]] << " " << rest << endl;
    cout << mid - m[mid] + 1 << " " << 2 * m[mid] - 1 << endl;
    cout << ln - rest + 1 << " " << rest << endl;
  } else {
    cout << 1 << endl;
    cout << mid - m[mid] + 1 << " " << 2 * m[mid] - 1 << endl;
  }
  return 0;
}