#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<queue>
#include<vector>
#include<utility>
#include<cstring>
#include<limits.h>
#define pb(a)             push_back(a)
#define mp(a,b)           make_pair(a,b)
#define pf printf
#define ff first
#define ss second
#define sef second.first
#define ses second.second
#define ms(a,b)            memset(a, b, sizeof(a))
#define lp(i,a,b) for (int i = a; i <= b; i++)
#define pii                pair <int,int>
#define sl(a)              scanf("%I64d",&a)
#define sll(a,b)           scanf("%I64d %I64d",&a,&b)
#define si(a)              scanf("%d",&a)
#define sii(a,b)           scanf("%d %d",&a,&b)
#define EulerGamma 0. ;/// when n>1e6  nth harmonic num = log(x+.5)+EulerGamma;
///UINT_MAX 2^32
///ULLONG_MAX 2^64
/* int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1}; */ // 4 Direction
/* int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1}; */ // 8 Direction
/* int dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; */ // Knight Direction
/* int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; */ // Hexagonal Direction
/*-----------------------Bitmask------------------*/
int Set(int N,int pos){return N=N | (1<<pos);}
int reset(int N,int pos){return N= N & ~(1<<pos);}
bool check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/
#define all(v) (v).begin(),(v).end()
#define S(x) scanf("%d",&(x))
#define S2(x,y) scanf("%d%d",&(x),&(y))
#define SL(x) scanf("%lld",&(x))
#define SL2(x) scanf("%lld%lld",&(x),&(y))
#define P(x) printf("%d\n",(x))
using namespace std ;
typedef long long ll ;
const int maxx = 2e5+10;
ll arr[maxx+5],saved[maxx+5],p[maxx+5],x[maxx+5],y[maxx+5];
int main()
{
   ll n,last=0,q;
   cin >> n ;
   for(int i=1;i<=n;i++)
   {
       ll x ;
       cin >> x ;
       arr[i]=x;
   }
   cin >> q ;
   for(int i=1;i<=q;i++)
   {
       ll s ;
       cin >> s ;
       if(s==2)
       {
           ll k ;
           cin >> k ;
           y[i]=k;
           last=i;
       }
       else
       {
           ll k,kk;
           cin >> k >> kk ;
           p[i]=k;
           x[i]=kk;
       }
       saved[i]=s;
   }
   for(int i=1;i<=q;i++)
   {
       if(i<last)
       {
           if(saved[i]==2){continue;}
           ll pp = p[i],xx = x[i] ;
           arr[pp]=xx;
       }
       else if (i==last)
       {
           ll lvl = y[i];
           for(int i=1;i<=n;i++){arr[i]=max(arr[i],lvl);}
       }
       else
       {
           ll pp = p[i],xx = x[i] ;
           arr[pp]=xx;
       }
   }
   for(int i=1;i<=n;i++)
   {
       if(i!=1){cout << " " ;}
       cout << arr[i];
   }
   cout << endl;
   return 0 ;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<queue>
#include<vector>
#include<utility>
#include<cstring>
#include<limits.h>
#define pb(a)             push_back(a)
#define mp(a,b)           make_pair(a,b)
#define pf printf
#define ff first
#define ss second
#define sef second.first
#define ses second.second
#define ms(a,b)            memset(a, b, sizeof(a))
#define lp(i,a,b) for (int i = a; i <= b; i++)
#define pii                pair <int,int>
#define sl(a)              scanf("%I64d",&a)
#define sll(a,b)           scanf("%I64d %I64d",&a,&b)
#define si(a)              scanf("%d",&a)
#define sii(a,b)           scanf("%d %d",&a,&b)
#define EulerGamma 0. ;/// when n>1e6  nth harmonic num = log(x+.5)+EulerGamma;
///UINT_MAX 2^32
///ULLONG_MAX 2^64
/* int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1}; */ // 4 Direction
/* int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1}; */ // 8 Direction
/* int dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; */ // Knight Direction
/* int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; */ // Hexagonal Direction
/*-----------------------Bitmask------------------*/
int Set(int N,int pos){return N=N | (1<<pos);}
int reset(int N,int pos){return N= N & ~(1<<pos);}
bool check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/
#define all(v) (v).begin(),(v).end()
#define S(x) scanf("%d",&(x))
#define S2(x,y) scanf("%d%d",&(x),&(y))
#define SL(x) scanf("%lld",&(x))
#define SL2(x) scanf("%lld%lld",&(x),&(y))
#define P(x) printf("%d\n",(x))
using namespace std ;
typedef long long ll ;
const int maxx = 2e5+10;
ll arr[maxx+5],saved[maxx+5],p[maxx+5],x[maxx+5],y[maxx+5];
int main()
{
   ll n,last=0,q;
   cin >> n ;
   for(int i=1;i<=n;i++)
   {
       ll x ;
       cin >> x ;
       arr[i]=x;
   }
   cin >> q ;
   for(int i=1;i<=q;i++)
   {
       ll s ;
       cin >> s ;
       if(s==2)
       {
           ll k ;
           cin >> k ;
           y[i]=k;
           last=i;
       }
       else
       {
           ll k,kk;
           cin >> k >> kk ;
           p[i]=k;
           x[i]=kk;
       }
       saved[i]=s;
   }
   for(int i=1;i<=q;i++)
   {
       if(i<last)
       {
           if(saved[i]==2){continue;}
           ll pp = p[i],xx = x[i] ;
           arr[pp]=xx;
       }
       else if (i==last)
       {
           ll lvl = y[i];
           for(int j=1;j<=n;j++){arr[j]=max(arr[j],lvl);}
       }
       else
       {
           ll pp = p[i],xx = x[i] ;
           arr[pp]=xx;
       }
   }
   for(int i=1;i<=n;i++)
   {
       if(i!=1){cout << " " ;}
       cout << arr[i];
   }
   cout << endl;
   return 0 ;
}


#include <iostream>
#include <fstream>
#include <numeric>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <deque>
#include <bitset>
#include <cstring>

#define f first
#define s second
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define mp make_pair
#define y0 eto
#define y1 mezhdy
#define y2 nami
#define left ksfjgksjfd
#define right fksfjgksjfd

using namespace std;

const int N=200005;
const ll INF=1LL*1000*1000*1000*1000*1000*1000;

int n,q;
vector<int> a;
vector<pair<int,int> > last_p,x;

int main()
{
    ios_base::sync_with_stdio(0);
    //freopen("INPUT.txt","r", stdin);
    cin>>n;
    last_p.resize(n);
    for(int i=0;i<n;i++)
    {
        int v;
        scanf("%d",&v);
        a.pb(v);
        last_p[i]=mp(-1,v);
    }
    cin>>q;
    for(int i=0;i<q;i++)
    {
        int t;
        cin>>t;
        if(t==1)
        {
            int pos,val;
            cin>>pos>>val;
            pos--;
            last_p[pos]=mp(i,val);
        }
        else
        {
            int cur_x;
            cin>>cur_x;
            x.pb(mp(i,cur_x));
        }
    }

    for(int i=(int)x.size()-1;i>=0;i--)
        x[i].s=max(x[i].s,x[i+1].s);

    for(int i=0;i<a.size();i++)
    {
        int pos=last_p[i].f;

        int l=0,r=(int)x.size();
        while(r!=l)
        {
            int md=(r+l)/2;
            if(x[md].f>=pos)
                r=md;
            else
                l=md+1;
        }

        if(l==x.size())
            cout<<last_p[i].s<<" ";
        else
            cout<<max(last_p[i].s,x[l].s)<<" ";
    }

}


#include <iostream>
#include <fstream>
#include <numeric>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <deque>
#include <bitset>
#include <cstring>

#define f first
#define s second
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define mp make_pair
#define y0 eto
#define y1 mezhdy
#define y2 nami
#define left ksfjgksjfd
#define right fksfjgksjfd

using namespace std;

const int N=200005;
const ll INF=1LL*1000*1000*1000*1000*1000*1000;

int n,q;
vector<int> a;
vector<pair<int,int> > last_p,x;

int main()
{
    ios_base::sync_with_stdio(0);
    //freopen("INPUT.txt","r", stdin);
    cin>>n;
    last_p.resize(n);
    for(int i=0;i<n;i++)
    {
        int v;
        cin>>v;
        a.pb(v);
        last_p[i]=mp(-1,v);
    }
    cin>>q;
    for(int i=0;i<q;i++)
    {
        int t;
        cin>>t;
        if(t==1)
        {
            int pos,val;
            cin>>pos>>val;
            pos--;
            last_p[pos]=mp(i,val);
        }
        else
        {
            int cur_x;
            cin>>cur_x;
            x.pb(mp(i,cur_x));
        }
    }

    if(!x.size())
    {
        for(int i=0;i<a.size();i++)
            cout<<last_p[i].s<<" ";
        return 0;
    }

    for(int i=(int)x.size()-1;i>=0;i--)
        x[i].s=max(x[i].s,x[i+1].s);

    for(int i=0;i<a.size();i++)
    {
        int pos=last_p[i].f;

        int l=0,r=(int)x.size()-1;
        while(r!=l)
        {
            int md=(r+l)/2;
            if(x[md].f>=pos)
                r=md;
            else
                l=md+1;
        }

        if(x[l].f<pos)
            cout<<last_p[i].s<<" ";
        else
            cout<<max(last_p[i].s,x[l].s)<<" ";
    }

}


#include <iostream>
#include <fstream>
#include <numeric>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <deque>
#include <bitset>
#include <cstring>

#define f first
#define s second
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define mp make_pair
#define y0 eto
#define y1 mezhdy
#define y2 nami
#define left ksfjgksjfd
#define right fksfjgksjfd

using namespace std;

const ll N=200005;
const ll INF=1LL*1000*1000*1000*1000*1000*1000;

ll n,q;
vector<pair<ll,ll> > last_p,x;

int main()
{
    ios_base::sync_with_stdio(0);
    //freopen("INPUT.txt","r", stdin);
    cin>>n;
    for(ll i=0;i<n;i++)
    {
        ll v;
        cin>>v;
        last_p.pb(mp(0,v));
    }
    cin>>q;
    for(ll i=0;i<q;i++)
    {
        ll t;
        cin>>t;
        if(t==1)
        {
            ll pos,val;
            cin>>pos>>val;
            pos--;
            last_p[pos]=mp(i,val);
        }
        else
        {
            ll cur_x;
            cin>>cur_x;
            x.pb(mp(i,cur_x));
        }
    }

    if(!x.size())
    {
        for(ll i=0;i<n;i++)
            cout<<last_p[i].s<<" ";
        return 0;
    }

    for(ll i=(ll)x.size()-2;i>=0;i--)
        x[i].s=max(x[i].s,x[i+1].s);

    for(ll i=0;i<n;i++)
    {
        ll pos=last_p[i].f;

        ll l=0,r=(ll)x.size()-1;
        while(r-l>1)
        {
            ll md=(r+l)/2;
            if(x[md].f>=pos)
                r=md;
            else
                l=md;
        }

        if(x[l].f>=pos)
            cout<<max(last_p[i].s,x[l].s)<<" ";
        else if (x[r].f>=pos)
            cout<<max(last_p[i].s,x[r].s)<<" ";
        else
            cout<<last_p[i].s<<" ";
    }

}


#include <iostream>
#include <fstream>
#include <numeric>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <deque>
#include <bitset>
#include <cstring>

#define f first
#define s second
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define mp make_pair
#define y0 eto
#define y1 mezhdy
#define y2 nami
#define left ksfjgksjfd
#define right fksfjgksjfd

using namespace std;

const ll N=200005;
const ll INF=1LL*1000*1000*1000*1000*1000*1000;

ll n,q;
vector<pair<ll,ll> > last_p,x;

int main()
{
    ios_base::sync_with_stdio(0);
    //freopen("INPUT.txt","r", stdin);
    cin>>n;
    for(ll i=0;i<n;i++)
    {
        ll v;
        cin>>v;
        last_p.pb(mp(-1,v));
    }
    cin>>q;
    for(ll i=0;i<q;i++)
    {
        ll t;
        cin>>t;
        if(t==1)
        {
            ll pos,val;
            cin>>pos>>val;
            pos--;
            last_p[pos]=mp(i,val);
        }
        else
        {
            ll cur_x;
            cin>>cur_x;
            x.pb(mp(i,cur_x));
        }
    }

    if(!x.size())
    {
        for(ll i=0;i<n;i++)
            cout<<last_p[i].s<<" ";
        return 0;
    }

    for(ll i=(ll)x.size()-1;i>=0;i--)
        x[i].s=max(x[i].s,x[i+1].s);

    for(ll i=0;i<n;i++)
    {
        ll pos=last_p[i].f;

        ll l=0,r=(ll)x.size()-1;
        while(r-l>1)
        {
            ll md=(r+l)/2;
            if(x[md].f>=pos)
                r=md;
            else
                l=md;
        }
        if(x[l].f>=pos)
            cout<<max(last_p[i].s,x[l].s)<<" ";
        else if (x[r].f>=pos)
            cout<<max(last_p[i].s,x[r].s)<<" ";
        else
            cout<<last_p[i].s<<" ";
    }

}


#include <iostream>
#include <fstream>
#include <numeric>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <deque>
#include <bitset>
#include <cstring>

#define f first
#define s second
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define mp make_pair
#define y0 eto
#define y1 mezhdy
#define y2 nami
#define left ksfjgksjfd
#define right fksfjgksjfd

using namespace std;

const int N=200005;
const ll INF=1LL*1000*1000*1000*1000*1000*1000;

int n,q;
vector<int> a;
vector<pair<int,int> > last_p,x;

int main()
{
    ios_base::sync_with_stdio(0);
    //freopen("INPUT.txt","r", stdin);
    cin>>n;
    last_p.resize(n);
    for(int i=0;i<n;i++)
    {
        int v;
        cin>>v;
        a.pb(v);
        last_p[i]=mp(-1,v);
    }
    cin>>q;
    for(int i=0;i<q;i++)
    {
        int t;
        cin>>t;
        if(t==1)
        {
            int pos,val;
            cin>>pos>>val;
            pos--;
            last_p[pos]=mp(i,val);
        }
        else
        {
            int cur_x;
            cin>>cur_x;
            x.pb(mp(i,cur_x));
        }
    }

    for(int i=(int)x.size()-1;i>=0;i--)
        x[i].s=max(x[i].s,x[i+1].s);

    for(int i=0;i<a.size();i++)
    {
        int pos=last_p[i].f;

        int l=0,r=(int)x.size();
        while(r!=l)
        {
            int md=(r+l)/2;
            if(x[md].f>=pos)
                r=md;
            else
                l=md+1;
        }

        if(l==x.size())
            cout<<last_p[i].s<<" ";
        else
            cout<<max(last_p[i].s,x[l].s)<<" ";
    }

}


#include <iostream>
#include <fstream>
#include <numeric>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <deque>
#include <bitset>
#include <cstring>

#define f first
#define s second
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define mp make_pair
#define y0 eto
#define y1 mezhdy
#define y2 nami
#define left ksfjgksjfd
#define right fksfjgksjfd

using namespace std;

const int N=200005;
const ll INF=1LL*1000*1000*1000*1000*1000*1000;

int n,q;
vector<int> a;
vector<pair<int,int> > last_p,x;

int main()
{
    //freopen("INPUT.txt","r", stdin);
    cin>>n;
    last_p.resize(n);
    for(int i=0;i<n;i++)
    {
        int v;
        scanf("%d",&v);
        a.pb(v);
        last_p[i]=mp(-1,v);
    }
    cin>>q;
    for(int i=0;i<q;i++)
    {
        int t;
        scanf("%d",&t);
        if(t==1)
        {
            int pos,val;
            scanf("%d %d",&pos,&val);
            pos--;
            last_p[pos]=mp(i,val);
        }
        else
        {
            int cur_x;
            scanf("%d",&cur_x);
            x.pb(mp(i,cur_x));
        }
    }

    for(int i=(int)x.size()-1;i>=0;i--)
        x[i].s=max(x[i].s,x[i+1].s);

    for(int i=0;i<a.size();i++)
    {
        int pos=last_p[i].f;

        int l=0,r=(int)x.size();
        while(r!=l)
        {
            int md=(r+l)/2;
            if(x[md].f>=pos)
                r=md;
            else
                l=md+1;
        }

        if(l==x.size())
            cout<<last_p[i].s<<" ";
        else
            cout<<max(last_p[i].s,x[l].s)<<" ";
    }

}


//https://codeforces.com/problemset/problem/1198/B
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("Ofast")   	//Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define rep for(ll i=0;i<n;i++)

int main(){

    ll n;
    cin>>n;
    ll a[n];
    rep cin>>a[i];

    ll q,tmp=0,lv=-1;
    cin>>q;
    ll lind[n],lq=-1,i=0;
    rep lind[i]=-1;
    while(q--){
        ll op;
        cin>>op;
        if(op==2){
            ll x;
            cin>>x;
            if(x>tmp){
                tmp=x;
                lq=i;
            }
        }
        else{
            ll p,r;
            cin>>p>>r;
            a[p-1]=r;
            lv=r;
            lind[p-1]=i;
        }
        i++;
    }
    //cout<<tmp<<endl;
    i=0;
    rep{
        if(lind[i]>lq)
            cout<<a[i]<<" ";
        else
            cout<<max(a[i],tmp)<<" ";
    }
    cout<<endl;
}


//https://codeforces.com/problemset/problem/1198/B
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("Ofast")   	//Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define rep for(ll i=0;i<n;i++)

int main(){

    ll n;
    cin>>n;
    ll a[n];
    rep cin>>a[i];

    ll q,tmp=0,lv=-1;
    cin>>q;
    ll lind[n]={0},lq=-1,i=0;
    while(q--){
        ll op;
        cin>>op;
        if(op==2){
            ll x;
            cin>>x;
            if(x>tmp){
                tmp=x;
                lq=i;
            }
        }
        else{
            ll p,r;
            cin>>p>>r;
            a[p-1]=r;
            lv=r;
            lind[p-1]=i;
        }
        i++;
    }
    //cout<<tmp<<endl;
    rep{
        if(lind[i]>lq)
            cout<<a[i]<<" ";
        else if(a[i]<tmp)
            cout<<tmp<<" ";
        else
            cout<<a[i]<<" ";
    }
    cout<<endl;
}


//https://codeforces.com/problemset/problem/1198/B
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("Ofast")   	//Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define rep for(ll i=0;i<n;i++)

int main(){
    fastio
    ll n;
    cin>>n;
    ll a[n];
    rep cin>>a[i];

    ll q,tmp=0,lv;
    cin>>q;
    lv=q;
    ll lind[n]={0},i=0;
    ll test[q][3]={0,0};
    while(q--){
        ll op;
        cin>>op;
        test[i][0]=op;
        if(op==1) cin>>test[i][1]>>test[i][2];
        else cin>>test[i][1];
        i++;
    }
    for(ll i=lv-1;i>=0;i--){

        if(test[i][0]==2){

            tmp = max(tmp,test[i][1]);
        }
        else{
            if(lind[test[i][1]-1]==0){
                a[test[i][1]-1] = max(tmp,test[i][2]);

                lind[test[i][1]-1]=1;
            }
        }
    }

    rep{
        if(lind[i]==0)
            cout<<max(a[i],tmp)<<" ";
        else cout<<a[i]<<" ";
    }
    cout<<endl;
}


//https://codeforces.com/problemset/problem/1198/B
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("Ofast")   	//Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define rep for(ll i=0;i<n;i++)

int main(){
    fastio
    ll n;
    cin>>n;
    ll a[n];
    rep cin>>a[i];

    ll q,tmp=0,lv;
    cin>>q;
    lv=q;
    ll lind[n]={0},i=0;
    ll test[q][3]={0,0};
    while(q--){
        ll op;
        cin>>op;
        test[i][0]=op;
        if(op==1) cin>>test[i][1]>>test[i][2];
        else cin>>test[i][1];
        i++;
    }
    for(ll i=lv;i>=0;i--){

        if(test[i][0]==2){

            tmp = max(tmp,test[i][1]);
        }
        else{
            if(lind[test[i][1]-1]==0){
                a[test[i][1]-1] = max(tmp,test[i][2]);

                lind[test[i][1]-1]=1;
            }
        }
    }

    rep{
        if(lind[i]==0)
            cout<<max(a[i],tmp)<<" ";
        else cout<<a[i]<<" ";
    }
    cout<<endl;
}


//https://codeforces.com/problemset/problem/1198/B
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("Ofast")   	//Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define rep for(ll i=0;i<n;i++)

int main(){

    ll n;
    cin>>n;
    ll a[n];
    rep cin>>a[i];

    ll q,tmp=0,last=-1,lv=-1;
    cin>>q;

    while(q--){
        ll op;
        cin>>op;
        if(op==2){
            ll x;
            cin>>x;
            if(x>tmp) tmp=x;
        }
        else{
            ll p,r;
            cin>>p>>r;
            a[p-1]=r;
            lv=r;
            last = p-1;
        }
    }
    //cout<<tmp<<endl;
    rep{
        if(i==last)
            cout<<lv<<" ";
        else if(a[i]<tmp)
            cout<<tmp<<" ";
        else
            cout<<a[i]<<" ";
    }
    cout<<endl;
}


//https://codeforces.com/problemset/problem/1198/B
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("Ofast")   	//Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define rep for(ll i=0;i<n;i++)

int main(){

    ll n;
    cin>>n;
    ll a[n];
    rep cin>>a[i];

    ll q,tmp=0,last=-1,lv=-1;
    cin>>q;
    while(q--){
        ll op;
        cin>>op;
        if(op==2){
            ll x;
            cin>>x;
            if(x>tmp) tmp=x;
        }
        else{
            ll p,r;
            cin>>p>>r;
            a[p-1]=r;
            lv=r;
            last = p-1;
        }
    }
    //cout<<tmp<<endl;
    rep{
        if(i==last)
            cout<<lv<<" ";
        else if(a[i]<tmp)
            cout<<tmp<<" ";
        else
            cout<<a[i]<<" ";
    }
    cout<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define rr return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<=n;i++)
#define f first
#define si second
#define maal(v) v.begin(),v.end()
vector<int>adj[20001];
int vis[20001];
int arr[330006];
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    int n;
    cin>>n;
    vector<pair<int,int> > v;
    Rep(i,n)
    cin>>arr[i];
    int qi,t=1;
    cin>>qi;
    map<int,pair<int,int>>mp;
    int ma=0;
    Rep(i,n)
    mp[arr[i]]={-1,-1};
    while(qi--)
    {
      int a,b,x;
      cin>>a;
      if(a==1)
      {
        cin>>b>>x;
        pair<int,int>vi={t,x};
        mp[arr[b]]=vi;
      }
      else
      {
        cin>>x;
        v.pb({t,x});
        ma=max(ma,x);
      }
      t++;
    }
    int ff[200011]={0};
    int i=v.size()-1;
    ff[t]=v[i].si;
    t--;
    while(t>0)
    {
      if(t==v[i].f && i>=1)
      {

        ff[t]=max(ff[t+1],v[i-1].si);
        i--;
      }
      else
      ff[t]=ff[t+1];
      t--;
    }

  Rep(i,n)
  {
    if(mp[arr[i]].f==-1)
    cout<<max(ma,arr[i])<<" ";
    else
    {
      int p=mp[arr[i]].f;
      p=ff[p];
      p=max(p,mp[arr[i]].si);
      cout<<p<<" ";
    }

  }
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<=n;i++)
#define f first
#define si second
#define maal(v) v.begin(),v.end()
int arr[330006];
int brr[200010],ti[200010];
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    int n;
    cin>>n;
    Rep(i,n)
    cin>>arr[i];
    int qi,t=1;
    cin>>qi;
    int i=1;

    for(int j=0;j<qi;j++)
    {
      int a,b,c;
      cin>>a;
      if(a==1)
      {
        cin>>b>>c;
        arr[b]=c;
        ti[b]=i;
      }
      else
      {
        cin>>c;
        brr[i]=c;
      }
      i++;

    }
    for(int j=i-2;j>=0;j--)
    brr[j]=max(brr[j],brr[j+1]);

    for(int i=1;i<=n;i++)
    {
      arr[i]=max(arr[i],brr[ti[i]]);
      cout<<arr[i]<<" ";
    }

}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define rr return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<=n;i++)
#define f first
#define si second
#define maal(v) v.begin(),v.end()
vector<int>adj[20001];
int vis[20001];
int arr[330006];
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    int n;
    cin>>n;
    vector<pair<int,int> > v;
    Rep(i,n)
    cin>>arr[i];
    int qi,t=1;
    cin>>qi;
    map<int,pair<int,int>>mp;
    int ma=0;
    Rep(i,n)
    mp[arr[i]]={-1,-1};
    while(qi--)
    {
      int a,b,x;
      cin>>a;
      if(a==1)
      {
        cin>>b>>x;
        pair<int,int>vi={t,x};
        mp[arr[b]]=vi;
      }
      else
      {
        cin>>x;
        v.pb({t,x});
        ma=max(ma,x);
      }
      t++;
    }
    int ff[200011]={0};
    int i=v.size()-1;
    t--;
    ff[t]=v[i].si;
    t--;
    while(t>0)
    {
      if(t==v[i].f && i>=1)
      ff[t]=max(ff[t+1],v[i-1].si),i--;
      else
      ff[t]=ff[t+1];
      t--;
    }
  Rep(i,n)
  {
    if(mp[arr[i]].f==-1)
    cout<<max(ma,arr[i])<<" ";
    else
    {
      int p=mp[arr[i]].f;
      p=ff[p];
      p=max(p,mp[arr[i]].si);
      cout<<p<<" ";
    }

  }
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define rr return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<=n;i++)
#define f first
#define si second
#define maal(v) v.begin(),v.end()
vector<int>adj[20001];
int vis[20001];
int arr[330006];
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    int n;
    cin>>n;
    vector<pair<int,int> > v;
    Rep(i,n)
    cin>>arr[i];
    int qi,t=1;
    cin>>qi;
    map<int,pair<int,int>>mp;
    int ma=0;
    Rep(i,n)
    mp[arr[i]]={-1,-1};
    while(qi--)
    {
      int a,b,x;
      cin>>a;
      if(a==1)
      {
        cin>>b>>x;
        pair<int,int>vi={t,x};
        mp[arr[b]]=vi;
      }
      else
      {
        cin>>x;
        v.pb({t,x});
        ma=max(ma,x);
      }
      t++;
    }
    int ff[200011]={0};
    int i=v.size()-1;
    t--;
    ff[t]=v[i].si;
    t--;
    while(t>0 && i>=0)
    {
      if(t==v[i].f && i>=1)
      ff[t]=max(ff[t+1],v[i-1].si),i--;
      else
      ff[t]=ff[t+1];
      t--;
    }
  Rep(i,n)
  {
    if(mp[arr[i]].f==-1)
    cout<<max(ma,arr[i])<<" ";
    else
    {
      int p=mp[arr[i]].f;
      p=ff[p];
      p=max(p,mp[arr[i]].si);
      cout<<p<<" ";
    }

  }
}


#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <cstring>
#include <iostream>
using namespace std;
#define reg register
#define LL long long
#define INF 0x3f3f3f3f
char buffer[8192];
int pos = 8192;
    char Advance() {
    if (pos == 8192) {
        fread(buffer, 1, 8192, stdin);
        pos = 0;
    }
    return buffer[pos++];
}

        inline int re(){
            int x = 0;
            int f = 1;
            char c = Advance();
            while (c < '0' || c > '9'){
                if (c == '-') f = -1;
                c = Advance();
            }
            while (c >= '0' && c <= '9'){
                x = (x << 1) + (x << 3) + c - 48;
                c = Advance();
            }
            x *= f;
            return x;
        }

        template<typename T>
        void pr (T x){
            if (x < 0){
                putchar ('-');
                x = ~x + 1;
            }
            if (x / 10) pr (x / 10);
            putchar (x % 10 + 48);
        }

        const int N = 2e5;

        int n, q, a[N + 5], t[N + 5], b[N + 5];

        int main (){
            n=re();
            for (int i = 1; i <= n; i++)
               a[i]= re ();
            q=re();
            for (int i = 1; i <= q; i++){
                int ty; ty=re();
                if (ty == 1){
                    int p, x; p=re(); x=re();
                    a[p] = x;
                    t[p] = i;
                }
                else{
                    int x; x=re();
                    b[i] = x;
                }
            }
            for (int i = q - 1; i; i--)
                b[i] = max (b[i + 1], b[i]);
            for (int i = 1; i <= n; i++){
                pr (max (a[i], b[t[i] + 1]));
                putchar (' ');
            }
        }


    #include <cstdio>
    #include <cmath>
    #include <cstdlib>
    #include <algorithm>
    #include <vector>
    #include <set>
    #include <map>
    #include <string>
    #include <queue>
    #include <stack>
    #include <cstring>
    #include <iostream>
    using namespace std;
    #define reg register
    #define LL long long
    #define INF 0x3f3f3f3f

    /**** FAST IO ****/
inline int readChar();
template <class T = int> inline T readInt();
template <class T> inline void writeInt( T x, char end = 0 );
inline void writeChar( int x );
inline void writeWord( const char *s );

/** Read */

static const int buf_size = 4096;

inline int getChar() {
    static char buf[buf_size];
    static int len = 0, pos = 0;
    if (pos == len)
        pos = 0, len = fread(buf, 1, buf_size, stdin);
    if (pos == len)
        return -1;
    return buf[pos++];
}

inline int readChar() {
    int c = getChar();
    while (c <= 32)
        c = getChar();
    return c;
}

template <class T>
inline T readInt() {
    int s = 1, c = readChar();
    T x = 0;
    if (c == '-')
        s = -1, c = getChar();
    while ('0' <= c && c <= '9')
        x = x * 10 + c - '0', c = getChar();
    return s == 1 ? x : -x;
}

/** Write */

static int write_pos = 0;
static char write_buf[buf_size];

inline void writeChar( int x ) {
    if (write_pos == buf_size)
        fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;
    write_buf[write_pos++] = x;
}

template <class T>
inline void writeInt( T x, char end ) {
    if (x < 0)
        writeChar('-'), x = -x;

    char s[24];
    int n = 0;
    while (x || !n)
        s[n++] = '0' + x % 10, x /= 10;
    while (n--)
        writeChar(s[n]);
    if (end)
        writeChar(end);
}

inline void writeWord( const char *s ) {
    while (*s)
        writeChar(*s++);
}

struct Flusher {
    ~Flusher() {
        if (write_pos)
            fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;
    }
} flusher;

/************/

    const int N = 2e5;

    int n, q, a[N + 5], t[N + 5], b[N + 5];

    int main (){
        n=readInt();
        for (int i = 1; i <= n; i++)
            a[i] = readInt();
        q=readInt();
        for (int i = 1; i <= q; i++){
            int ty; ty=readInt();
            if (ty == 1){
                int p, x; p=readInt(); x=readInt();
                a[p] = x;
                t[p] = i;
            }
            else{
                int x; x=readInt();
                b[i] = x;
            }
        }
        for (int i = q - 1; i; i--)
            b[i] = max (b[i + 1], b[i]);
        for (int i = 1; i <= n; i++){
            writeInt (max (a[i], b[t[i] + 1]));
            writeChar (' ');
        }
    }


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<vector>
#include<unordered_set>
#include<assert.h>
#include<set>
    using namespace std;
    #define reg register
    #define LL long long
    #define INF 0x3f3f3f3f

const int InputSize  =  67108864; //2^26
const int OutputSize  =  67108864;

namespace fastinput
{
    char buffer[InputSize],*inputString,*eof;
    inline void init()
    {
        assert(stdin != NULL);
        inputString = buffer;
        eof = inputString+fread(buffer,1,InputSize,stdin);
    }
    inline bool read(int &x)
    {
        x = 0;
        int flag = 1;
        while(!isdigit(*inputString))inputString++;
        if(eof<= inputString)return false;
        if(*inputString == '-')flag = -1,inputString++;
        while(isdigit(*inputString))x = x*10+*inputString++-'0';
        x*= flag;
        return true;
    }
}

namespace fastoutput
{
    char buffer[OutputSize];
    char *inputString = buffer;
    inline void flush()
    {
        assert(stdout != NULL);
        fwrite(buffer,1,inputString-buffer,stdout);
        inputString = buffer;
        fflush(stdout);
    }
    inline void print(const char ch)
    {
        if(inputString-buffer>OutputSize-2)flush();
        *inputString++ = ch;
    }
    inline void print(int x)
    {
        char buf[25] =  {0},*p = buf;
        if(x<0)print('-'),x = -x;
        if(x == 0)print('0');
        while(x)*(++p) = x%10,x/= 10;
        while(p!= buf)print(char(*(p--)+'0'));
    }
}

using namespace fastinput;
using namespace fastoutput;

    const int N = 2e5;

    int n, q, a[N + 5], t[N + 5], b[N + 5];

    int main (){
        init();
        read (n);
        for (int i = 1; i <= n; i++)
            read(a[i]);
        read(q);
        for (int i = 1; i <= q; i++){
            int ty; read (ty);
            if (ty == 1){
                int p, x; read(p); read (x);
                a[p] = x;
                t[p] = i;
            }
            else{
                int x; read (x);
                b[i] = x;
            }
        }
        for (int i = q - 1; i; i--)
            b[i] = max (b[i + 1], b[i]);
        for (int i = 1; i <= n; i++){
            print (max (a[i], b[t[i] + 1]));
            putchar (' ');
            flush();
        }
    }


    #include <cstdio>
    #include <cmath>
    #include <cstdlib>
    #include <algorithm>
    #include <vector>
    #include <set>
    #include <map>
    #include <string>
    #include <queue>
    #include <stack>
    #include <cstring>
    #include <iostream>
    using namespace std;
    #define reg register
    #define LL long long
    #define INF 0x3f3f3f3f

    template<typename T>
    void re (T &x){
        x = 0;
        int f = 1;
        char c = getchar ();
        while (c < '0' || c > '9'){
            if (c == '-') f = -1;
            c = getchar ();
        }
        while (c >= '0' && c <= '9'){
            x = (x << 1) + (x << 3) + c - 48;
            c = getchar ();
        }
        x *= f;
    }

    template<typename T>
    void pr (T x){
        if (x < 0){
            putchar ('-');
            x = ~x + 1;
        }
        if (x / 10) pr (x / 10);
        putchar (x % 10 + 48);
    }

    const int N = 2e5;

    int n, q, a[N + 5], t[N + 5], b[N + 5];

    int main (){
        re (n);
        for (int i = 1; i <= n; i++)
            re (a[i]);
        re (q);
        for (int i = 1; i <= q; i++){
            int ty; re (ty);
            if (ty == 1){
                int p, x; re (p); re (x);
                a[p] = x;
                t[p] = i;
            }
            else{
                int x; re (x);
                b[i] = x;
            }
        }
        for (int i = q - 1; i; i--)
            b[i] = max (b[i + 1], b[i]);
        for (int i = 1; i <= n; i++){
            pr (max (a[i], b[t[i] + 1]));
            putchar (' ');
        }
    }


#include <bits/stdc++.h>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

typedef long long ll;
typedef pair<int, int> pii;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n;
    cin >> n;
    vector<int> bal(n);
    vector<int> distinctvec;
    vector<tuple<int,int,int>> queries;
    for (int i = 0; i < n; ++i) {
        cin >> bal[i];
        distinctvec.push_back(bal[i]);
    }
    int q;
    cin >> q;
    int prt = 1;
    int curx = 0;
    for (int i = 0; i < q; ++i) {
        int t;
        cin >> t;
        if (t == 2) {
            int x;
            cin >> x;
            // debug(t, x);
            curx = max(curx, x);
        }
        if (curx > 0 && (t == 1 || i+1 == q)) {
            // debug(curx);
            queries.emplace_back(2, -1, curx);
            distinctvec.push_back(curx);
            curx = 0;
        }
        if (t == 1) {
            int p, x;
            cin >> p >> x;
            --p;
            // debug(t, p, x);
            distinctvec.push_back(x);
            queries.emplace_back(1, p, x);
        }
    }
    q = queries.size();
    int numdistinct = 0;
    unordered_map<int, int> newid;
    vector<int> oldid;
    sort(distinctvec.begin(), distinctvec.end());
    for (int i = 0; i < (int)distinctvec.size(); ++i) {
        if (i == 0 || distinctvec[i] != distinctvec[i-1]) {
            oldid.push_back(distinctvec[i]);
            newid[distinctvec[i]] = numdistinct;
            ++numdistinct;
            // debug(distinctvec[i], newid[distinctvec[i]]);
        }
    }
    vector<unordered_set<int>> indices(numdistinct);
    multiset<int> balance_set;
    for (int i = 0; i < n; ++i) {
        bal[i] = newid[bal[i]];
        indices[bal[i]].insert(i);
        balance_set.insert(bal[i]);
        // debug(i, bal[i]);
    }
    for (int i = 0; i < q; ++i) {
        int t, p, x;
        tie(t, p, x) = queries[i];
        x = newid[x];
        if (t == 1) {
            // debug(t, p, x, bal[p]);
            indices[bal[p]].erase(p);
            balance_set.erase(balance_set.find(bal[p]));
            bal[p] = x;
            indices[x].insert(p);
            balance_set.insert(x);
        } else {
            // debug(t, x);
            for (auto it = balance_set.begin(); it != balance_set.end() && *it < x; ++it) {
                int y = *it;
                while (!indices[y].empty()) {
                    int idx = *indices[y].begin();
                    indices[y].erase(indices[y].begin());
                    bal[idx] = x;
                    indices[x].insert(idx);
                    balance_set.insert(x);
                }
            }
            while (*balance_set.begin() < x) {
                balance_set.erase(balance_set.begin());
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        cout << oldid[bal[i]] << ' ';
    }
    cout << '\n';
}


#include <bits/stdc++.h>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

typedef long long ll;
typedef pair<int, int> pii;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n;
    cin >> n;
    vector<int> bal(n);
    vector<tuple<int,int,int>> queries;
    unordered_map<int, unordered_set<int>> indices;
    multiset<int> balance_set;
    for (int i = 0; i < n; ++i) {
        cin >> bal[i];
        indices[bal[i]].insert(i);
        balance_set.insert(bal[i]);
    }
    int q;
    cin >> q;
    int prt = 1;
    int curx = 0;
    for (int i = 0; i < q; ++i) {
        int t;
        cin >> t;
        if (t == 2) {
            int x;
            cin >> x;
            // debug(t, x);
            curx = max(curx, x);
        }
        if (curx > 0 && (t == 1 || i+1 == q)) {
            // debug(curx);
            queries.emplace_back(2, -1, curx);
            curx = 0;
        }
        if (t == 1) {
            int p, x;
            cin >> p >> x;
            --p;
            // debug(t, p, x);
            queries.emplace_back(1, p, x);
        }
    }
    q = queries.size();
    for (int i = 0; i < q; ++i) {
        int t, p, x;
        tie(t, p, x) = queries[i];
        if (t == 1) {
            // debug(t, p, x, bal[p]);
            indices[bal[p]].erase(p);
            balance_set.erase(balance_set.find(bal[p]));
            bal[p] = x;
            balance_set.insert(x);
            indices[x].insert(p);
        } else {
            // debug(t, x);
            while (true) {
                int y = *balance_set.begin();
                if (y >= x) break;
                balance_set.erase(balance_set.begin());
                while (!indices[y].empty()) {
                    int idx = *indices[y].begin();
                    indices[y].erase(indices[y].begin());
                    bal[idx] = x;
                    indices[x].insert(idx);
                    balance_set.insert(x);
                }
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        cout << bal[i] << ' ';
    }
    cout << '\n';
}


#include <bits/stdc++.h>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

typedef long long ll;
typedef pair<int, int> pii;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n;
    cin >> n;
    vector<int> bal(n);
    vector<int> distinctvec;
    vector<tuple<int,int,int>> queries;
    for (int i = 0; i < n; ++i) {
        cin >> bal[i];
        distinctvec.push_back(bal[i]);
    }
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i) {
        int t;
        cin >> t;
        if (t == 1) {
            int p, x;
            cin >> p >> x;
            --p;
            distinctvec.push_back(x);
            queries.emplace_back(t, p, x);
        } else {
            int x;
            cin >> x;
            distinctvec.push_back(x);
            queries.emplace_back(t, -1, x);
        }
    }
    int numdistinct = 0;
    unordered_map<int, int> newid;
    vector<int> oldid;
    sort(distinctvec.begin(), distinctvec.end());
    for (int i = 0; i < (int)distinctvec.size(); ++i) {
        if (i == 0 || distinctvec[i] != distinctvec[i-1]) {
            oldid.push_back(distinctvec[i]);
            newid[distinctvec[i]] = numdistinct;
            ++numdistinct;
        }
    }
    vector<unordered_set<int>> indices(numdistinct);
    for (int i = 0; i < n; ++i) {
        bal[i] = newid[bal[i]];
        indices[bal[i]].insert(i);
    }
    for (int i = 0; i < q; ++i) {
        int t, p, x;
        tie(t, p, x) = queries[i];
        x = newid[x];
        if (t == 1) {
            indices[bal[i]].erase(i);
            bal[i] = x;
            indices[x].insert(i);
        } else {
            for (int y = 0; y < x; ++y) {
                while (!indices[y].empty()) {
                    int idx = *indices[y].begin();
                    indices[y].erase(indices[y].begin());
                    bal[idx] = x;
                    indices[x].insert(idx);
                }
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        cout << oldid[bal[i]] << ' ';
    }
    cout << '\n';
}


#include <bits/stdc++.h>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

typedef long long ll;
typedef pair<int, int> pii;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n;
    cin >> n;
    vector<int> bal(n);
    vector<int> last(n, -1);
    for (int i = 0; i < n; ++i) {
        cin >> bal[i];
    }
    int q;
    cin >> q;
    vector<int> maxq;
    for (int i = 0; i < q; ++i) {
        int t;
        cin >> t;
        if (t == 1) {
            int p, x;
            cin >> p >> x;
            --p;
            bal[p] = x;
            last[p] = i;
            maxq.push_back(-1);
        } else {
            int x;
            cin >> x;
            maxq.push_back(x);
        }
    }
    for (int i = (int)maxq.size() - 2; i >= 0; --i) {
        maxq[i] = max(maxq[i], maxq[i+1]);
    }
    // debug(bal);
    // debug(last);
    // debug(maxq);
    for (int i = 0; i < n; ++i) {
        bal[i] = max(bal[i], maxq[last[i]+1]);
        cout << bal[i] << ' ';
    }
    cout << '\n';
}


#include <bits/stdc++.h>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

typedef long long ll;
typedef pair<int, int> pii;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n;
    cin >> n;
    vector<int> bal(n);
    vector<int> distinctvec;
    vector<tuple<int,int,int>> queries;
    for (int i = 0; i < n; ++i) {
        cin >> bal[i];
        distinctvec.push_back(bal[i]);
    }
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i) {
        int t;
        cin >> t;
        if (t == 1) {
            int p, x;
            cin >> p >> x;
            --p;
            distinctvec.push_back(x);
            queries.emplace_back(t, p, x);
        } else {
            int x;
            cin >> x;
            distinctvec.push_back(x);
            queries.emplace_back(t, -1, x);
        }
    }
    int numdistinct = 0;
    unordered_map<int, int> newid;
    vector<int> oldid;
    sort(distinctvec.begin(), distinctvec.end());
    for (int i = 0; i < (int)distinctvec.size(); ++i) {
        if (i == 0 || distinctvec[i] != distinctvec[i-1]) {
            oldid.push_back(distinctvec[i]);
            newid[distinctvec[i]] = numdistinct;
            ++numdistinct;
            // debug(distinctvec[i], newid[distinctvec[i]]);
        }
    }
    vector<unordered_set<int>> indices(numdistinct);
    for (int i = 0; i < n; ++i) {
        bal[i] = newid[bal[i]];
        indices[bal[i]].insert(i);
    }
    for (int i = 0; i < q; ++i) {
        int t, p, x;
        tie(t, p, x) = queries[i];
        x = newid[x];
        if (t == 1) {
            indices[bal[p]].erase(p);
            bal[p] = x;
            indices[x].insert(p);
        } else {
            for (int y = 0; y < x; ++y) {
                while (!indices[y].empty()) {
                    int idx = *indices[y].begin();
                    indices[y].erase(indices[y].begin());
                    bal[idx] = x;
                    indices[x].insert(idx);
                }
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        cout << oldid[bal[i]] << ' ';
    }
    cout << '\n';
}


#include <bits/stdc++.h>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

typedef long long ll;
typedef pair<int, int> pii;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n;
    cin >> n;
    set<pii> ms;
    vector<int> bal(n);
    for (int i = 0; i < n; ++i) {
        cin >> bal[i];
        ms.emplace(bal[i], i);
    }
    int q;
    cin >> q;
    while (q--) {
        int t;
        cin >> t;
        if (t == 1) {
            int p, x;
            cin >> p >> x;
            --p;
            ms.erase(pii(bal[p], p));
            bal[p] = x;
            ms.emplace(x, p);
        } else {
            int x;
            cin >> x;
            for (auto it = ms.begin(); it != ms.end() && it->first < x; ++it) {
                bal[it->second] = x;
                ms.emplace(x, it->second);
            }
            while (!ms.empty() && ms.begin()->first < x) {
                ms.erase(ms.begin());
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        cout << bal[i] << ' ';
    }
    cout << '\n';
}


#include <bits/stdc++.h>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

typedef long long ll;
typedef pair<int, int> pii;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n;
    cin >> n;
    vector<int> bal(n);
    vector<int> last(n, -1);
    for (int i = 0; i < n; ++i) {
        cin >> bal[i];
    }
    int q;
    cin >> q;
    vector<int> maxq;
    for (int i = 0; i < q; ++i) {
        int t;
        cin >> t;
        if (t == 1) {
            int p, x;
            cin >> p >> x;
            --p;
            bal[p] = x;
            last[p] = i;
            maxq.push_back(-1);
        } else {
            int x;
            cin >> x;
            maxq.push_back(x);
        }
    }
    maxq.push_back(-1);
    for (int i = (int)maxq.size() - 2; i >= 0; --i) {
        maxq[i] = max(maxq[i], maxq[i+1]);
    }
    // debug(bal);
    // debug(last);
    // debug(maxq);
    for (int i = 0; i < n; ++i) {
        bal[i] = max(bal[i], maxq[last[i]+1]);
        cout << bal[i] << ' ';
    }
    cout << '\n';
}


//{
#include<cstdio>
#include<cstring>
#include<queue>
#include<iostream>
#include<map>
#include<set>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define all(a) a.begin(), a.end()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
//}
const int N = 202020;
const int INF = 1e9 + 7;
int n;
int mi[N << 2], lazy[N << 2];
#define ls id << 1
#define rs id << 1 | 1
void up(int id) {
	int lmin = min(mi[ls], lazy[ls]), rmin = min(mi[rs], lazy[rs]);
	mi[id] = min(lmin, rmin);
}
void down(int id) {
	if(lazy[id] == INF)return ;
	if(mi[ls] < lazy[id])
		mi[ls] = lazy[ls] = lazy[id];
	if(mi[rs] < lazy[id])
		mi[rs] = lazy[rs] = lazy[id];
	lazy[id] = INF;
}
void build(int id, int nl, int nr) {
	lazy[id] = INF;
	if(nl == nr) {
		scanf("%d", mi + id);
		return ;
	}
	int mid = nl + nr >> 1;
	build(ls, nl, mid);
	build(rs, mid + 1, nr);
	up(id);
}
void upd(int id, int nl, int nr, int x) {
	if(mi[id] > x) return ;
	if(mi[id] < x) {
		lazy[id] = mi[id] = x;
		return ;
	}
}
void udp(int id, int nl, int nr, int x, int y) {
	if(nl > x || nr < x)
		return ;
	down(id);
	if(nl == nr) {
		mi[id] = y;
		lazy[id] = INF;
		return ;
	}
	int mid = nl + nr >> 1;
	udp(ls, nl, mid, x, y);
	udp(rs, mid + 1, nr, x, y);
	up(id);
}
int qry(int id, int nl, int nr, int x) {
	if(nl > x || nr < x)
		return INF;
	if(nl == nr)
		return mi[id];
	down(id);
	int mid = nl + nr >> 1;
	return min(qry(ls, nl, mid, x), qry(rs, mid + 1, nr, x));
}
int main(){
	scanf("%d", &n);
	build(1, 1, n);
	int m;
	scanf("%d", &m);
	rep(q, 0, m) {
		int o, x, y;
		scanf("%d", &o);
		if(o == 1) {
			scanf("%d%d", &x, &y);
			udp(1, 1, n, x, y);
		}
		else {
			scanf("%d", &x);
			upd(1, 1, n, x);
		}
	}
	rep(i, 1, n + 1) printf("%d ", qry(1, 1, n, i));
	return 0;
}


//{
#include<cstdio>
#include<cstring>
#include<queue>
#include<iostream>
#include<map>
#include<set>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define all(a) a.begin(), a.end()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
//}
const int N = 202020;
const int INF = 1e9 + 7;
int n;
int mi[N << 2], lazy[N << 2];
#define ls id << 1
#define rs id << 1 | 1
void up(int id) {
	int lmin = min(mi[ls], lazy[ls]), rmin = min(mi[rs], lazy[rs]);
	mi[id] = min(lmin, rmin);
}
void down(int id) {
	if(lazy[id] == INF)return ;
	if(lazy[ls] < lazy[id] || mi[ls] < lazy[id])
		mi[ls] = lazy[ls] = lazy[id];
	if(lazy[rs] < lazy[id] || mi[rs] < lazy[id])
		mi[rs] = lazy[rs] = lazy[id];
	lazy[id] = INF;
}
void build(int id, int nl, int nr) {
	lazy[id] = INF;
	if(nl == nr) {
		scanf("%d", mi + id);
		return ;
	}
	int mid = nl + nr >> 1;
	build(ls, nl, mid);
	build(rs, mid + 1, nr);
	up(id);
}
void upd(int id, int nl, int nr, int x) {
	if(mi[id] > x) return ;
	if(nl == nr) {
		mi[id] = x;
		lazy[id] = INF;
		return ;
	}
	if(mi[id] < x) {
		lazy[id] = mi[id] = x;
		return ;
	}
	down(id);
	int mid = nl + nr >> 1;
	upd(ls, nl, mid, x);
	upd(rs, mid + 1, nr, x);
	up(id);
}
void udp(int id, int nl, int nr, int x, int y) {
	if(nl > x || nr < x)
		return ;
	if(nl == nr) {
		mi[id] = y;
		lazy[id] = INF;
		return ;
	}
	down(id);
	int mid = nl + nr >> 1;
	udp(ls, nl, mid, x, y);
	udp(rs, mid + 1, nr, x, y);
	up(id);
}
int qry(int id, int nl, int nr, int x) {
	if(nl > x || nr < x)
		return INF;
	if(nl == nr)
		return mi[id];
	down(id);
	int mid = nl + nr >> 1;
	return min(qry(ls, nl, mid, x), qry(rs, mid + 1, nr, x));
}
int main(){
	scanf("%d", &n);
	build(1, 1, n);
	int m;
	scanf("%d", &m);
	rep(q, 0, m) {
		int o, x, y;
		scanf("%d", &o);
		if(o == 1) {
			scanf("%d%d", &x, &y);
			udp(1, 1, n, x, y);
		}
		else {
			scanf("%d", &x);
			upd(1, 1, n, x);
		}
	}
	rep(i, 1, n + 1) printf("%d ", qry(1, 1, n, i));
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int P = 1e9 + 7;
inline int add(int a, int b) {if((a += b) >= P) a -= P; return a;}
inline int sub(int a, int b) {if((a -= b) < 0) a += P; return a;}
inline int mul(int a, int b) {return 1ll * a * b % P;}
inline int kpow(int a, int b) {int r=1;for(;b;b>>=1,a=mul(a,a)) {if(b&1)r=mul(r,a);}return r;}
//----
const int N = 202020;
int n, m;
int o[N], p[N], x[N], y[N];
int a[N];
int main(){
	scanf("%d", &n);
	rep(i, 0, n) scanf("%d", a + i);
	scanf("%d", &m);
	vector<pii> sta;
	rep(i, 0, m) {
		scanf("%d", o + i);
		if(o[i] == 1) scanf("%d%d", x + i, y + i), x[i]--;
		else {
			scanf("%d", p + i);
			while(sz(sta) && sta.back() <= mp(p[i], i))
				sta.pop_back();
			sta.push_back({p[i], i});
		}
	}
	set<int> sb;
	rep(i, 0, n) {
		if(a[i] < sta[0].fi)
			sb.insert(i);
	}
	for(int i = 0, j = 0; i < m; i++) {
		if(j < sz(sta) && i == sta[j].se) {
			for(auto &k : sb) {
				if(a[k] < sta[j].fi)
					a[k] = sta[j].fi;
			}
			sb.clear();
			j++;
			continue;
		}
		if(o[i] == 1) {
			int k = x[i];
			a[k] = y[i];
			if(j < sz(sta) && a[k] < sta[j].fi)
				sb.insert(k);
		}
	}
	rep(i, 0, n)printf("%d ", a[i]);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int P = 1e9 + 7;
inline int add(int a, int b) {if((a += b) >= P) a -= P; return a;}
inline int sub(int a, int b) {if((a -= b) < 0) a += P; return a;}
inline int mul(int a, int b) {return 1ll * a * b % P;}
inline int kpow(int a, int b) {int r=1;for(;b;b>>=1,a=mul(a,a)) {if(b&1)r=mul(r,a);}return r;}
//----
const int N = 202020;
int n, m;
int o[N], p[N], x[N], y[N];
int a[N];
int main(){
	scanf("%d", &n);
	rep(i, 0, n) scanf("%d", a + i);
	scanf("%d", &m);
	vector<pii> sta;
	rep(i, 0, m) {
		scanf("%d", o + i);
		if(o[i] == 1) scanf("%d%d", x + i, y + i), x[i]--;
		else {
			scanf("%d", p + i);
			while(sz(sta) && sta.back() <= mp(p[i], i))
				sta.pop_back();
			sta.push_back({p[i], i});
		}
	}
	set<int> sb;
	rep(i, 0, n) {
		if(a[i] < sta[0].fi)
			sb.insert(i);
	}
	for(int i = 0, j = 0; i < m; i++) {
		if(i == sta[j].se) {
			for(auto &k : sb) {
				if(a[k] < sta[j].fi)
					a[k] = sta[j].fi;
			}
			sb.clear();
			j++;
			continue;
		}
		int k = x[i];
		a[k] = y[i];
		if(j < sz(sta) && a[k] < sta[j].fi)
			sb.insert(k);
	}
	rep(i, 0, n)printf("%d ", a[i]);
	return 0;
}


//{
#include<cstdio>
#include<cstring>
#include<queue>
#include<iostream>
#include<map>
#include<set>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define all(a) a.begin(), a.end()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
//}
const int N = 202020;
const int INF = 1e9 + 7;
int n;
int mi[N << 2], lazy[N << 2];
#define ls id << 1
#define rs id << 1 | 1
void up(int id) {
	int lmin = min(mi[ls], lazy[ls]), rmin = min(mi[rs], lazy[rs]);
	mi[id] = min(lmin, rmin);
}
void down(int id) {
	if(lazy[id] == INF)return ;
	if(mi[ls] < lazy[id])
		mi[ls] = lazy[ls] = lazy[id];
	if(mi[rs] < lazy[id])
		mi[rs] = lazy[rs] = lazy[id];
	lazy[id] = INF;
}
void build(int id, int nl, int nr) {
	lazy[id] = INF;
	if(nl == nr) {
		scanf("%d", mi + id);
		return ;
	}
	int mid = nl + nr >> 1;
	build(ls, nl, mid);
	build(rs, mid + 1, nr);
	up(id);
}
void upd(int id, int nl, int nr, int x) {
	if(mi[id] > x) return ;
	if(mi[id] < x) {
		lazy[id] = mi[id] = x;
		return ;
	}
}
void udp(int id, int nl, int nr, int x, int y) {
	if(nl > x || nr < x)
		return ;
	if(nl == nr) {
		mi[id] = y;
		lazy[id] = INF;
		return ;
	}
	down(id);
	int mid = nl + nr >> 1;
	udp(ls, nl, mid, x, y);
	udp(rs, mid + 1, nr, x, y);
	up(id);
}
int qry(int id, int nl, int nr, int x) {
	if(nl > x || nr < x)
		return INF;
	if(nl == nr)
		return mi[id];
	down(id);
	int mid = nl + nr >> 1;
	return min(qry(ls, nl, mid, x), qry(rs, mid + 1, nr, x));
}
int main(){
	scanf("%d", &n);
	build(1, 1, n);
	int m;
	scanf("%d", &m);
	rep(q, 0, m) {
		int o, x, y;
		scanf("%d", &o);
		if(o == 1) {
			scanf("%d%d", &x, &y);
			udp(1, 1, n, x, y);
		}
		else {
			scanf("%d", &x);
			upd(1, 1, n, x);
		}
	}
	rep(i, 1, n + 1) printf("%d ", qry(1, 1, n, i));
	return 0;
}


//{
#include<cstdio>
#include<cstring>
#include<queue>
#include<iostream>
#include<map>
#include<set>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define all(a) a.begin(), a.end()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
//}
const int N = 202020;
const int INF = 1e9 + 7;
int n;
int mi[N << 2], lazy[N << 2];
#define ls id << 1
#define rs id << 1 | 1
void up(int id) {
	int lmin = min(mi[ls], lazy[ls]), rmin = min(mi[rs], lazy[rs]);
	mi[id] = min(lmin, rmin);
}
void down(int id) {
	if(lazy[id] == INF)return ;
	if(lazy[ls] < lazy[id] || mi[ls] < lazy[id])
		mi[ls] = lazy[ls] = lazy[id];
	if(lazy[rs] < lazy[id] || mi[rs] < lazy[id])
		mi[rs] = lazy[rs] = lazy[id];
	lazy[id] = INF;
}
void build(int id, int nl, int nr) {
	lazy[id] = INF;
	if(nl == nr) {
		scanf("%d", mi + id);
		return ;
	}
	int mid = nl + nr >> 1;
	build(ls, nl, mid);
	build(rs, mid + 1, nr);
	up(id);
}
void upd(int id, int nl, int nr, int x) {
	if(mi[id] > x) return ;
	if(nl == nr) {
		mi[id] = x;
		lazy[id] = INF;
		return ;
	}
	down(id);
	int mid = nl + nr >> 1;
	upd(ls, nl, mid, x);
	upd(rs, mid + 1, nr, x);
	up(id);
}
void udp(int id, int nl, int nr, int x, int y) {
	if(nl > x || nr < x)
		return ;
	if(nl == nr) {
		mi[id] = y;
		lazy[id] = INF;
		return ;
	}
	down(id);
	int mid = nl + nr >> 1;
	udp(ls, nl, mid, x, y);
	udp(rs, mid + 1, nr, x, y);
	up(id);
}
int qry(int id, int nl, int nr, int x) {
	if(nl > x || nr < x)
		return INF;
	if(nl == nr)
		return mi[id];
	down(id);
	int mid = nl + nr >> 1;
	return min(qry(ls, nl, mid, x), qry(rs, mid + 1, nr, x));
}
int main(){
	scanf("%d", &n);
	build(1, 1, n);
	int m;
	scanf("%d", &m);
	rep(q, 0, m) {
		int o, x, y;
		scanf("%d", &o);
		if(o == 1) {
			scanf("%d%d", &x, &y);
			udp(1, 1, n, x, y);
		}
		else {
			scanf("%d", &x);
			upd(1, 1, n, x);
		}
	}
	rep(i, 1, n + 1) printf("%d ", qry(1, 1, n, i));
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int P = 1e9 + 7;
inline int add(int a, int b) {if((a += b) >= P) a -= P; return a;}
inline int sub(int a, int b) {if((a -= b) < 0) a += P; return a;}
inline int mul(int a, int b) {return 1ll * a * b % P;}
inline int kpow(int a, int b) {int r=1;for(;b;b>>=1,a=mul(a,a)) {if(b&1)r=mul(r,a);}return r;}
//----
const int N = 202020;
int n, m;
int o[N], p[N], x[N], y[N];
int a[N];
int main(){
	scanf("%d", &n);
	rep(i, 0, n) scanf("%d", a + i);
	scanf("%d", &m);
	vector<pii> sta;
	rep(i, 0, m) {
		scanf("%d", o + i);
		if(o[i] == 1) scanf("%d%d", x + i, y + i), x[i]--;
		else {
			scanf("%d", p + i);
			while(sz(sta) && sta.back() <= mp(p[i], i))
				sta.pop_back();
			sta.push_back({p[i], i});
		}
	}
	set<int> sb;
	rep(i, 0, n) {
		if(sz(sta) && a[i] < sta[0].fi)
			sb.insert(i);
	}
	for(int i = 0, j = 0; i < m; i++) {
		if(j < sz(sta) && i == sta[j].se) {
			for(auto &k : sb) {
				if(a[k] < sta[j].fi)
					a[k] = sta[j].fi;
			}
			sb.clear();
			j++;
			continue;
		}
		if(o[i] == 1) {
			int k = x[i];
			a[k] = y[i];
			if(j < sz(sta) && a[k] < sta[j].fi) {
				sb.insert(k);
			}
		}
	}
	rep(i, 0, n)printf("%d ", a[i]);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long int LL;

#define st first
#define nd second
#define PLL pair <LL, LL>
#define PII pair <int, int>

const int N = 1e6 + 7;
const int MX = 1e9 + 7;
const LL INF = 1LL * MX * MX;

int n, it;
int rep[N];

int bal[N];
set <PII> S;

int Find(int a){
	if(rep[a] == a)
		return a;
	return Find(rep[a]);
}

void Union(int a, int b){
	rep[Find(a)] = Find(b);
}

int main(){
	scanf("%d", &n); it = n;
	for(int i = 1; i <= n; ++i){
		rep[i] = i;
		scanf("%d", &bal[i]);
		S.insert({bal[i], i});
	}

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

	while(q--){
		int t;
		scanf("%d", &t);

		if(t == 1){
			int p, x;
			scanf("%d %d", &p, &x);

			rep[p] = ++it;
			rep[it] = it;

			bal[it] = x;
			S.insert({bal[it], it});
		}
		else{
			int x;
			scanf("%d", &x);

			++it;
			while(S.size() > 0 && (*S.begin()).st < x){
				int t = (*S.begin()).nd;
				S.erase(S.begin());
				rep[t] = it;
			}

			rep[it] = it;
			bal[it] = x;
			S.insert({bal[it], it});
		}
	}

	for(int i = 1; i <= n; ++i)
		printf("%d ", bal[Find(i)]);
	puts("");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long int LL;

#define st first
#define nd second
#define PLL pair <LL, LL>
#define PII pair <int, int>

const int N = 1e6 + 7;
const int MX = 1e9 + 7;
const LL INF = 1LL * MX * MX;

int n, it;
int id[N];

int cnt[N];
vector <int> who[N];

int bal[N];
set <PII> S;

void usun(int t){
	cnt[t]--;
	if(cnt[t] == 0)
		S.erase({bal[t], t});
}

int main(){
	scanf("%d", &n); it = n;
	for(int i = 1; i <= n; ++i){
		id[i] = i; cnt[i] = 1;
		scanf("%d", &bal[i]);

		S.insert({bal[i], i});
		who[i].push_back(i);
	}

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

	while(q--){
		int t;
		scanf("%d", &t);

		if(t == 1){
			int p, x;
			scanf("%d %d", &p, &x);

			usun(id[p]);
			id[p] = ++it;

			cnt[id[p]] = 1;
			who[it].push_back(p);

			bal[it] = x;
			S.insert({bal[it], it});
		}
		else{
			int x;
			scanf("%d", &x);

			vector <int> nxt;
			while(S.size() > 0 && (*S.begin()).st < x){
				int t = (*S.begin()).nd;
				S.erase(S.begin());

				for(auto v: who[t])
					if(id[v] == t)
						nxt.push_back(v);
			}

			if(nxt.size() == 0)
				continue;

			++it;
			for(auto v: nxt)
				id[v] = it;

			cnt[it] = nxt.size();
			who[it] = nxt;

			bal[it] = x;
			S.insert({bal[it], it});
		}
	}

	for(int i = 1; i <= n; ++i)
		printf("%d ", bal[id[i]]);
	puts("");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long int LL;

#define st first
#define nd second
#define PLL pair <LL, LL>
#define PII pair <int, int>

const int N = 1e6 + 7;
const int MX = 1e9 + 7;
const LL INF = 1LL * MX * MX;

int n, it;
int rep[N];

int bal[N];
set <PII> S;

int Find(int a){
	if(rep[a] == a)
		return a;
	return rep[a] = Find(rep[a]);
}

void Union(int a, int b){
	rep[Find(a)] = Find(b);
}

int main(){
	scanf("%d", &n); it = n;
	for(int i = 1; i <= n; ++i){
		rep[i] = i;
		scanf("%d", &bal[i]);
		S.insert({bal[i], i});
	}

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

	while(q--){
		int t;
		scanf("%d", &t);

		if(t == 1){
			int p, x;
			scanf("%d %d", &p, &x);

			rep[p] = ++it;
			rep[it] = it;

			bal[it] = x;
			S.insert({bal[it], it});
		}
		else{
			int x;
			scanf("%d", &x);

			++it;
			while(S.size() > 0 && (*S.begin()).st < x){
				int t = (*S.begin()).nd;
				S.erase(S.begin());
				rep[t] = it;
			}

			rep[it] = it;
			bal[it] = x;
			S.insert({bal[it], it});
		}
	}

	for(int i = 1; i <= n; ++i)
		printf("%d ", bal[Find(i)]);
	puts("");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long int LL;

#define st first
#define nd second
#define PLL pair <LL, LL>
#define PII pair <int, int>

const int N = 1e6 + 7;
const int MX = 1e9 + 7;
const LL INF = 1LL * MX * MX;

int n, it;
int rep[N];

int bal[N];
set <PII> S;

int Find(int a){
	if(rep[a] == a)
		return a;
	return rep[a] = Find(rep[a]);
}

void Union(int a, int b){
	rep[Find(a)] = Find(b);
}

int main(){
	scanf("%d", &n); it = n;
	for(int i = 1; i <= n; ++i){
		rep[i] = i;
		scanf("%d", &bal[i]);
		S.insert({bal[i], i});
	}

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

	while(q--){
		int t, p, x;
		scanf("%d", &t);

		++it;
		if(t == 1){
			scanf("%d %d", &p, &x);
			rep[p] = it;
		}
		else{
			scanf("%d", &x);
			while(S.size() > 0 && (*S.begin()).st < x){
				int cur = (*S.begin()).nd;
				S.erase(S.begin());

				if(rep[cur] == cur)
					rep[cur] = it;
			}
		}

		rep[it] = it;
		bal[it] = x;
		S.insert({bal[it], it});
	}

	for(int i = 1; i <= n; ++i)
		printf("%d ", bal[Find(i)]);
	puts("");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long int LL;

#define st first
#define nd second
#define PLL pair <LL, LL>
#define PII pair <int, int>

const int N = 1e6 + 7;
const int MX = 1e9 + 7;
const LL INF = 1LL * MX * MX;

int n, it;
int id[N];

int cnt[N];
vector <int> who[N];

LL bal[N];
set <PLL> S;

void usun(int t){
	cnt[t]--;
	if(cnt[t] == 0)
		S.erase({bal[t], t});
}

int main(){
	scanf("%d", &n); it = n;
	for(int i = 1; i <= n; ++i){
		id[i] = i; cnt[i] = 1;
		scanf("%lld", &bal[i]);

		S.insert({bal[i], i});
		who[i].push_back(i);
	}

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

	while(q--){
		int t;
		scanf("%d", &t);

		if(t == 1){
			int p, x;
			scanf("%d %d", &p, &x);

			usun(id[p]);
			id[p] = ++it;

			cnt[id[p]] = 1;
			who[it].push_back(p);

			bal[it] = x;
			S.insert({bal[it], it});
		}
		else{
			int x;
			scanf("%d", &x);

			vector <int> nxt;
			while(S.size() > 0 && (*S.begin()).st < x){
				int t = (*S.begin()).nd;
				S.erase(S.begin());

				for(auto v: who[t])
					if(id[v] == t)
						nxt.push_back(v);
			}

			if(nxt.size() == 0)
				continue;

			++it;
			for(auto v: nxt)
				id[v] = it;

			cnt[it] = nxt.size();
			who[it] = nxt;
			bal[it] = x;
		}
	}

	for(int i = 1; i <= n; ++i)
		printf("%lld ", bal[id[i]]);
	puts("");
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, tt, p, x;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(long long i = 0; i < n; i++){
        cin >> fin[i];
        //fin[i] = a[i];
    }

    cin >> q;

    for(long long i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x <= x){
                pay.pop_back();
                //cout << pay.size() << endl;
            }
            pay.push_back({i, x});
        }
    }

    for(long long i = 0; i < n; i++){
        if(pr[i].time == 0){
            fin[i] = max(fin[i], pay.front().x);
        }else{
            fin[i] = pr[i].x;
            if(pay.back().time >= pr[i].time){
                long long l = 0;
                long long r = pay.size() - 1;
                long long mid;
                while(l < r){
                    mid = (r+l)/2;

                    if(mid >= pay.size()){
                        cout << "ERROR";
                        return 0;
                    }

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
                fin[i] = max(fin[i], pay[l].x);
            }
            /*if(l < pay.size()){
            }*/
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, tt, x;
long long p;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(long long i = 0; i < n; i++){
        cin >> fin[i];
    }

    cin >> q;

    for(long long i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x <= x){
                pay.pop_back();
            }
            pay.push_back({i, x});
        }
    }

    for(long long i = 0; i < n; i++){
        if(pr[i].time == 0){
            if(!pay.empty()){
                fin[i] = max(fin[i], pay.front().x);
            }
        }else if(!pay.empty()){
            fin[i] = pr[i].x;
            long long l = 0;
            long long r = pay.size() - 1;
            if(pay.back().time >= pr[i].time){
                long long mid;
                while(l < r){
                    mid = l + (r-l)/2;

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
                fin[i] = max(fin[i], pay[l].x);
            }
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, tt, x;
int p;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(int i = 0; i < n; i++){
        cin >> fin[i];
        //fin[i] = a[i];
    }

    cin >> q;

    for(int i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x <= x){
                pay.pop_back();
                //cout << pay.size() << endl;
            }
            pay.push_back({i, x});
        }
    }

    for(int i = 0; i < n; i++){
        if(pr[i].time == 0){
            if(!pay.empty()){
                fin[i] = max(fin[i], pay.front().x);
            }
        }else{
            fin[i] = pr[i].x;
            int l = 0;
            int r = pay.size() - 1;
            //cout << pay.back().time << " " << pay[r].time << endl;
            if(pay[r].time >= pr[i].time){
                int mid;
                while(l < r){
                    mid = l + (r-l)/2;

                    /*if(mid >= pay.size()){
                        cout << "ERROR" << endl;
                        return 0;
                    }*/

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
                fin[i] = max(fin[i], pay[l].x);
            }
            /*if(l < pay.size()){
            }*/
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, a[1048576], tt, p, x;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(long long i = 0; i < n; i++){
        cin >> a[i];
        fin[i] = a[i];
    }

    cin >> q;

    for(long long i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x < x){
                pay.pop_back();
            }
            pay.push_back({i, x});
        }
    }

    for(long long i = 0; i < n; i++){
        if(pr[i].time == 0){
            fin[i] = max(fin[i], pay.front().x);
        }else{
            fin[i] = pr[i].x;
            long long l = 0;
            long long r = pay.size() - 1;
            if(pay.back().time >= pr[i].time){
                while(l < r){
                    long long mid = l + (r-l)/2;

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
                fin[i] = max(fin[i], pay[l].x);
            }
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, tt, p, x;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(long long i = 0; i < n; i++){
        cin >> fin[i];
        //fin[i] = a[i];
    }

    cin >> q;

    for(long long i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x <= x){
                pay.pop_back();
                //cout << pay.size() << endl;
            }
            pay.push_back({i, x});
        }
    }

    for(long long i = 0; i < n; i++){
        if(pr[i].time == 0){
            fin[i] = max(fin[i], pay.front().x);
        }else{
            fin[i] = pr[i].x;
            long long l = 0;
            long long r = pay.size() - 1;
            if(pay[r].time >= pr[i].time){
                long long mid;
                while(l < r){
                    mid = (r+l)/2;

                    if(mid >= pay.size()){
                        cout << "ERROR" << endl;
                        return 0;
                    }

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
                fin[i] = max(fin[i], pay[l].x);
            }
            /*if(l < pay.size()){
            }*/
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, tt, x;
int p;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(int i = 0; i < n; i++){
        cin >> fin[i];
    }

    cin >> q;

    for(int i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x <= x){
                pay.pop_back();
            }
            pay.push_back({i, x});
        }
    }

    for(int i = 0; i < n; i++){
        if(pr[i].time == 0){
            if(!pay.empty()){
                fin[i] = max(fin[i], pay[0].x);
            }
        }else if(!pay.empty()){
            fin[i] = pr[i].x;
            int l = 0;
            int r = pay.size() - 1;
            if(pay.back().time >= pr[i].time){
                int mid;
                while(l < r){
                    mid = l + (r-l)/2;

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
                fin[i] = max(fin[i], pay[l].x);
            }
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, a[1048576], tt, p, x;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(long long i = 0; i < n; i++){
        cin >> a[i];
        fin[i] = a[i];
    }

    cin >> q;

    for(long long i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x <= x){
                pay.pop_back();
                //cout << pay.size() << endl;
            }
            pay.push_back({i, x});
        }
    }

    for(long long i = 0; i < n; i++){
        if(pr[i].time == 0){
            fin[i] = max(fin[i], pay.front().x);
        }else{
            fin[i] = pr[i].x;
            if(pay.back().time >= pr[i].time){
                long long l = 0;
                long long r = pay.size() - 1;
                long long mid;
                while(l < r && l < pay.size()){
                    mid = (r+l)/2;

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
                fin[i] = max(fin[i], pay[l].x);
            }
            /*if(l < pay.size()){
            }*/
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, a[1048576], tt, p, x;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(long long i = 0; i < n; i++){
        cin >> a[i];
        fin[i] = a[i];
    }

    cin >> q;

    for(long long i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x < x){
                pay.pop_back();
            }
            pay.push_back({i, x});
        }
    }

    for(long long i = 0; i < n; i++){
        if(pr[i].time == 0){
            fin[i] = max(fin[i], pay.front().x);
        }else{
            fin[i] = pr[i].x;
            long long l = 0;
            long long r = pay.size() - 1;
            if(pay.back().time >= pr[i].time){
                while(l != r){
                    long long mid = l + (r-l)/2;

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
                fin[i] = max(fin[i], pay[l].x);
            }
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, tt, p, x;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(long long i = 0; i < n; i++){
        cin >> fin[i];
        //fin[i] = a[i];
    }

    cin >> q;

    for(long long i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x <= x){
                pay.pop_back();
                //cout << pay.size() << endl;
            }
            pay.push_back({i, x});
        }
    }

    for(long long i = 0; i < n; i++){
        if(pr[i].time == 0){
            fin[i] = max(fin[i], pay.front().x);
        }else{
            fin[i] = pr[i].x;
            if(pay.back().time >= pr[i].time){
                long long l = 0;
                long long r = pay.size() - 1;
                long long mid;
                while(l < r){
                    mid = (r+l)/2;

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
                fin[i] = max(fin[i], pay[l].x);
            }
            /*if(l < pay.size()){
            }*/
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    unsigned long long time;
    unsigned long long x;
};

unsigned long long n, q, tt, x;
int p;
unsigned long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(int i = 0; i < n; i++){
        cin >> fin[i];
    }

    cin >> q;

    for(int i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x <= x){
                pay.pop_back();
            }
            pay.push_back({i, x});
        }
    }

    for(int i = 0; i < n; i++){
        if(pr[i].time == 0){
            if(!pay.empty()){
                fin[i] = max(fin[i], pay[0].x);
            }
        }else{
            fin[i] = pr[i].x;
            int l = 0;
            int r = pay.size() - 1;
            if(pay.back().time >= pr[i].time){
                int mid;
                while(l < r){
                    mid = l + (r-l)/2;

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
                fin[i] = max(fin[i], pay[l].x);
            }
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, tt, x;
long long p;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(long long i = 0; i < n; i++){
        cin >> fin[i];
    }

    cin >> q;

    for(long long i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x <= x){
                pay.pop_back();
            }
            pay.push_back({i, x});
        }
    }

    for(long long i = 0; i < n; i++){
        if(pr[i].time == 0){
            if(!pay.empty()){
                fin[i] = max(fin[i], pay.front().x);
            }
        }else{
            fin[i] = pr[i].x;
            if(!pay.empty()){
                long long l = 0;
                long long r = pay.size() - 1;
                if(pay.back().time >= pr[i].time){
                    long long mid;
                    while(l < r){
                        mid = l + (r-l)/2;

                        if(pay[mid].time > pr[i].time){
                            r = mid;
                        }else{
                            l = mid+1;
                        }

                    }
                    fin[i] = max(fin[i], pay[l].x);
                }
            }
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    long long time;
    long long x;
};

long long n, q, a[1048576], tt, p, x;
long long fin[1048576];
query pr[1048576];
vector<query> pay;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(long long i = 0; i < n; i++){
        cin >> a[i];
        fin[i] = a[i];
    }

    cin >> q;

    for(long long i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x <= x){
                pay.pop_back();
                //cout << pay.size() << endl;
            }
            pay.push_back({i, x});
        }
    }

    for(long long i = 0; i < n; i++){
        if(pr[i].time == 0){
            fin[i] = max(fin[i], pay.front().x);
        }else{
            fin[i] = pr[i].x;
            long long l = 0;
            long long r = pay.size() - 1;
            //cout << r << endl;
            if(pay.back().time >= pr[i].time){
                while(l < r && l < pay.size()){
                    long long mid = l + (r-l)/2;

                    if(pay[mid].time > pr[i].time){
                        r = mid;
                    }else{
                        l = mid+1;
                    }

                }
            }
            if(l < pay.size()){
                fin[i] = max(fin[i], pay[l].x);
            }
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include<iostream>
#include<vector>
using namespace std;

struct query
{
    int time;
    int x;
};

int n, q, a[1048576], tt, p, x;
int fin[1048576];
query pr[1048576];
vector<query> pay;
query payout;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for(int i = 0; i < n; i++){
        cin >> a[i];
        fin[i] = a[i];
    }

    cin >> q;

    for(int i = 1; i <= q; i++){
        cin >> tt;
        if(tt == 1){
            cin >> p >> x;
            p--;
            pr[p].time = i;
            pr[p].x = x;
        }else{
            cin >> x;
            while(!pay.empty() && pay.back().x < x){
                pay.pop_back();
            }
            pay.push_back({i, x});
        }
    }

    for(int i = 0; i < n; i++){
        if(pr[i].time == 0){
            fin[i] = max(fin[i], pay.front().x);
        }else{
            fin[i] = pr[i].x;
            int l = 0;
            int r = pay.size() - 1;
            while(l != r){
                int mid = l + (r-l)/2;

                if(pay[mid].time > pr[i].time){
                    r = mid;
                }else{
                    l = mid+1;
                }

            }
            fin[i] = max(fin[i], pay[l].x);
        }
        cout << fin[i] << " ";
    }

    cout << endl;

return 0;
}


#include <bits/stdc++.h>
using namespace std;
int a[201010],n,m,block,addv[200010],belong[200010],cnt;
int main()
{
	cin>>n;
	block=sqrt(n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		belong[i]=(i-1)/block+1;
		if(i%block==1)
		{
			cnt++;
		}
	}
	cin>>m;
	for(int i=1;i<=m;i++)
	{
		int x,y,z;
		scanf("%d%d",&x,&y);
		if(x==1)
		{
			scanf("%d",&z);
			for(int j=(belong[y]-1)*block+1;j<=min(belong[y]*block;j++)
			{
				a[j]=max(a[j],addv[belong[y]]);
			}
			addv[belong[y]]=0;
			a[y]=z;
		}
		else
		{
			for(int i=1;i<=cnt;i++)
			{
				addv[i]=max(addv[i],y);
			}
		}
	}
	for(int i=1;i<=n;i++)
	{
		a[i]=max(a[i],addv[belong[i]]);
	}
	for(int i=1;i<=n;i++)
	{
		printf("%d ",a[i]);
	}
}


#include <bits/stdc++.h>
using namespace std;
int a[200010],n,m,block,addv[200010],belong[200010],cnt;
int main()
{
	cin>>n;
	block=sqrt(n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		belong[i]=(i-1)/block+1;
		if(i%block==1)
		{
			cnt++;
		}
	}
	cin>>m;
	for(int i=1;i<=m;i++)
	{
		int x,y,z;
		scanf("%d%d",&x,&y);
		if(x==1)
		{
			scanf("%d",&z);
			for(int j=(belong[y]-1)*block+1;j<=belong[y]*block;j++)
			{
				a[j]=max(a[j],addv[belong[y]]);
			}
			a[y]=z;
		}
		else
		{
			for(int i=1;i<=cnt;i++)
			{
				addv[i]=max(addv[i],y);
			}
		}
	}
	for(int i=1;i<=n;i++)
	{
		a[i]=max(a[i],addv[belong[i]]);
	}
	for(int i=1;i<=n;i++)
	{
		printf("%d ",a[i]);
	}
}


#include <bits/stdc++.h>
using namespace std;
int a[201010],n,m,block,addv[200010],belong[200010],cnt;
int main()
{
	cin>>n;
	block=sqrt(n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		belong[i]=(i-1)/block+1;
		if(i%block==1)
		{
			cnt++;
		}
	}
	cin>>m;
	for(int i=1;i<=m;i++)
	{
		int x,y,z;
		scanf("%d%d",&x,&y);
		if(x==1)
		{
			scanf("%d",&z);
			for(int j=(belong[y]-1)*block+1;j<=min(belong[y]*block,n);j++)
			{
				a[j]=max(a[j],addv[belong[y]]);
			}
			addv[belong[y]]=0;
			a[y]=z;
		}
		else
		{
			for(int i=1;i<=cnt;i++)
			{
				addv[i]=max(addv[i],y);
			}
		}
	}
	for(int i=1;i<=n;i++)
	{
		a[i]=max(a[i],addv[belong[i]]);
	}
	for(int i=1;i<=n;i++)
	{
		printf("%d ",a[i]);
	}
}


/*  Never Island  */
/*deco loves Chino*/
#include <bits/stdc++.h>
using namespace std;
int n,m,a[200010],back[200010],modi[200010],t[200010];
int gmx[200010];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		modi[i]=a[i];
		t[i]=1;
	}
	cin>>m;
	for(int i=1;i<=m;i++)
	{
		int opt,x,y;
		scanf("%d",&opt);
		if(opt==1)
		{
			scanf("%d%d",&x,&y);
			modi[x]=y;
			t[x]=i;
		}
		else
		{
			scanf("%d",&x);
			gmx[i]=x;
		}
	}
	for(int i=m;i>=1;i--)
	{
		gmx[i]=max(gmx[i],gmx[i+1]);
	}
	for(int i=1;i<=n;i++)
	{
		cout<<max(gmx[t[i]],modi[i])<<" ";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll  long long
typedef vector<ll> vi;
bool sortbysec(const pair<ll,ll> &a, const pair<ll,ll> &b)
{
    return (a.second < b.second);
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;cin>>n;
    vector<ll> vp(n);
    for(ll i=0;i<n;i++){
    	cin>>vp[i];
	}
    ll q;cin>>q;
    ll maxi=0;
    set<ll> s;
    set<ll> :: iterator itr;
    while(q--){
    	ll a;cin>>a;
    	if(a==1){
    		ll i,bal;cin>>i>>bal;
    		vp[i-1]=bal;
    		s.insert(i-1);
		}
		else{
			ll x;cin>>x;
			for(itr=s.begin();itr!=s.end();++itr){
				vp[*itr]=max(vp[*itr],x);
				//cout<<*itr<<endl;
			}
			maxi=max(maxi,x);
		}
	}
	itr=s.begin();
	for(ll i=0;i<n;i++){
		if(itr!=s.end() && *itr==i){
			cout<<vp[i]<<" ";
			++itr;
		}
		else{
			cout<<max(maxi,vp[i])<<" ";
		}
	}
    return 0;
}