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;
int n;
char S[200006];
const int base = 137, ivb = 131276920;
const int P = 418254373;
int Pow(int x, int a) {
  int ret = 1;
  while (a) {
    if (a & 1) ret = ret * 1ll * x % P;
    x = x * 1ll * x % P, a >>= 1;
  }
  return ret;
}
char W[200006 << 1];
int len[200006];
void manacher() {
  for (int i = (1), iend = (n); i <= iend; ++i)
    W[i << 1] = S[i], W[i << 1 | 1] = '#';
  int N = n << 1 | 1;
  W[0] = '(', W[1] = '#', W[N + 1] = ')';
  int mx = 0, ps = 0;
  for (int i = (1), iend = (N); i <= iend; ++i) {
    len[i] = i > mx ? 1 : min(len[(ps << 1) - i], mx - i);
    while (W[i - len[i]] == W[i + len[i]]) ++len[i];
    if (i + len[i] > mx) mx = i + len[i], ps = i;
  }
}
int w[200006];
int has[200006];
int bs[200006], ib[200006];
int hs[200006], rhs[200006], pr[200006];
bool equa(int l, int r, int L, int R) {
  return (hs[r] - hs[l - 1] + P) * 1ll * ib[l - 1] % P ==
         (rhs[L] - rhs[R + 1] + P) * 1ll * ib[n - R] % P;
}
void solve() {
  scanf("%s", S + 1);
  n = strlen(S + 1);
  manacher();
  for (int i = (1), iend = (n); i <= iend; ++i) w[i] = len[i << 1] / 2 - 1;
  bs[0] = ib[0] = 1;
  for (int i = (1), iend = (n); i <= iend; ++i)
    bs[i] = bs[i - 1] * 1ll * base % P, ib[i] = ib[i - 1] * 1ll * ivb % P;
  int cur = 1;
  for (int i = (1), iend = (n); i <= iend; ++i)
    hs[i] = (hs[i - 1] + S[i] * 1ll * bs[i]) % P;
  for (int i = (n), iend = (1); i >= iend; --i)
    rhs[i] = (rhs[i + 1] + S[i] * 1ll * bs[n - i + 1]) % P;
  for (int i = (n), iend = (1); i >= iend; --i) {
    int l = n - i + 1;
    while (cur <= n && (cur < l || !equa(i, n, cur - l + 1, cur))) ++cur;
    pr[n - i + 1] = cur;
  }
  int as = 0;
  int p1, l1, p2, l2, p3;
  for (int i = (1), iend = (n); i <= iend; ++i) {
    int fr = i - w[i], tr = i + w[i];
    int s = (upper_bound(pr + 1, pr + 1 + n, fr - 1) - pr - 1);
    s = max(tr + 1, n - s + 1);
    if ((n - s + 1) * 2 + w[i] * 2 + 1 > as) {
      as = (n - s + 1) * 2 + w[i] * 2 + 1;
      p2 = i - w[i], l2 = w[i] * 2 + 1;
      if (s == n + 1) {
        p1 = p3 = 0;
      } else {
        l1 = n - s + 1;
        p1 = pr[n - s + 1] - l1 + 1, p3 = s;
      }
    }
  }
  if (!p1) {
    puts("1");
    cout << p2 << ' ' << l2 << endl;
  } else {
    puts("3");
    cout << p1 << ' ' << l1 << endl
         << p2 << ' ' << l2 << endl
         << p3 << ' ' << l1 << endl;
  }
}
signed main() { solve(); }