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 base = 13331;
const int inf = 1000000000;
const int modulo1 = 1000000007;
const int modulo2 = 1000000009;
int a[100000], b[100000], minl[100001], maxr[100001];
long long hash1[200002], hash2[200002], pow1[20], pow2[20];
char str[200002];
int lcp(int a, int b, int tot) {
  int lg = 0;
  while (1 << lg <= tot - a && 1 << lg <= tot - b) lg++;
  int res = 0;
  for (int i = lg - 1; i >= 0; i--) {
    if (a + (1 << i) > tot || b + (1 << i) > tot) continue;
    long long t1 =
        ((hash1[a + (1 << i)] - hash1[a] * pow1[i]) % modulo1 + modulo1) %
        modulo1;
    long long t2 =
        ((hash1[b + (1 << i)] - hash1[b] * pow1[i]) % modulo1 + modulo1) %
        modulo1;
    long long t3 =
        ((hash2[a + (1 << i)] - hash2[a] * pow2[i]) % modulo2 + modulo2) %
        modulo2;
    long long t4 =
        ((hash2[b + (1 << i)] - hash2[b] * pow2[i]) % modulo2 + modulo2) %
        modulo2;
    if (t1 == t2 && t3 == t4) {
      a += 1 << i;
      b += 1 << i;
      res += 1 << i;
    }
  }
  return res;
}
int main() {
  scanf("%s", str);
  int len = strlen(str);
  str[len] = 1;
  int tot = len + 1;
  for (int i = len - 1; i >= 0; i--) str[tot++] = str[i];
  str[tot++] = 0;
  hash1[0] = hash2[0] = 0;
  for (int i = 0; i < tot; i++) {
    hash1[i + 1] = (hash1[i] * base + str[i]) % modulo1;
    hash2[i + 1] = (hash2[i] * base + str[i]) % modulo2;
  }
  pow1[0] = pow2[0] = base;
  for (int i = 1; i < 20; i++) {
    pow1[i] = pow1[i - 1] * pow1[i - 1] % modulo1;
    pow2[i] = pow2[i - 1] * pow2[i - 1] % modulo2;
  }
  int ans = 0, p1 = -1, p2 = -1, l = 0;
  for (int i = 0; i <= len; i++) {
    maxr[i] = 0;
    minl[i] = inf;
  }
  for (int i = 0; i < len; i++) {
    a[i] = lcp(i, len + 1, tot);
    minl[i + a[i]] = min(minl[i + a[i]], i);
    b[i] = lcp(i, 2 * len - i, tot);
    int x = i + 1 - b[i], y = i + b[i];
    maxr[x] = max(maxr[x], y);
    if (y - x > ans) {
      ans = y - x;
      p2 = x;
    }
  }
  int maxv = 0, loc = -1, j = 0;
  for (int i = 0; i < len; i++) {
    while (j < i && j + a[j] < i) j++;
    if (minl[i] < inf && i - minl[i] > maxv) {
      maxv = i - minl[i];
      loc = minl[i];
    }
    int tmp = min(len - maxr[i], maxv);
    if (tmp > 0 && tmp * 2 + maxr[i] - i > ans) {
      ans = tmp * 2 + maxr[i] - i;
      p1 = loc;
      p2 = i;
      l = tmp;
    }
    tmp = min(len - maxr[i], i - j);
    if (tmp > 0 && tmp * 2 + maxr[i] - i > ans) {
      ans = tmp * 2 + maxr[i] - i;
      p1 = j;
      p2 = i;
      l = tmp;
    }
  }
  if (l == 0) {
    printf("1\n");
    printf("%d %d\n", p2 + 1, ans);
  } else {
    printf("3\n");
    printf("%d %d\n", p1 + 1, l);
    printf("%d %d\n", p2 + 1, ans - l * 2);
    printf("%d %d\n", len - l + 1, l);
  }
  return 0;
}