#include <stdio.h>

#define INF 2147483647
#define RMQ_SIZE 262144

void update(int pos, int value);
int getMin(int right, int left);
int dfs(int a,int b,int k,int l,int r);
int min(int a, int b);

int tree[RMQ_SIZE];

int main()
{
    int n, q, i, tmp, a, b;

    scanf("%d %d", &n, &q);

    for (i = 0; i < n; i++) {
        update(i, INF);
    }
    for (i = 0; i < q; i++) {
        scanf("%d %d %d", &tmp, &a, &b);
        if (tmp) {
            printf("%d\n", getMin(a, b+1));
        } else {
            update(a, b);
        }
    }
            
    return 0;
}


int dfs(int a,int b,int k,int l,int r)
{
    int m;
    //* ????±????????????????????????¬???????????¢?´¢.
    if (r <= a || b <= l) {
        return INF;
    }
    //* ??¨?????¬?????????????±?????????\???????????????.
    if (a <= l && r <= b) {
        return tree[k];
    }
    m = (l+r)/2;
    return min(dfs(a, b, k*2+1, l, m), dfs(a, b, k*2+2, m, r));
}

int getMin(int right, int left)
{
    return dfs(right, left, 0, 0, RMQ_SIZE/2);
}

void update(int pos, int value)
{
    pos += (RMQ_SIZE/2 -1);
    tree[pos] = value;
    while (pos) {
        pos = (pos-1)/2;
        tree[pos] = min(tree[pos*2+1], tree[pos*2+2]);
    }
}

int min(int a, int b)
{
    return a < b ? a: b;
}