void main()
{
    long n, q;
    rdVals(n, q);

    auto st = SegTree!("a < b ? a : b", long, (1L<<31)-1)(n);

    foreach (i; 0 .. q)
    {
        long com, x, y;
        rdVals(com, x, y);

        if (com) st.query(x, y+1).writeln;
        else st.update(x, y);
    }
}

struct SegTree(alias pred, T, T init)
{
    import core.bitop;
    alias F = binaryFun!pred;

    long n;
    T[] tree;

    this(long n)
    {
        this.n = n == 1 ? 1 : 1L << bsr(n-1) + 2;
        tree.length = this.n << 1;
        tree[] = init;
    }

    ref T opIndex(long idx) pure nothrow
    {
        return tree[idx+this.n];
    }

    void update(long idx, T x)
    {
        idx += this.n;
        this.tree[idx] = x;
        while (idx >>= 1)
        {
            tree[idx] = F(tree[(idx<<1)], tree[(idx<<1)+1]);
        }
    }

    T query(long x, long y)
    {
        T l = init, r = init;
        for (x += this.n, y += this.n; x < y; x >>= 1, y >>= 1)
        {
            if (x & 1) l = F(l, tree[x++]);
            if (y & 1) r = F(tree[--y], r);
        }
        return F(l, r);
    }
}

enum long mod = 10^^9 + 7;
enum long inf = 1L << 60;

T rdElem(T = long)()
if (!is(T == struct))
{
    return readln.chomp.to!T;
}

alias rdStr = rdElem!string;
alias rdDchar = rdElem!(dchar[]);

T rdElem(T)()
if (is(T == struct))
{
    T result;
    string[] input = rdRow!string;
    assert(T.tupleof.length == input.length);
    foreach (i, ref x; result.tupleof)
    {
        x = input[i].to!(typeof(x));
    }
    return result;
}

T[] rdRow(T = long)()
{
    return readln.split.to!(T[]);
}

T[] rdCol(T = long)(long col)
{
    return iota(col).map!(x => rdElem!T).array;
}

T[][] rdMat(T = long)(long col)
{
    return iota(col).map!(x => rdRow!T).array;
}

void rdVals(T...)(ref T data)
{
    string[] input = rdRow!string;
    assert(data.length == input.length);
    foreach (i, ref x; data)
    {
        x = input[i].to!(typeof(x));
    }
}

void wrMat(T = long)(T[][] mat)
{
    foreach (row; mat)
    {
        foreach (j, compo; row)
        {
            compo.write;
            if (j == row.length - 1) writeln;
            else " ".write;
        }
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.mathspecial;
import std.traits;
import std.container;
import std.functional;
import std.typecons;
import std.ascii;
import std.uni;
import core.bitop;
