#include<vector>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

const long long BAR = 1000000000000000000ll;
pair<long long, long long> MANY, NONE;
int n;

inline bool isValid(pair<long long, long long> a) {
    return a != NONE && a != MANY;
}

long long num(int i, long long a) {
    return (a >> (i + 1) << i) + (a >> i & 1) * ((a & ((1ll << i) - 1)) + 1);
}

pair<long long, long long> calc(vector<long long> a) {
    vector<long long> bak = a;
    int n = a.size();
    long long A, B;
    B = (1ll << (n - 1)) + a.back() - 1;
    for (int i = 0; i < n; ++i) {
        a[i] -= num(i, a.back() - 1);
    }
    A = (1ll << (n - 1));
    for (int i = n - 2; i >= 0; --i) {
//cout << "for" << ' ' << i << ' ' << a[i] << endl;
        if (a[i] < 0 || a[i] > (1ll << i)) {
            return NONE;
        }
        if (a[i] < (1ll << i)) {
            A -= a[i];
            break;
        }
        A -= a[i];
        for (int j = 0; j < i; ++j) {
            a[j] -= 1ll << (i - 1);
        }
    }
//cout << A << ' ' << B << endl;
    for (int i = 0; i < n; ++i) {
//cout << "cut" << ' ' << i << ' ' << num(i, B) - num(i, A - 1) << endl;
        if (num(i, B) - num(i, A - 1) != bak[i]) {
            return NONE;
        }
    }
    return make_pair(A, B);
}

vector<pair<long long, long long> > solve(vector<long long> a) {
    vector<pair<long long, long long> > ret;
    if (a.size() == 1) {
        ret.push_back(a.back() ? make_pair(1, 1) : make_pair(0, 0));
        return ret;
    }
    if (a.back() == 0) {
        a.pop_back();
        return solve(a);
    }
    int n = a.size();
    if (a.back() > 1ll << (n - 1)) {
        return ret;
    }
    vector<pair<long long, long long> > tmp, ansg;
    pair<long long, long long> ans;
    ans = calc(a);
    if (isValid(ans)) {
       ansg.push_back(ans);
    }
    long long d = a.back();
    a.pop_back();
    tmp = solve(a);
    for (int i = 0; i < (int)tmp.size(); ++i) {
        ans = tmp[i];
        if (ans.second - ans.first + 1 != d) {
            continue;
        }
        ans.first += 1ll << (n - 1);
        ans.second += 1ll << (n - 1);
        ansg.push_back(ans);
    }
    sort(ansg.begin(), ansg.end());
    ansg.erase(unique(ansg.begin(), ansg.end()), ansg.end());
    return ansg;
}

int main() {
    MANY = make_pair(-1, -1);
    NONE = make_pair(-2, -2);
    while (scanf("%d", &n) == 1 && n) {
        vector<long long> s;
        for (int i = 0; i < n; ++i) {
            long long a;
            scanf("%lld", &a);
            s.push_back(a);
        }
        bool flag = false;
        for (int i = 64; i >= 60; --i) {
            if (n > i && s[i] > 0) {
                flag = true;
            }
        }
        if (flag) {
            printf("None\n");
            continue;
        }
        vector<pair<long long, long long> > ans, tmp = solve(s);
        sort(tmp.begin(), tmp.end());
        tmp.erase(unique(tmp.begin(), tmp.end()), tmp.end());
        for (int i = 0; i < (int)tmp.size(); ++i) {
            if (tmp[i].second > BAR || tmp[i].first <= 0) {
                continue;
            }
            ans.push_back(tmp[i]);
        }
        if (ans.size() == 0) {
            printf("None\n");
        } else if (ans.size() > 1) {
            printf("Many\n");
        } else {
            printf("%lld %lld\n", ans[0].first, ans[0].second);
        }
    }
    return 0;
}

Measured memory_bytes: 1256