import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.map!(to!int).array;
}

void main() {
    auto nq = readints();
    int n = nq[0], q = nq[1];

    auto segTree = new SegmentTree(n);
    for (int i = 0; i < q; i++) {
        auto xs = readints();
        int x = xs[1], y = xs[2];
        switch (xs[0]) {
        case 0: // change a[i] to x
            segTree.update(x, y);
            break;
        case 1: // find minimum
            int val = segTree.query(x, y + 1);
            writeln(val);
            break;
        default:
            break;
        }
    }
}

class SegmentTree {
    private int[] _data;

    this(int n) {
        int len = 1;
        while (len < n)
            len *= 2;

        _data = new int[len * 2];
        _data[] = int.max;
    }

    /// k ?????????????´????(0-indexed)??? a ????????´
    void update(int k, int a) {
        // ????????\???
        k += (_data.length / 2) - 1;
        _data[k] = a;
        // ?????????????????´??°
        while (k > 0) {
            k = (k - 1) / 2;
            _data[k] = min(_data[k * 2 + 1], _data[k * 2 + 2]);
        }
    }

    /// [a, b) ???????°????????±???????
    int query(int a, int b, int k, int l, int r) {
        // [a, b) ??¨ [l, r) ??????????????????
        if (r <= a || b <= l)
            return int.max;

        // [a, b) ??? [l, r) ????????¨???????????§????????°???????????\?????????
        if (a <= l && r <= b) {
            return _data[k];
        }
        else {
            // ????????§???????????°???2 ????????????????°????
            int vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
            int vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
            return min(vl, vr);
        }
    }

    int query(int a, int b) {
        return query(a, b, 0, 0, cast(int)(_data.length / 2));
    }
}