#include <iostream>
#include <vector>
#include <algorithm>

struct Ant { int pos; int dir; };       // dir: -1 左, 1 右, 0 静止

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int n;
    if (!(std::cin >> n)) return 0;

    std::vector<Ant> ants(n);
    int posA = -1;                      // A 的初始位置
    for (int i = 0; i < n; ++i) {
        std::cin >> ants[i].pos >> ants[i].dir;
        if (ants[i].dir == 0) posA = ants[i].pos;
    }

    std::vector<int> L, R;              // 只存位置即可
    for (const auto& a : ants) {
        if (a.dir ==  1 && a.pos < posA) L.push_back(a.pos); // 左边→右
        if (a.dir == -1 && a.pos > posA) R.push_back(a.pos); // 右边→左
    }
    std::sort(L.begin(), L.end());      // 离 A 近 → 远
    std::sort(R.begin(), R.end());      // 同上

    if (L.size() == R.size()) {
        std::cout << "Cannot fall!\n";
    } else if (L.size() > R.size()) {           // 左侧多余
        int idx = L.size() - R.size() - 1;      // 多出的“那一只”
        std::cout << 100 - L[idx] << '\n';
    } else {                                    // 右侧多余
        int idx = L.size();                     // 第 |L| 只
        std::cout << R[idx] << '\n';
    }
    return 0;
}