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 INF = 1e9 + 7;
const int maxn = 2e5 + 5;
const int logn = 22;
namespace SA {
int len;
int lcp[maxn], rk[maxn], sa[maxn], tmp[maxn], lg[maxn];
int st[maxn][logn];
char s[maxn];
pair<int, int> elm[maxn];
inline bool cmp(const int &i, const int &j) { return elm[i] < elm[j]; }
inline void calcSa() {
  for (int i = (0); i <= (len); ++i) sa[i] = i, rk[i] = s[i];
  for (int k = 1; k <= len; k <<= 1) {
    for (int i = (0); i <= (len); ++i)
      elm[i] = make_pair(rk[i], (i + k <= len) ? (rk[i + k]) : (-1));
    sort(sa, sa + len + 1, cmp);
    tmp[sa[0]] = 0;
    for (int i = (1); i <= (len); ++i)
      tmp[sa[i]] = tmp[sa[i - 1]] + cmp(sa[i - 1], sa[i]);
    for (int i = (0); i <= (len); ++i) rk[i] = tmp[i];
  }
  return;
}
inline void calcLcp() {
  int h = 0;
  lcp[0] = 0;
  for (int i = (0); i <= (len); ++i) {
    int j = sa[rk[i] - 1];
    for (h -= (h) ? (1) : (0);
         i + h < len && j + h < len && s[i + h] == s[j + h]; ++h)
      ;
    lcp[rk[i] - 1] = h;
  }
  return;
}
inline void calcRmq() {
  lg[1] = 0;
  for (int i = (2); i <= (len); ++i)
    lg[i] = lg[i - 1] + ((1 << (lg[i - 1] + 1)) <= i);
  for (int i = (0); i <= (len); ++i) st[i][0] = lcp[i];
  for (int j = (1); j < (logn); ++j) {
    for (int i = (0); i <= (len); ++i) {
      if (i + (1 << j) > len)
        st[i][j] = st[i][j - 1];
      else
        st[i][j] = min(st[i][j - 1], st[i + (1 << (j - 1))][j - 1]);
    }
  }
  return;
}
inline void init(char *s, int len) {
  SA::len = len;
  for (int i = (0); i < (len); ++i) SA::s[i] = s[i];
  calcSa();
  calcLcp();
  calcRmq();
  return;
}
inline int query(int x, int y) {
  x = rk[x];
  y = rk[y];
  if (x > y) swap(x, y);
  --y;
  return min(st[x][lg[y - x + 1]],
             st[y - (1 << lg[y - x + 1]) + 1][lg[y - x + 1]]);
}
}  // namespace SA
int n, ans;
int pos[maxn];
char s[maxn];
vector<pair<int, int> > vans;
inline void calcPos() {
  int p = SA::rk[0], h;
  h = n;
  for (int i = (0); i < (SA::len); ++i) pos[i] = INF;
  for (int i = p - 1; i >= 0; --i) {
    h = min(h, SA::lcp[i]);
    if (SA::sa[i] > n) pos[h] = min(pos[h], SA::sa[i] - n - 1);
  }
  h = SA::lcp[p];
  for (int i = (p + 1); i <= (SA::len); ++i) {
    if (SA::sa[i] > n) pos[h] = min(pos[h], SA::sa[i] - n - 1);
    h = min(h, SA::lcp[i]);
  }
  return;
}
inline int getPre(int l, int r) {
  int lb = 0, rb = n;
  while (lb + 1 < rb) {
    int md = (lb + rb) >> 1;
    if (md + pos[md] - 1 < l && n - md > r)
      lb = md;
    else
      rb = md;
  }
  return lb;
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  s[n] = '$';
  for (int i = (n + 1); i <= (n << 1); ++i) s[i] = s[i - n - 1];
  reverse(s, s + n);
  SA::init(s, n << 1 | 1);
  calcPos();
  for (int i = n - 1; i >= 0; --i) pos[i] = min(pos[i], pos[i + 1]);
  for (int i = (0); i < (n); ++i) {
    int len = SA::query(i + n + 1, n - i - 1);
    int pre = getPre(i - len + 1, i + len - 1);
    if ((pre << 1) + ((len << 1) - 1) > ans) {
      vans.clear();
      ans = (pre << 1) + ((len << 1) - 1);
      if (!pre) {
        vans.push_back(make_pair(i - len + 1, (len << 1) - 1));
      } else {
        vans.push_back(make_pair(pos[pre], pre));
        vans.push_back(make_pair(i - len + 1, (len << 1) - 1));
        vans.push_back(make_pair(n - pre, pre));
      }
    }
  }
  printf("%d\n", vans.size());
  for (int i = (0); i < (vans.size()); ++i)
    printf("%d %d\n", vans[i].first + 1, vans[i].second);
  return 0;
}