#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 5;
const long long INF = 1e18 + 5;
const int maxn = 5e6 + 5;
int a[555555], x[555555], y[555555], m, c[555555], col[555555], dp[55], p[55];
vector<pair<int, int> > d[55][55];
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i], p[i] += p[i - 1] + a[i];
  int sum = 0, mx = 0, lll = 0, rr = 0;
  for (int l = 1; l <= n; l++)
    for (int r = l; r <= n; r++) {
      sum = p[r] - p[l - 1];
      d[l][r].push_back(make_pair(l, r));
      int second = 0;
      int x = r + 1;
      for (int j = r + 1; j <= n; j++)
        for (int i = x; i <= j; i++) {
          if (p[j] - p[i - 1] == sum) {
            d[l][r].push_back(make_pair(i, j)), x = j + 1;
            break;
          }
        }
      if (d[l][r].size() > mx) mx = d[l][r].size(), lll = l, rr = r;
    }
  cout << mx << endl;
  for (int i = 0; i < d[lll][rr].size(); i++)
    cout << d[lll][rr][i].first << ' ' << d[lll][rr][i].second << endl;
  return 0;
}
