#include <stdio.h>
#include <stdlib.h>

#define INF 2147483647
#define RMQ_SIZE 262144  // 2^18

int tree[RMQ_SIZE];

int dfs(int a, int b, int k, int l, int r);
int find(int first, int second);
void update(int pos, int value);
int min(int a, int b);


int main(void)
{
    int n, q, com, x, y, i;

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

    for (i = 0; i < n; i++) {
        update(i, INF);
    }

    for (i = 0; i < q; i++) {
        scanf("%d %d %d", &com, &x, &y);
        if (com) {
            printf("%d\n", find(x, y+1));
        } else {
            update(x, y);
        }
    }
    
    return 0;
}

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

/*
 * ??????????????????[right,left)??§???????????¨?????¨???
 */
int find(int right, int left)
{
    return dfs(right, left, 1, 0, RMQ_SIZE/2-1);
}

/*
 * pos?????????????????????value????????´??????.
 * ??????????????¨??¨?????????????????????.
 */
void update(int pos, int value)
{
    pos += RMQ_SIZE/2;
    tree[pos] = value;
    /*
     * ?????????????????§????°?????????´??°????????????.
     * ???????????????????????????.
     * ????????´????????´??°???????????????????????£???????????§return??????.
     */
    while (pos) {
        pos = pos/2;
        tree[pos] = min(tree[pos*2], tree[pos*2+1]);
    }
}

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