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>
const int N = 500010;
char s[N], t[N];
int p[N], zs[N];
void manacher(char *t, int *p) {
  int cnt = strlen(t);
  for (int i = 1, l = 0, r = -1; i < cnt; ++i) {
    int k = i > r ? 1 : std::min(p[l + r - i], r - i + 1);
    while (t[i + k] == t[i - k]) {
      ++k;
    }
    p[i] = k--;
    if (i + k > r) {
      l = i - k, r = i + k;
    }
  }
}
void ex_kmp(char *s, int *zs) {
  int n = strlen(s);
  memset(zs, 0, sizeof(*zs) * n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) zs[i] = std::min(zs[i - l], r - i + 1);
    while (i + zs[i] < n && s[i + zs[i]] == s[zs[i]]) ++zs[i];
    if (i + zs[i] - 1 > r) l = i, r = i + zs[i] - 1;
  }
}
using pii = std::pair<int, int>;
std::vector<pii> vec1[N], vec2[N];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  for (int i = n; i >= 1; --i) {
    t[i] = s[i - 1];
  }
  t[0] = '$';
  manacher(t, p);
  for (int i = 0; i < n; ++i) {
    p[i] = p[i + 1];
  }
  for (int i = 0; i < n; ++i) {
    t[i] = s[n - 1 - i];
    t[n + 1 + i] = s[i];
  }
  t[n] = '#';
  ex_kmp(t, zs);
  memcpy(zs, zs + n + 1, sizeof(zs[0]) * n);
  std::set<pii> set1, set2;
  for (int i = 0; i < n; ++i) {
    int pos = i + zs[i] - 1;
    vec1[pos].emplace_back(zs[i], i);
    set1.emplace(zs[i], i);
  }
  for (int i = 0; i < n; ++i) {
    int left = i - p[i] + 1, right = i + p[i] - 1;
    vec2[left].emplace_back(right, i);
  }
  int offset = 0, max = 0;
  pii ans1, ans2, ans3;
  for (int i = n - 1; i >= 0; --i, --offset) {
    for (auto p : vec1[i]) {
      set1.erase(p);
      int x = p.first - 1;
      set2.emplace(x - offset, p.second);
    }
    while (!set2.empty()) {
      auto u = set2.begin();
      if (u->first + offset <= 0) {
        set2.erase(u);
      } else {
        break;
      }
    }
    for (auto p : vec2[i]) {
      int mid = p.first - i + 1;
      if (mid > max) {
        max = mid;
        ans1 = {-1, -1};
        ans2 = {i, mid};
        ans3 = {-1, -1};
      }
      if (!set1.empty()) {
        auto u = std::prev(set1.end());
        int value = std::min(u->first, n - 1 - p.first);
        if (value > 0 && mid + 2 * value > max) {
          max = mid + 2 * value;
          ans1 = {u->second, value};
          ans2 = {i, mid};
          ans3 = {n - value, value};
        }
      }
      if (!set2.empty()) {
        auto u = std::prev(set2.end());
        int value = std::min(u->first + offset, n - 1 - p.first);
        if (value > 0 && mid + 2 * value > max) {
          max = mid + 2 * value;
          ans1 = {u->second, value};
          ans2 = {i, mid};
          ans3 = {n - value, value};
        }
      }
    }
  }
  if (ans1.first == -1) {
    printf("1\n%d %d\n", ans2.first + 1, ans2.second);
  } else {
    puts("3");
    printf("%d %d\n", ans1.first + 1, ans1.second);
    printf("%d %d\n", ans2.first + 1, ans2.second);
    printf("%d %d\n", ans3.first + 1, ans3.second);
  }
  return 0;
}