// AOJ DSL_2_A Range Minimum Query (RMQ)
// 2018.5.5 bal4u
// 2018.5.17

#include <stdio.h>
#include <string.h>

#define INF 0xffffffff

#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
unsigned in()
{
	int n = 0, c = gc();
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void out(unsigned n)
{
	int i;
	char ob[20];
	char inf[11] = "2147483647";

	if (!n) pc('0');
	else if (n == INF) for (i = 0; i < 10; i++) pc(inf[i]);
	else {
		i = 0; while (n) ob[i++] = n%10 + '0', n/=10;
		while (i--) pc(ob[i]);
	}
	pc('\n');
}

#define MAX_N 100005
unsigned node[MAX_N << 2]; int sz;

unsigned range_min_query(int t, int l, int r, int x, int y)
{
	int m;
	unsigned a, b;

    if (x <= l && r <= y) return node[t];
    m = (l + r) >> 1;
    if (y <= m) return range_min_query(t << 1, l, m, x, y);
    if (m < x)  return range_min_query((t<<1)|1, m+1, r, x, y);
    else {
        a = range_min_query(t << 1, l, m, x, m);
		b = range_min_query((t<<1)|1, m+1, r, m+1, y);
		return (a <= b)? a: b; 
	}
}

void update(int t, int l, int r, int x, unsigned y)
{
	int m;
	unsigned a, b;

	if (l == r) { node[t] = y; return; }
 	m = (l + r) >> 1;
    if (x <= m) update(t << 1, l, m, x, y);
    else        update((t<<1)|1, m+1, r, x, y);

	a = node[t<<1], b = node[(t<<1)|1];
	node[t] = (a <= b)? a: b;
}


int main()
{
	int n, q, op;
	unsigned x, y;

	n = in(), q = in();
	sz = n << 2;
	memset(node, INF, sz << 2);

	while (q--) {
		op = in(), x = in()+1, y = in()+1;
		if (op) out(range_min_query(1, 1, n, (int)x, (int)y));
		else update(1, 1, n, (int)x, y-1);
	}
	return 0;
}

