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 long long P1 = 1000007;
const long long P2 = 10000007;
const long long MOD = 100000007;
long long p1[100010], p2[100010];
struct Node {
  long long x, y;
  bool operator==(const Node &b) const { return x == b.x && y == b.y; }
};
void add(Node &a, int x) {
  a.x = (a.x * P1 + x) % MOD;
  a.y = (a.y * P2 + x) % MOD;
}
void Minn(Node &a, int x, int len) {
  a.x = (a.x - (x * p1[len]) % MOD + MOD) % MOD;
  a.y = (a.y - (x * p2[len]) % MOD + MOD) % MOD;
}
void init() {
  p1[0] = p2[0] = 1;
  for (int i = 1; i < 100010; i++) {
    p1[i] = (p1[i - 1] * P1) % MOD;
    p2[i] = (p2[i - 1] * P2) % MOD;
  }
}
int lL1[100010];
char s[100010], ts[200010];
int p[200010];
int cal(char *s) {
  int len = strlen(s);
  int cnt = 0;
  for (int i = 0; i < len; i++) {
    ts[cnt++] = '#';
    ts[cnt++] = s[i];
  }
  ts[cnt++] = '#';
  p[0] = 0;
  int a = 0, anss = 1;
  for (int i = 1; i < cnt; i++) {
    int low;
    if (p[a] + a < i)
      low = 0;
    else
      low = min(p[2 * a - i], 2 * a - i - (a - p[a]));
    int high = min(i, cnt - 1 - i);
    for (int j = low; j <= high; j++) {
      if (ts[i - j] == ts[i + j])
        p[i] = j;
      else
        break;
    }
    if (p[a] + a < p[i] + i) a = i;
    if (p[i] > anss) anss = p[i];
  }
  return anss;
}
bool ok(int mid, int ll, int len) {
  if (mid == 0) return true;
  int tl = lL1[len - mid];
  if (tl == -1) return false;
  if (tl + mid > ll) return false;
  return true;
}
int ansl[10], ansr[10];
int main() {
  init();
  while (scanf("%s", s) == 1) {
    int len = strlen(s), now = 0, tlen = 0;
    Node Hash1, Hash2;
    Hash1.x = Hash1.y = Hash2.x = Hash2.y = 0;
    for (int i = len - 1; i >= 0; i--) {
      if (now + tlen > i) {
        lL1[i] = -1;
        continue;
      }
      tlen++;
      int end = now + tlen - 1;
      add(Hash1, s[i]);
      add(Hash2, s[end]);
      bool find = false;
      while (now + tlen <= i && !find) {
        if (Hash1 == Hash2)
          find = true;
        else {
          Minn(Hash2, s[now], tlen - 1);
          now++;
          add(Hash2, s[now + tlen - 1]);
        }
      }
      if (!find)
        lL1[i] = -1;
      else
        lL1[i] = now;
    }
    cal(s);
    for (int i = 0; i < len; i++) p[i] = (p[i * 2 + 1] + 1) / 2;
    int ans = 0;
    for (int i = 0; i < len; i++) {
      int ll = i - p[i] + 1, rr = i + p[i] - 1;
      int L = 0, R = len - 1 - rr;
      while (L + 1 < R) {
        int mid = (L + R) / 2;
        if (ok(mid, ll, len))
          L = mid;
        else
          R = mid;
      }
      int tlen;
      if (ok(R, ll, len))
        tlen = R;
      else
        tlen = L;
      if (ans < tlen * 2 + rr - ll + 1) {
        ans = tlen * 2 + rr - ll + 1;
        ansl[1] = ll;
        ansr[1] = rr;
        if (tlen == 0) {
          ansl[0] = ansr[0] = -1;
          ansl[2] = ansr[2] = -1;
        } else {
          ansl[0] = lL1[len - tlen];
          ansr[0] = ansl[0] + tlen - 1;
          ansl[2] = len - tlen;
          ansr[2] = len - 1;
        }
      }
    }
    if (ansl[0] == -1) {
      puts("1");
      printf("%d %d\n", ansl[1] + 1, ansr[1] - ansl[1] + 1);
    } else {
      puts("3");
      for (int i = 0; i < 3; i++)
        printf("%d %d\n", ansl[i] + 1, ansr[i] - ansl[i] + 1);
    }
  }
  return 0;
}