#include #include using namespace std; using namespace atcoder; using ll = long long; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } ll inf_ll = 9223372036854775807; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) using mint = atcoder::modint998244353; using mint1 = atcoder::modint1000000007; using Pa = std::pair; int Yes(bool x){ if(x) cout << "Yes"; else cout << "No"; cout << endl; return 0; } ll op(ll a, ll b){ return max(a, b); } ll e(){ return 0; } int main(){ ll Q; cin >> Q; segtree S(Q); ll N = 0; rep(i, Q){ ll a, b; cin >> a >> b; if(a == 1){ S.set(N, b); N++; } else{ cout << S.prod(N-b, N) << endl; } } }