#include <bits/stdc++.h>

using namespace std;

const int MAX = 100010;

vector<int> tree(MAX, INT_MAX);

void update(int i, int x, int n)
{
    if(n > 0)
        tree[i] = x;
}

int find(int l, int r)
{
    if(l == r)
        return tree[l];
        
    int MIN = INT_MAX;
    
    for(int i = l; i <= r; i++)
        if(tree[i] < MIN)
            MIN = tree[i];
            
    return MIN;
}

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