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;
template <class T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cout << *i << " ";
  cout << endl;
}
template <class T>
void pvp(T a, T b) {
  for (T i = a; i != b; ++i)
    cout << "(" << i->first << ", " << i->second << ") ";
  cout << endl;
}
void chmin(int &t, int f) {
  if (t > f) t = f;
}
void chmax(int &t, int f) {
  if (t < f) t = f;
}
void chmin(long long &t, long long f) {
  if (t > f) t = f;
}
void chmax(long long &t, long long f) {
  if (t < f) t = f;
}
void chmin(double &t, double f) {
  if (t > f) t = f;
}
void chmax(double &t, double f) {
  if (t < f) t = f;
}
int in_c() {
  int c;
  for (; (c = getchar()) <= ' ';) {
    if (!~c) throw ~0;
  }
  return c;
}
int in() {
  int x = 0, c;
  for (; (unsigned)((c = getchar()) - '0') >= 10;) {
    if (c == '-') return -in();
    if (!~c) throw ~0;
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while ((unsigned)((c = getchar()) - '0') < 10);
  return x;
}
long long In() {
  long long x = 0, c;
  for (; (unsigned)((c = getchar()) - '0') >= 10;) {
    if (c == '-') return -In();
    if (!~c) throw ~0;
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while ((unsigned)((c = getchar()) - '0') < 10);
  return x;
}
namespace SA {
int n;
char t[400010];
int ki[400010], ik[400010], is[400010], hh;
bool cmp(const int &a, const int &b) {
  return (a == b)           ? 0
         : (ik[a] != ik[b]) ? (ik[a] < ik[b])
                            : (ik[a + hh] < ik[b + hh]);
}
void makesa() {
  n = strlen(t);
  int i;
  for (i = 0; i <= n; ++i) ik[ki[i] = i] = t[i];
  is[0] = is[n] = hh = 0;
  sort(ki, ki + n + 1, cmp);
  for (hh = 1; is[n] != n; hh <<= 1) {
    sort(ki, ki + n + 1, cmp);
    for (i = 0; i < n; ++i) is[i + 1] = is[i] + (cmp(ki[i], ki[i + 1]) ? 1 : 0);
    for (i = 0; i <= n; ++i) ik[ki[i]] = is[i];
  }
}
int lcp[400010];
void makeha() {
  int h = 0, i, j;
  for (i = 0; i < n; ++i) {
    for (j = ki[ik[i] - 1]; t[j + h] == t[i + h]; ++h)
      ;
    lcp[ik[i] - 1] = h;
    if (h) --h;
  }
}
}  // namespace SA
int palindrome(char t[], int r[]) {
  int nn = strlen(t) << 1;
  int i, j, k;
  for (i = j = 0; i < nn; i += k, j = max(j - k, 0)) {
    for (; 0 <= i - j && i + j + 1 < nn && t[i - j >> 1] == t[i + j + 1 >> 1];
         ++j)
      ;
    r[i] = j;
    for (k = 1; 0 <= i - k && 0 <= j - k && r[i - k] != j - k; ++k) {
      r[i + k] = min(r[i - k], j - k);
    }
  }
  return nn;
}
int L;
int top[400010];
int r[400010], R[400010];
int segn, seg[400010];
void seg_init() {
  int i;
  for (segn = 1; segn < L; segn <<= 1)
    ;
  for (i = 0; i < segn; ++i) {
    seg[i + segn] = i;
  }
  for (i = segn; --i;) {
    seg[i] =
        (R[seg[i << 1]] >= R[seg[i << 1 | 1]]) ? seg[i << 1] : seg[i << 1 | 1];
  }
}
int seg_range_max(int a, int b) {
  int ret = a;
  for (a += segn, b += segn; a <= b; a >>= 1, b >>= 1) {
    if (a & 1) {
      if (R[ret] < R[seg[a]]) ret = seg[a];
      ++a;
    }
    if (~b & 1) {
      if (R[ret] < R[seg[b]]) ret = seg[b];
      --b;
    }
  }
  return ret;
}
int main() {
  using namespace SA;
  int i, j;
  int back;
  int now;
  scanf("%s", t);
  L = strlen(t);
  palindrome(t, r);
  t[L] = 1;
  for (i = 0; i < L; ++i) {
    t[L * 2 - i] = t[i];
  }
  makesa();
  makeha();
  back = ik[L + 1];
  for (i = 0; i <= L; ++i) {
    top[i] = L;
  }
  now = L / 2;
  for (i = back - 1; i >= 0; --i) {
    chmin(now, lcp[i]);
    chmin(top[now], ki[i]);
  }
  now = L / 2;
  for (i = back + 1; i <= n; ++i) {
    chmin(now, lcp[i - 1]);
    chmin(top[now], ki[i]);
  }
  for (i = L; i--;) {
    chmin(top[i], top[i + 1]);
  }
  for (i = 0; i < L; ++i) {
    R[i] = r[i * 2] / 2;
  }
  seg_init();
  int ans = 0, tmp;
  int ans0, ans1, ans2, ans3, ans4, ans5;
  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
  ans0 = ans1 = ans2 = ans3 = ans4 = ans5 = 0;
  for (i = 0; i <= L; ++i)
    if (top[i] < L - i) {
      tmp0 = top[i];
      tmp1 = top[i] + i;
      tmp4 = L - i;
      tmp5 = L;
      int a = tmp1, b = tmp4 - 1;
      if (a <= b) {
        int lo = 0, ho = (b - a) / 2 + 1;
        for (; lo + 1 < ho;) {
          int mo = (lo + ho) >> 1;
          j = seg_range_max(a + mo, b - mo);
          (R[j] >= mo) ? lo = mo : ho = mo;
        }
        j = seg_range_max(a + lo, b - lo);
        tmp2 = j - lo;
        tmp3 = j + lo + 1;
        tmp = (tmp1 - tmp0) + (tmp3 - tmp2) + (tmp5 - tmp4);
        if (ans < tmp) {
          ans = tmp;
          ans0 = tmp0;
          ans1 = tmp1;
          ans2 = tmp2;
          ans3 = tmp3;
          ans4 = tmp4;
          ans5 = tmp5;
        }
      }
    }
  if (ans0 < ans1) {
    puts("3");
    printf("%d %d\n", ans0 + 1, ans1 - ans0);
    printf("%d %d\n", ans2 + 1, ans3 - ans2);
    printf("%d %d\n", ans4 + 1, ans5 - ans4);
  } else {
    puts("1");
    printf("%d %d\n", ans2 + 1, ans3 - ans2);
  }
  return 0;
}