#include <bits/stdc++.h>

using namespace std;

using int64 = long long;

// T: The type of values.
// U: The type of operators.
// Verified: AOJ-DSL2F
template<typename T, typename U>
class LazyPropagationSegmentTreeNoGetRange {
 private:
  function<U(U, U)> op_merge;
  U empty_op;
  function<T(T, U)> apply_op;
  int num_nodes;
  vector<T> values;
  vector<U> op_nodes;

  void DoLazyPropagation(int node_index) {
   if (op_nodes[node_index] != empty_op) {
      if (node_index < num_nodes / 2) {
        op_nodes[2 * node_index] =
            op_merge(op_nodes[2 * node_index], op_nodes[node_index]);
        op_nodes[2 * node_index + 1] =
            op_merge(op_nodes[2 * node_index + 1], op_nodes[node_index]);
      } else {
        int value_index = node_index - num_nodes / 2;
        values[value_index] =
            apply_op(values[value_index], op_nodes[node_index]);
      }
      op_nodes[node_index] = empty_op;
    }
  }

  void ApplyOpRangeInternal(
      int node_index, int node_l, int node_r, int l, int r, U op) {
    DoLazyPropagation(node_index);

    if (node_r <= l || r <= node_l) return;

    if (l <= node_l && node_r <= r) {
      op_nodes[node_index] = op;
      DoLazyPropagation(node_index);
      return;
    }
    int node_m = (node_l + node_r) / 2;
    ApplyOpRangeInternal(2 * node_index, node_l, node_m, l, r, op);
    ApplyOpRangeInternal(2 * node_index + 1, node_m, node_r, l, r, op);
  }

  T GetInternal(int node_index, int node_l, int node_r, int i) {
    DoLazyPropagation(node_index);

    if (node_index >= num_nodes / 2) {
      return values[i];
    }

    int node_m = (node_l + node_r) / 2;
    if (i < node_m) {
      return GetInternal(2 * node_index, node_l, node_m, i);
    } else {
      return GetInternal(2 * node_index + 1, node_m, node_r, i);
    }
  }

 public:
  LazyPropagationSegmentTreeNoGetRange(
      function<U(U, U)> in_op_merge, U in_empty_op,
      function<T(T, U)> in_apply_op, vector<T> in_values) :
          op_merge(in_op_merge), empty_op(in_empty_op), apply_op(in_apply_op),
          values(in_values) {
    int n = values.size();
    num_nodes = 1;
    while (num_nodes < n) num_nodes *= 2;
    num_nodes *= 2;
    op_nodes = vector<U>(num_nodes, empty_op);
  }

  // Applies the operator to the range [l, r).
  void ApplyOpRange(int l, int r, U op) {
    return ApplyOpRangeInternal(1, 0, num_nodes / 2, l, r, op);
  }

  T Get(int i) { return GetInternal(1, 0, num_nodes / 2, i); }
};

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

  int n, q;
  cin >> n >> q;
  vector<int> xs(n, INT_MAX);

  auto op_merge =
      function<int(int, int)>([] (int x, int y) { return y; });
  constexpr int EMPTY_OP = -1;
  auto apply_op =
      function<int(int, int)>([] (int x, int op) { return op; });
  auto tree = LazyPropagationSegmentTreeNoGetRange<int, int>(
      op_merge, EMPTY_OP, apply_op, xs);

  for (int i = 0; i < q; i++) {
    int c;
    cin >> c;
    if (c == 0) {
      int s, t, v;
      cin >> s >> t >> v;
      tree.ApplyOpRange(s, t + 1, v);
      // tree.Dump();
    } else {
      int i;
      cin >> i;
      cout << tree.Get(i) << endl;
      // tree.Dump();
    }
  }
}


Measured memory_bytes: 4996