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;
mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T>
inline void chkmax(T &x, T y) {
  if (x < y) x = y;
}
template <typename T>
inline void chkmin(T &x, T y) {
  if (x > y) x = y;
}
inline int read() {
  int x = 0;
  char c = getchar();
  while (c < 48) c = getchar();
  while (c > 47) x = x * 10 + (c ^ 48), c = getchar();
  return x;
}
const int maxn = 1e5 + 10;
int n;
char A[maxn], B[maxn];
int ext[maxn << 1];
int nxt[maxn], app[maxn];
namespace RMQ {
int lg[maxn], pos[17][maxn];
int query(int l, int r) {
  int k = lg[r - l + 1];
  int x = pos[k][l], y = pos[k][r - (1 << k) + 1];
  return ext[x] < ext[y] ? y : x;
}
void build(int *A) {
  for (int i = (1), iend = (n); i <= iend; ++i) pos[0][i] = i;
  for (int i = (2), iend = (n); i <= iend; ++i) lg[i] = lg[i >> 1] + 1;
  for (int i = (1), iend = (16); i <= iend; ++i)
    for (int j = (1), jend = (n - (1 << i) + 1); j <= jend; ++j) {
      int x = pos[i - 1][j], y = pos[i - 1][j + (1 << (i - 1))];
      pos[i][j] = A[x] < A[y] ? y : x;
    }
}
}  // namespace RMQ
void manacher() {
  static char str[maxn << 1];
  int len = n + n + 1;
  str[1] = '#', str[0] = '!';
  for (int i = (1), iend = (n); i <= iend; ++i)
    str[i * 2] = A[i], str[i * 2 + 1] = '#';
  int pos = 0, mx = 0;
  for (int i = (1), iend = (len); i <= iend; ++i) {
    if (i <= mx) ext[i] = min(ext[2 * pos - i], mx - i);
    while (str[i - ext[i]] == str[i + ext[i]]) ext[i]++;
    if (i + ext[i] > mx) mx = i + ext[i], pos = i;
  }
  for (int i = (1), iend = (n); i <= iend; ++i) ext[i] = ext[i * 2] / 2;
}
void solve() {
  scanf("%s", A + 1);
  n = strlen(A + 1);
  memcpy(B, A, sizeof A);
  reverse(B + 1, B + n + 1);
  for (int i = 2, j = 0; i <= n; i++) {
    while (j && B[i] != B[j + 1]) j = nxt[j];
    nxt[i] = j += B[i] == B[j + 1];
  }
  for (int i = 1, j = 0; i <= n; i++) {
    while (j && A[i] != B[j + 1]) j = nxt[j];
    j += A[i] == B[j + 1];
    if (!app[j]) app[j] = i;
  }
  manacher();
  RMQ::build(ext);
  int res = 0;
  int ansflgpos = -1;
  for (int i = (1), iend = (n); i <= iend; ++i) {
    if (res < ext[i] * 2 - 1) res = 2 * ext[i] - 1, ansflgpos = i;
  }
  int l1, r1, l2, r2, l3, r3;
  for (int i = (1), iend = (n); i <= iend; ++i)
    if (app[i]) {
      int rpos = n - i, lpos = app[i] + 1;
      if (lpos > rpos) break;
      int l = 1, r = (rpos - lpos) / 2 + 1;
      while (l < r) {
        int mid = (l + r + 1) >> 1;
        int pos = RMQ::query(lpos + mid - 1, rpos - mid + 1);
        ext[pos] >= mid ? l = mid : r = mid - 1;
      }
      int pos = RMQ::query(lpos + r - 1, rpos - r + 1);
      if (res < 2 * i + 2 * r - 1) {
        ansflgpos = -1;
        res = 2 * i + 2 * r - 1;
        l1 = app[i] - i + 1, r1 = app[i];
        l2 = pos - r + 1, r2 = pos + r - 1;
        l3 = n - i + 1, r3 = n;
      }
    }
  if (ansflgpos != -1) {
    printf("1\n%d %d\n", ansflgpos - ext[ansflgpos] + 1, res);
  } else {
    printf("3\n%d %d\n%d %d\n%d %d\n", l1, r1 - l1 + 1, l2, r2 - l2 + 1, l3,
           r3 - l3 + 1);
  }
}
int main() {
  solve();
  return 0;
}