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 mxn = 1e5 + 5;
const int sz = 1 << 17;
int n;
char s[mxn], t[mxn << 1];
int z[mxn << 1];
int m[sz];
int suflen[mxn];
pair<int, int> mx[sz << 1];
void Z(char *s, int *z) {
  int n = strlen(s);
  int L = 0, R = 0;
  for (int i = 0; i < int(n); ++i)
    if (i) {
      if (i <= R) z[i] = min(z[i - L], R - i + 1);
      while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
      if (i + z[i] - 1 > R) L = i, R = i + z[i] - 1;
    }
}
void M(char *s, int *m) {
  int n = strlen(s);
  int L = 0, R = 0;
  for (int i = 0; i < int(n); ++i)
    if (i) {
      if (i <= R) m[i] = min(m[L + (R - i)], R - i);
      while (i - m[i] - 1 >= 0 && i + m[i] + 1 < n &&
             s[i - m[i] - 1] == s[i + m[i] + 1])
        ++m[i];
      if (i + m[i] > R) L = i - m[i], R = i + m[i];
    }
}
void build(int *m) {
  for (int i = 0; i < int(sz); ++i) mx[i + sz] = make_pair(m[i], i);
  for (int i = sz - 1; i; --i) mx[i] = max(mx[i << 1], mx[i << 1 | 1]);
}
pair<int, int> qry(int l, int r) {
  pair<int, int> ans;
  for (l += sz, r += sz; l < r; l >>= 1, r >>= 1) {
    if (l & 1) ans = max(ans, mx[l++]);
    if (r & 1) ans = max(ans, mx[--r]);
  }
  return ans;
}
pair<int, pair<int, int> > solve(int l, int r) {
  if (l > r) return make_pair(0, make_pair(0, 0));
  int lb = 0, rb = (r - l + 1) / 2;
  while (lb < rb) {
    int md = (lb + rb + 1) >> 1;
    if (l + md <= r - md && qry(l + md, r - md + 1).first >= md)
      lb = md;
    else
      rb = md - 1;
  }
  pair<int, int> pr = qry(l + lb, r - lb + 1);
  return make_pair(lb * 2 + 1, make_pair(pr.second - lb, lb * 2 + 1));
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  int c = 0;
  for (int i = n - 1; ~i; --i) t[c++] = s[i];
  for (int i = 0; i < int(n); ++i) t[c++] = s[i];
  Z(t, z);
  for (int i = 0; i < int(n); ++i)
    suflen[i] = max(i ? suflen[i - 1] : 0, z[i + n]);
  M(s, m);
  build(m);
  pair<int, vector<pair<int, int> > > ans;
  for (int l = 0; l * 2 <= n; ++l) {
    int p = lower_bound(suflen, suflen + n, l) - suflen;
    if (p + l > n - l) break;
    int len = 2 * l;
    vector<pair<int, int> > v;
    if (l) v.push_back(make_pair(p, l));
    int L = p + l;
    int R = n - l - 1;
    pair<int, pair<int, int> > pr = solve(L, R);
    if (pr.first)
      v.push_back(pr.second), len += pr.first;
    else
      continue;
    if (l) v.push_back(make_pair(n - l, l));
    ans = max(ans, make_pair(len, v));
  }
  printf("%d\n", (int)ans.second.size());
  for (int i = 0; i < int(ans.second.size()); ++i)
    printf("%d %d\n", ans.second[i].first + 1, ans.second[i].second);
  return 0;
}