#include<cstdio>
#include<algorithm>
#define rep(i,a) for( int i = 0; i != (a); ++i )

const int INF = (1<<31)-1, MAX_N = 1<<17;

int sz, dat[2*MAX_N-1];

void init( int n_ )
{
	sz = 1;
	while( sz < n_ )
		sz <<= 1;

	rep( i, 2*sz-1 )
		dat[i] = INF;

	return;
}

void update( int k, int x )
{
	k += sz-1;
	dat[k] = x;
	while( k > 0 )
	{
		k = (k-1)>>1;
		dat[k] = std::min( dat[2*k+1], dat[2*k+2] );
	}

	return;
}

int query( int a, int b, int k, int l, int r )
{
	if( r <= a || b <= l )
		return INF;

	if( a <= l && r <= b )
		return dat[k];
	else
		return std::min( query( a, b, 2*k+1, l, (l+r)>>1 ), query( a, b, 2*k+2, (l+r)>>1, r ) );
}


int main()
{
	int n, q;
	scanf( "%d%d", &n, &q );
	
	init( n );
	
	rep( i, q )
	{
		char com[2];
		int x, y;

		scanf( "%s%d%d", com, &x, &y );

		if( com[0] == '0' )
			update( x, y );
		else
			printf( "%d\n", query( x, y+1, 0, 0, sz ) );
	}

	return 0;
}