#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <string>
#include <set>
#include <bitset>
#include <unordered_map>
#include <cmath>
#include <functional>
#include <map>
#include <cstdlib>

using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
template <class T>
using Vvec = vector<vector<T> >;

template <class T>
void debug(T& v)
{
    for(auto& x: v) cout << x << " ";
    cout << endl;
}

int main()
{
    const ll push = 0;
    const ll pop = 1;
    const ll get = 2;
    struct Data{
        ll key, qid, val;
        Data(): key(0), qid(0), val(0){}
        Data(ll k, ll q, ll v): key(k), qid(q), val(v){}
        bool operator<(const Data& e) const{
            if(key == e.key){
                if(qid == e.qid) return val < e.val;
                return qid < e.qid;
            }
            return key < e.key;
        }
    };

    int N, Q;
    cin >> N >> Q;
    vector<ll> S(N), T(N), X(N), D(Q), ans(Q);
    for(int i=0; i<N; i++) cin >> S[i] >> T[i] >> X[i];
    for(auto& x: D) cin >> x;

    multimap<ll, Pll> mp;
    vector<Data> ds(2*N+Q);
    for(int i=0; i<N; i++){
        ds[2*i] = Data(S[i]-X[i], push, X[i]);
        ds[2*i+1] = Data(T[i]-X[i], pop, X[i]);
    }
    for(int i=0; i<Q; i++) ds[2*N+i] = Data(D[i], get, i);
    sort(ds.begin(), ds.end());

    multiset<ll> Xs;
    for(auto& d: ds){
        ll qid = d.qid;
        ll val = d.val;
        // cout << d.key << " " << qid << " " << val << "\n";
        if(qid == push) Xs.insert(val);
        else if(qid == pop){
            auto itr = Xs.find(val);
            Xs.erase(itr);
        }else{
            if(Xs.empty()) ans[val] = -1;
            else ans[val] = *Xs.begin();
        }
    }

    for(auto& x: ans) cout << x << "\n";
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
using ll = long long;
const ll INF = 1e17;

template<typename T, typename E, typename F, typename G, typename H>
class LazySegmentTree {
  int n, height;
  F f; G g; H h; const T ti; const E ei;
  vector<T> dat; vector<E> laz; vector<int> highest;

  void propagate(int k) {
    if(laz[k] != ei) {
      laz[2*k] = h(laz[2*k],laz[k]); laz[2*k+1] = h(laz[2*k+1],laz[k]);
      dat[k] = g(dat[k],laz[k],n/highest[k]);
      laz[k] = ei;
    }
  }
  inline void recalc(int k) {
    while(k >>= 1) dat[k] = f(g(dat[2*k],laz[2*k],n/highest[2*k]),g(dat[2*k+1],laz[2*k+1],n/highest[2*k+1]));
  }
  inline void thrust(int k) {
    for(int i = height; i > 0; i--) propagate(k >> i);
  }
public:
  LazySegmentTree(int _n, F f, G g, H h, T ti, E ei): f(f), g(g), h(h), ti(ti), ei(ei) {
    n = 1; height = 0;
    while(n < _n) n <<= 1, height++;
    dat.assign(2*n,ti); laz.assign(2*n,ei); highest.assign(2*n,0);
    int c = 1;
    for(int i = 1; i < 2*n; i++) {
      if(c*2 <= i) c <<= 1;
      highest[i] = c;
    }
  }
  void set(int k, T x) {
    dat[k+n] = x;
  }
  void build() {
    for(int i = n-1; i >= 0; i--) {
      dat[i] = f(dat[2*i],dat[2*i+1]);
    }
  }
  void update(int a, int b, const E x) {
    thrust(a += n); thrust(b += n-1);
    for(int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
      if(l & 1) laz[l] = h(laz[l],x), ++l;
      if(r & 1) --r, laz[r] = h(laz[r],x);
    }
    recalc(a); recalc(b);
  }
  T query(int a, int b) {
    thrust(a += n); thrust(b += n-1);
    T l = ti, r = ti; b++;
    while(a < b) {
      if(a & 1) l = f(l,g(dat[a],laz[a],n/highest[a])), a++;
      if(b & 1) b--, r = f(g(dat[b],laz[b],n/highest[b]),r);
      a >>= 1; b >>= 1;
    }
    return f(l,r);
  }
};

int main(){
  int n, q;
  cin >> n >> q;
  auto f = [](ll a, ll b){return a+b;};
  auto g = [](ll a, ll b, int l){return b == INF ? a : b*l;};
  auto h = [&](ll a, ll b) {return b;};
  LazySegmentTree<ll,ll,decltype(f),decltype(g),decltype(h)> lst(n,f,g,h,0,INF);
  rep(i,n) lst.set(i,((ll)1<<31)-1);
  lst.build();
  vector<ll> ans;
  rep(i,q) {
    int t;
    cin >> t;
    if(t == 0) {
      int l, r; ll x;
      cin >> l >> r >> x;
      lst.update(l,r+1,x);
    } else {
      int p;
      cin >> p;
      ans.push_back(lst.query(p,p+1));
    }
  }
  for(auto x : ans) cout << x << endl;
  return 0;
}
