#d1107. 序列操作

序列操作

Sequence Operations

Problem Description

You are given a sequence a1,a2,…,ana_1, a_2, \dots, a_n of length nn.

You need to perform two kinds of operations:

  1. 1 x y — change the xx-th element to yy;
  2. 2 y — change every element that is less than yy to yy.

After performing qq operations in total, output the resulting sequence.

Input Format

The first line contains two integers n,qn, q (1≤n,q≤1061 \le n, q \le 10^6).

The second line contains nn integers a1,a2,…,ana_1, a_2, \dots, a_n (0≤ai≤1090 \le a_i \le 10^9).

The next qq lines each describe one operation: 1 x y or 2 y (1≤x≤n1 \le x \le n, 0≤y≤1090 \le y \le 10^9).

Output Format

Output one line containing the resulting sequence, with the integers separated by spaces.

Sample Input

5 5
3 6 14 16 12
2 13
2 16
1 1 1
1 2 14
2 11

Sample Output

11 14 16 16 16