#include using namespace std; const int N = 1e5 + 10; typedef long long LL; LL a[N], b[N], s[N]; LL n, m; LL cnt; int main() { freopen("city.in", "r", stdin); freopen("city.out", "w", stdout); cin >> n >> m; for (int i = 1; i <= n; i++) cin >> a[i]; for (int i = 1; i <= n; i++) cin >> b[i]; for (int i = 1; i <= n; i++) { cnt += a[i]; if (cnt >= m) { cout << b[i] << endl; return 0; } } return 0; }