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;
int n;
string s;
int Tree[4 * 100010];
vector<int> P;
vector<int> Manacher(string s) {
  vector<int> d1(n);
  for (int i = 0, l = 0, r = -1; i < n; i++) {
    int k = (i > r) ? 1 : min(d1[l + r - i], r - i + 1);
    while (0 <= i - k && i + k < n && s[i - k] == s[i + k]) {
      k++;
    }
    d1[i] = k--;
    if (i + k > r) {
      l = i - k;
      r = i + k;
    }
  }
  return d1;
}
vector<int> z_function(string s) {
  int n = (int)s.length();
  vector<int> z(n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    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;
  }
  vector<int> Res;
  for (int i = s.size() / 2 + 1; i < z.size(); i++) Res.push_back(z[i]);
  return Res;
}
void Build(int Node = 1, int l = 0, int r = n - 1) {
  if (l == r) {
    Tree[Node] = P[l];
    return;
  }
  int Mid = (l + r) / 2;
  Build(Node * 2, l, Mid);
  Build(Node * 2 + 1, Mid + 1, r);
  Tree[Node] = max(Tree[Node * 2], Tree[Node * 2 + 1]);
}
int Query(int ql, int qr, int Node = 1, int l = 0, int r = n - 1) {
  if (l > qr || r < ql) return 0;
  if (l >= ql && r <= qr) return Tree[Node];
  int Mid = (l + r) / 2;
  int R1 = Query(ql, qr, Node * 2, l, Mid);
  int R2 = Query(ql, qr, Node * 2 + 1, Mid + 1, r);
  return max(R1, R2);
}
int Bs(int l, int r, int x, int y) {
  int Mid = (l + r) / 2;
  int Len = 2 * Mid + 1;
  int ql = x + Mid, qr = y - Mid;
  int Mx = Query(ql, qr);
  if (Mid == r) {
    if (Mx - 1 >= Mid) return Len;
    return Bs(l, Mid - 1, x, y);
  }
  int Mid2 = Mid + 1;
  int Len2 = 2 * Mid2 + 1;
  ql = x + Mid2, qr = y - Mid2;
  int Mx2 = Query(ql, qr);
  if (Mx - 1 >= Mid && Mx2 - 1 < Mid2) return Len;
  if (Mx - 1 >= Mid) return Bs(Mid + 1, r, x, y);
  return Bs(l, Mid - 1, x, y);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  n = s.size();
  P = Manacher(s);
  Build();
  string tmp = s;
  reverse(tmp.begin(), tmp.end());
  tmp += '?';
  tmp += s;
  vector<int> Z = z_function(tmp);
  int Ans = 0;
  vector<pair<int, int> > Res;
  for (int i = 0; i < n; i++) {
    if (2 * (P[i] - 1) + 1 > Ans) {
      Ans = 2 * (P[i] - 1) + 1;
      Res.clear();
      Res.push_back({i + 1 - (P[i] - 1), Ans});
    }
  }
  for (int i = 0; i < n; i++) {
    int Cur = Z[i];
    if (Cur == 0) continue;
    if (Cur == n - i) {
      if (Cur > Ans && Cur % 2) {
        Ans = Cur;
        Res.clear();
        Res.push_back({i + 1, Cur});
      }
    } else {
      int l = i + Cur;
      int r = n - Cur - 1;
      int Len = r - l + 1;
      if (Len % 2 == 0) Len--;
      int Mx = Bs(0, Len / 2, l, r);
      if (2 * Cur + Mx > Ans) {
        Ans = 2 * Cur + Mx;
        Res.clear();
        Res.push_back({i + 1, Cur});
        Res.push_back({r + 2, Cur});
        Res.push_back({Mx, -1});
      }
    }
  }
  if (Res.size() == 1) {
    cout << 1 << endl;
    cout << Res[0].first << " " << Res[0].second << endl;
  } else {
    cout << 3 << endl;
    int Need = Res[2].first;
    Need /= 2;
    Res.pop_back();
    for (int i = Res[0].first - 1 + Res[0].second + Need;; i++) {
      if (P[i] == Need + 1) {
        Res.insert(Res.begin() + 1, {i + 1 - Need, 2 * Need + 1});
        break;
      }
    }
    for (int i = 0; i < Res.size(); i++) {
      cout << Res[i].first << " " << Res[i].second << endl;
    }
  }
  return 0;
}