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 p1 = 233, p2 = 433, mod1 = 1000000007, mod2 = 1000000009;
char a[101010];
int p[101010], hsh1[101010], hsh2[101010], t1[101010], t2[101010];
int mx[100101][25], pll[101001][25];
int ans, pl1, pl2, pl3, pl, n;
void geths(int l, int r, int &hs1, int &hs2) {
  hs1 = (hsh1[r] - (long long)hsh1[l - 1] * t1[r - l + 1] % mod1 + mod1) % mod1;
  hs2 = (hsh2[r] - (long long)hsh2[l - 1] * t2[r - l + 1] % mod2 + mod2) % mod2;
}
void manacher(int n) {
  int id, mx, i, j;
  id = 1, mx = 1, ans = p[1] = 1;
  pl2 = 1;
  for (i = 2; i <= n; i++) {
    j = id + id - i;
    if (i < mx) p[i] = min(p[j], mx - i + 1);
    while (i - p[i] > 0 && i + p[i] <= n && a[i + p[i]] == a[i - p[i]]) p[i]++;
    if (i + p[i] - 1 > mx) mx = i + p[i] - 1, id = i;
    if (p[i] + p[i] - 1 > ans) ans = p[i] + p[i] - 1, pl2 = i;
  }
}
int querymax(int l, int r) {
  int tmp;
  tmp = log2(r - l + 1);
  pl = mx[l][tmp] > mx[r - (1 << tmp) + 1][tmp] ? pll[l][tmp]
                                                : pll[r - (1 << tmp) + 1][tmp];
  return max(mx[l][tmp], mx[r - (1 << tmp) + 1][tmp]);
}
int main() {
  int i, j, hss1, hss2, l, l1, r1, ll, rr, sum, h1, h2, tmp;
  scanf("%s", a + 1);
  n = strlen(a + 1);
  t1[0] = 1, t2[0] = 1;
  for (i = 1; i <= n; i++) {
    hsh1[i] = ((long long)hsh1[i - 1] * p1 + a[i] - 'a' + 1) % mod1;
    hsh2[i] = ((long long)hsh2[i - 1] * p2 + a[i] - 'a' + 1) % mod2;
    t1[i] = (long long)t1[i - 1] * p1 % mod1;
    t2[i] = (long long)t2[i - 1] * p2 % mod2;
  }
  manacher(n);
  for (i = 1; i <= n; i++) mx[i][0] = p[i], pll[i][0] = i;
  for (j = 1; j <= 20; j++)
    for (i = 1; i + (1 << j - 1) <= n; i++) {
      mx[i][j] = max(mx[i][j - 1], mx[i + (1 << j - 1)][j - 1]);
      pll[i][j] = mx[i][j - 1] > mx[i + (1 << j - 1)][j - 1]
                      ? pll[i][j - 1]
                      : pll[i + (1 << j - 1)][j - 1];
    }
  tmp = 1, hss1 = 0, hss2 = 0, l = 0;
  for (i = n; i >= 1; i--) {
    hss1 = ((long long)hss1 * p1 + a[i] - 'a' + 1) % mod1;
    hss2 = ((long long)hss2 * p2 + a[i] - 'a' + 1) % mod2;
    l++;
    while (tmp <= n) {
      if (tmp + l - 1 >= i) break;
      geths(tmp, tmp + l - 1, h1, h2);
      if (h1 == hss1 && h2 == hss2) break;
      tmp++;
    }
    if (tmp + l - 1 >= i) break;
    l1 = tmp + l - 1, r1 = i;
    ll = 1, rr = (r1 - l1) / 2;
    while (ll <= rr) {
      int mid = ll + rr >> 1;
      if (querymax(l1 + mid, r1 - mid) >= mid)
        ll = mid + 1;
      else
        rr = mid - 1;
    }
    querymax(l1 + rr, r1 - rr);
    if (rr * 2 - 1 + l + l > ans)
      ans = rr * 2 - 1 + l + l, pl1 = tmp, pl2 = pl, pl3 = i;
  }
  sum = 0;
  if (pl1 != 0) sum++;
  if (pl2 != 0) sum++;
  if (pl3 != 0) sum++;
  printf("%d\n", sum);
  if (pl1 != 0) printf("%d %d\n", pl1, n - pl3 + 1);
  if (pl2 != 0) printf("%d %d\n", pl2 - p[pl2] + 1, p[pl2] * 2 - 1);
  if (pl3 != 0) printf("%d %d\n", pl3, n - pl3 + 1);
  return 0;
}