t = input() ; n = map(int, raw_input().split()) ; m= c= 1
for i in range(1,t):
  if n[i]>n[i-1] : c+=1
  else : c = 1
  m = max(m,c)
print m


t = input() ; n = map(int, raw_input().split()) ; m=0; c = 1
for i in range(1,t):
  if n[i]>n[i-1] : c+=1
  else : c = 1
  m = max(m,c)
print m


t=input()
a=map(int,raw_input().split())
b=[]
b.append(1)
for i in range(1,t):
    if a[i]>a[i-1]:
        b.append(b[i-1]+1)
    else:
        b.append(1)
print max(b)


n=int(raw_input())
a=raw_input().split()
a=[int(i) for i in a]
m=1
cur=1
for i in range(1,n):
	if(a[i]>a[i-1]):
		cur+=1
		m=max(m,cur)
	else:
		cur=1
print m


n=int(raw_input())
a=raw_input().split()
a=[int(i) for i in a]
dp=[]
for i in range(0,n):
	dp.append(0)
dp[0]=1
for i in range(1,n):
	if(a[i]>a[i-1]):
		dp[i]=dp[i-1]+1;
	else:
		dp[i]=1;
print dp[n-1]


# coding: utf-8

# In[10]:

Max = 1
k = 1
n = input()
m = raw_input().split()
for i in range(n):
    m[i] = int(m[i])
for i in range(n-1):
    if m[i] < m[i+1]:
        k = k + 1;
    else:
        if k > Max:
            Max = k;
        k = 1
if k > Max:
    Max = k
print Max

# In[ ]:


# coding: utf-8

# In[12]:

k = 0
n = input()
m = raw_input().split()

for i in range(n):
    m[i] = int(m[i])

for i in range(n-1):
    if m[i] < m[i+1]:
        k = k + 1;
    if m[i] > m[i+1]:
        k = 0

print k + 1

# In[ ]:


# coding: utf-8

# In[3]:

Max = 1
k = 1
n = input()
m = raw_input().split()

for i in range(n):
    m[i] = int(m[i])

for i in range(n-1):
    if m[i] < m[i+1]:
        k = k + 1;
    else:
        if k > Max:
            Max = k;
        k = 1

print Max

# In[ ]:


# coding: utf-8

# In[7]:

Max = 1
k = 1
n = input()
m = raw_input().split()
for i in range(n-1):
    if m[i] < m[i+1]:
        k = k + 1;
    else:
        if k > Max:
            Max = k;
        k = 1
if k > Max:
    Max = k
print Max

# In[ ]:


# coding: utf-8

# In[7]:

Max = 1
k = 1
n = input()
m = raw_input().split()

for i in range(n):
    m[i] = int(m[i])

for i in range(n-1):
    if m[i] < m[i+1]:
        k = k + 1;
    else:
        if k > Max:
            Max = k;
        k = 1
if k > Max:
    Max = k

print Max

# In[ ]:


#!/usr/bin/python

from collections import deque

def ir():
    return int(raw_input())

def ia():
    line = raw_input()
    line = line.split()
    return map(int, line)

n = ir()
a = ia()

c = 1; m = 1
for i in range(1, n):
    if a[i-1]<a[i]: c+=1
    else: c=1
    m = max(m, c)

print m


#!/usr/bin/python

from collections import deque

def ir():
    return int(raw_input())

def ia():
    line = raw_input()
    line = line.split()
    return map(int, line)

n = ir()
a = ia()

c = 0; m = 0
for i in range(1, n):
    if a[i-1]<a[i]: c+=1 else c=0
    m = max(m, c)

print m


#!/usr/bin/python

from collections import deque

def ir():
    return int(raw_input())

def ia():
    line = raw_input()
    line = line.split()
    return map(int, line)

n = ir()
a = ia()

c = 1; m = 0
for i in range(1, n):
    if a[i-1]<a[i]: c+=1
    else: c=1
    m = max(m, c)

print m


n=raw_input()
a=map(int,raw_input().split(' '))
ans=0
now=1

for i in xrange(1,len(a)):
    if a[i]>a[i-1]:
        now+=1
    else:
        ans=max(ans,now)
        now=1

ans=max(ans,now)
print ans


n = input()
arr = map(int,raw_input().split())
ans = 1
curr_max = 1
for i in range(1,n):
	if arr[i]>arr[i-1]:
		curr_max += 1
	else:
		curr_max = 1
	if curr_max > ans:
		ans = curr_max
print ans


n=input()
word=raw_input()
lis=word.split(' ')
count=1
for i in range(len(lis)-1):
    if int(lis[i+1])>int(lis[i]):
        count+=1
    else:
        count=1
print count


n=input()
word=raw_input()
lis=word.split(' ')
count=1
fin=1
for i in range(len(lis)-1):
    if int(lis[i+1])>int(lis[i]):
        count+=1
    else:
        count=1
    if fin<=count:
            fin=count
print fin


n=input()
word=raw_input()
lis=word.split(' ')
count=1
fin=1
for i in range(len(lis)-1):
    if int(lis[i+1])>int(lis[i]):
        count+=1
    else:
        if fin<=count:
            fin=count
        count=1
print fin


"""

"""

def find_maximum_increase(a):
    max_len = 1
    prev_value = a[0]
    current_len = 1
    # if len(a) == 1:
    #     return 1
    for i in range(1, len(a)):
        # print current_len, '\t', prev_value
        if a[i] > prev_value:
            current_len += 1
            prev_value = a[i]
        else:
            if current_len > max_len:
                max_len = current_len
            current_len = 1
            prev_value = a[i]
    if current_len > max_len:
        max_len = current_len
    # print max_len
    return max_len

if __name__ == '__main__':
    n = int(raw_input())
    s = raw_input().split()
    a = [int(i) for i in s]
    print find_maximum_increase(a)


num = input()
array = map(int, raw_input().split(' '))
outp = 1
ma = 0

for x in xrange(1,num):
	if array[x]>array[x-1]:
		outp += 1
	else:
		if outp>ma:
			ma = outp
		outp = 1

if outp>ma:
	ma = outp
print ma


n = raw_input()
n = int(n)
c=0
d=0
a = map(int, raw_input().split())
for i in range(0,n):
    if(a[i-1]<a[i]):
        c=c+1
    else:
        c=1

    if d<c:
        d=c

print d


n = raw_input()
n = int(n)
c=1
d=0
a = map(int, raw_input().split())
for i in xrange(n-1):
    if(a[i]<a[i+1]):
        c=c+1
    else:
        if d<=c:
            d=c
            c=1
if d<c:
    d=c

print d


n = raw_input()
n = int(n)
c=0
d=0
a = map(int, raw_input().split())
for i in xrange(n-1):
    if(a[i]<a[i+1]):
        c=c+1
    else:
        if d<=c:
            d=c
            c=0
if d<c:
    d=c

print d+1


n = raw_input()
n = int(n)
c=1
d=1
a = map(int, raw_input().split())
for i in range(0,n):
    if(a[i-1]<a[i]):
        c=c+1
    else:
        c=1

    if d<c:
        d=c

print d


n = raw_input()
n = int(n)
c=1
d=1
a = map(int, raw_input().split())
for i in xrange(n):
    if(a[i]>a[i-1]):
        c=c+1
    else:
        c=1

    if d<c:
        d=c
        c=1

print d


n = raw_input()
n = int(n)
c=1
d=0
a = map(int, raw_input().split())
for i in xrange(n-1):
    if(a[i]<a[i+1]):
        c=c+1
    else:
        if d<c:
            d=c
            c=1
if d<c:
    d=c

print d


n = raw_input()
n = int(n)
c=1
d=0
a = map(int, raw_input().split())
for i in xrange(n-1):
    if(a[i]<a[i+1]):
        c=c+1

    else:
        if d<=c:
            d=c
            c=1

if d<=c:
    print c
else:
    print d


# -*- coding: utf-8 -*-

#!/usr/bin/env python

n = int(raw_input())
numbers = map(int, raw_input().split(" "))
ans = 1
count = 1
for i in xrange(n):
	if i + 1 <= n - 1:
		if numbers[i] < numbers[i+1]:
			count += 1
		else:
			if count > ans:
				ans = count
			count = 1
if count > ans:
	ans = count
print ans

# def binary_search(l,x,size):
# 	i = 0
# 	f = size - 1
# 	while True:
# 		meio = (i+f)/2
# 		if x >= l[meio][0] and x <= l[meio][1]:
# 			return meio + 1
# 		elif i > f:
# 			break
# 		elif l[meio][1] < x:
# 			i = meio + 1
# 		elif l[meio][0] > x:
# 			f = meio - 1
# 	return -1

# m = []

# size = int(raw_input())
# x = [int(h) for h in raw_input().split(" ")]
# worms_n = int(raw_input())
# worms = [int(g) for g in raw_input().split(" ")]
# worms.sort()

# z = []
# soma = sum(x)
# for t in xrange(1, soma + 1):
# 	z.append(t)

# for i in xrange(len(x)):
# 	if i == 0:
# 		m.append([z[0],z[x[i] - 1]])
# 	else:
# 		m.append([ z[m[i-1][1]] , z[m[i-1][1] + x[i] - 1]])

# # print m
# for i in worms:
# 	print (binary_search(m, i, size))


# -*- coding: utf-8 -*-

#!/usr/bin/env python

n = int(raw_input())
numbers = map(int, raw_input().split(" "))
ans = 1
for i in xrange(n):
	if i + 1 <= n - 1 and numbers[i] < numbers[i + 1]:
		temp = 2
		z = i + 1
		while z + 1 <= n -1 and numbers[z] < numbers[z + 1]:
			temp += 1
			z += 1
		if ans < temp:
			ans = temp
print ans

# def binary_search(l,x,size):
# 	i = 0
# 	f = size - 1
# 	while True:
# 		meio = (i+f)/2
# 		if x >= l[meio][0] and x <= l[meio][1]:
# 			return meio + 1
# 		elif i > f:
# 			break
# 		elif l[meio][1] < x:
# 			i = meio + 1
# 		elif l[meio][0] > x:
# 			f = meio - 1
# 	return -1

# m = []

# size = int(raw_input())
# x = [int(h) for h in raw_input().split(" ")]
# worms_n = int(raw_input())
# worms = [int(g) for g in raw_input().split(" ")]
# worms.sort()

# z = []
# soma = sum(x)
# for t in xrange(1, soma + 1):
# 	z.append(t)

# for i in xrange(len(x)):
# 	if i == 0:
# 		m.append([z[0],z[x[i] - 1]])
# 	else:
# 		m.append([ z[m[i-1][1]] , z[m[i-1][1] + x[i] - 1]])

# # print m
# for i in worms:
# 	print (binary_search(m, i, size))


n = input()
l = map(int,raw_input().split())
maxi=-1
count=1
prev=l[0]
for x in range(1,len(l)):
    if prev<l[x]:
        count+=1
        prev=l[x]
        maxi=max(maxi,count)
    else:
        maxi=max(maxi,count)
        count=1
    #print count
print maxi


n = input()
l = map(int,raw_input().split())
maxi=1
count=1
prev=l[0]
for x in range(1,len(l)):
    if prev<l[x]:
        count+=1
        prev=l[x]
        maxi=max(maxi,count)
    else:
        maxi=max(maxi,count)
        count=1
    #print count
print maxi


n = input()
l = map(int,raw_input().split())
maxi=1
count=1
prev=l[0]
for x in range(1,len(l)):
    if prev<l[x]:
        count+=1
        prev=l[x]
        maxi=max(maxi,count)
    else:
        maxi=max(maxi,count)
        prev=l[x]
        count=1
    #print count
print maxi


n = int(raw_input())
ls = map(int, raw_input().split())
res = 1
best = 1
for i in range(n-1):
	if ls[i+1] > ls[i]:
		res += 1
		if res > best:
			best = res

	else:
		res = 1

print best


N = input()
arr = map(int, raw_input().strip().split())

MAX = 0
count = 1
if len(arr) == 1:
    print 1
else:
    for i in xrange(len(arr)-1):
        if arr[i] >= arr[i+1]:
            MAX = max(MAX, count)
            count = 1
        else:
            count += 1

    if len(arr) >= 2:
        if arr[-1] > arr[-2]:
            count += 1

    if count:
        MAX = max(MAX, count)

    print MAX


N = input()
arr = map(int, raw_input().strip().split())

MAX = 0
count = 0
if len(arr) == 1:
    print 1
else:
    for i in xrange(len(arr)-1):
        if arr[i] >= arr[i+1]:
            MAX = max(MAX, count)
            count = 0
        else:
            count += 1

    if len(arr) >= 2:
        if arr[-1] > arr[-2]:
            count += 1

    if count:
        MAX = max(MAX, count)

    print MAX


N = input()
arr = map(int, raw_input().strip().split())

MAX = 0
count = 0
for i in xrange(len(arr)-1):
    if arr[i] >= arr[i+1]:
        MAX = max(MAX, count)
        count = 0
    else:
        count += 1

if len(arr) >= 2:
    if arr[-1] > arr[-2]:
        count += 1

if count:
    MAX = max(MAX, count)

print MAX


N = input()
arr = map(int, raw_input().strip().split())
arr.append(-1)

m = 1
count = 0
for i in xrange(len(arr) - 1):
    if arr[i] >= arr[i+1]:
        m = max(m, count+1)
        count = 0
    else:
        count += 1

if count:
    m = max(m, count)

print m


'''input
3
1 2 3
'''
import math
from fractions import gcd
mod=10**9+7
def mp():
	return map(int,raw_input().split())
n=input()
a=mp()
cnt=1
xd=1
for i in range(n-1):
	if a[i]<a[i+1]:
		xd+=1
	else:
		xd=1
	cnt=max(xd,cnt)
print cnt


# 702A : MAXIMUM INCREASE
# Prerequisite :
n=int(raw_input())
number=map(int,raw_input().split())
longest=1
now=1
for i in range(1,n):
    if number[i]>number[i-1]:
        now+=1
        if i==n-1:
            longest=max(longest,now)
    else:
        longest=max(longest,now)
        now=1
print longest


n=int(raw_input())
integers=raw_input()
integers=map(int,integers.split(" "))
incrLen=1
incrList=[incrLen]
for i in xrange(1,n):
	if integers[i-1]<integers[i]:
		incrLen+=1
		incrList.append(incrLen)
	else:
		incrLen=1;

def max(x,y):
	if x>y:
		return x
	else:
		return y
answer=reduce(max,incrList)
print answer


n = int(raw_input())
array = map(int,raw_input().split())
max_length = 1
length = 1
for i in xrange(n-1):
    if array[i+1] > array[i] :
        length = length + 1
        if length > max_length :
            max_length = length
    else:
        length = 1

print max_length


n=input()
ans=1
a=list(map(int,raw_input().split()))
i=1
while i<n:
    j=i
    count=1
    while j<n:
        if a[j]>a[j-1]:
            count+=1
        else:
            break
        j+=1

    ans=max(count,ans)
    i+=1
print ans


n=input()
ans=1
a=list(map(int,raw_input().split()))
i=0
while i<n:
    j=i+1
    count=1
    while j<n:
        if a[j]>a[j-1]:
            count+=1
        else:
            break
        j+=1

    ans=max(count,ans)
    i=j
print ans


r=lambda:map(int,raw_input().split())

n=input()
e=r()
M=0
c=0
p=0
for i in e:
    if i > p:
        c+=1
    else:
        M=max(c,M)
        c=1
    p=i
print max(c,M)


n=int(raw_input())
l=map(int,raw_input().split())
ans=chk=1
tmp=-1
for i in l:
    if tmp==-1:
        pass
    elif i>tmp:
        chk+=1
    else:
        chk=1
    tmp=i
    ans=max(ans,chk)
print ans


n = input()
ax = map(int, raw_input().split())

ma, tmp, last = 1, 0, 0
for a in ax:
    if a > last:
        tmp += 1
    else:
        ma = max(ma, tmp)
        tmp = 1
    last = a
print max(ma, tmp)


n = input()
ax = map(int, raw_input().split())

ma, tmp, last = 1, 0, 0
for a in ax:
    if a > last:
        tmp += 1
    else:
        ma = max(ma, tmp)
        tmp = 0
    last = a
print max(ma, tmp)


n = input()
ax = map(int, raw_input().split())

ma, tmp, last = 1, 0, 0
for a in ax:
    if a > last:
        tmp += 1
    else:
        ma = max(ma, tmp)
        last, tmp = a, 0
print max(ma, tmp)


n = input()

nums = map(int, raw_input().split())

result = 0
count = 1

nums.append(float('-inf'))

for i in xrange(1, len(nums)):
	if nums[i] > nums[i-1]:
		count += 1
	else:
		result = max(count, result)
		count = 1

print result


y = raw_input()
x = map(int, raw_input().split())
counter = [0]
n = 0
for i in x:
    if i > n:
        counter[-1] += 1
    else:
        counter.append(1)
    n = i
print max(counter)


y = raw_input()
x = raw_input()
counter = [0]
n = 0
for i in x:
    if i > n:
        counter[-1] += 1
    else:
        counter.append(1)
    n = i
print max(counter)


import sys

if 0:
    input = open('input')
else:
    input = sys.stdin

def readline():
    return map(int, input.readline().split())

n = readline()
nums = readline()

result = 0
current = 0
prev = float('-inf')

for x in nums:
    if x > prev:
        current = current + 1
    else:
        if current > result:
            result = current
        current = 1
    prev = x
if current > result:
    result = current

print result


n=input()
a=map(int,raw_input().split())
c=0
for i in xrange(1,n):
    if a[i]>a[i-1]:
        c+=1
    else:
        c=0
print c+1


n=input()
a=map(int,raw_input().split())
c=1
mx=1
for i in xrange(1,n):
    if a[i]>a[i-1]:
        c+=1
        if c>mx:
            mx=c
    else:
        c=1
print mx


n=input()
a=map(int,raw_input().split())
c=0
mx=1
for i in xrange(1,n):
    if a[i]>a[i-1]:
        c+=1
    else:
        if c>mx:
            mx=c
        c=0
print mx


n=input()
l=map(int,raw_input().split(" "))
c=1
mx=1
for i in range(1,n):
    if l[i]>l[i-1]:
        c+=1
    else:
        mx=max(c,mx)
        c=1
mx=max(c,mx)
print mx


# -*- coding:utf-8 -*-
import sys

def some_func():
    """
    """

    n = input()
    n_list = map(int, sys.stdin.readline().split())
    cache = []
    flag = 0
    count=0
    for v in n_list:
        if v>flag:
            count+=1
        else:
            cache.append(count)
            count=1
        flag=v
    cache.append(count)
    print max(cache)

if __name__ == '__main__':
    some_func()


n=int(input())
a=map(int,raw_input().split())
g=[1]*n
for i in range(1,n):
  if(a[i]>a[i-1]):
    g[i]=g[i-1]+1
print max(g)


raw_input()
ser = [int(x) for x in raw_input().split(" ")]

length = 1
hi = 1
for i in range (len(ser)-1):
    if ser[i] < ser[i+1]:
        length+=1
    else:
        length=1
    if length > hi:
        hi = length

print hi


raw_input()
ser = [int(x) for x in raw_input().split(" ")]

length = 1
hi = 0
for i in range (len(ser)-1):
    if ser[i] < ser[i+1]:
        length+=1
    else:
        length=1
    if length > hi:
        hi = length

print hi


n=input()
a=map(int,raw_input().split())
c=1
m=1
for i in range(1,n):
    if a[i]>a[i-1]:
        c+=1
    else:
        m=max(m,c)
        c=1
print max(m,c)


def maximum_length_of_increasing_subarray(array):
    ret = 0
    cnt = 1
    for i in range(1, len(array)):
        if array[i] > array[i-1]:
            cnt += 1
        else:
            if cnt > ret:
                ret = cnt
            cnt = 1
    if cnt > ret:
        ret = cnt
    return ret

def main():
    n = int(raw_input())
    array = map(int, raw_input().split())
    print maximum_length_of_increasing_subarray(array)

if __name__ == '__main__':
    main()


n=int(raw_input())
a=map(int,raw_input().split())
tt=[]
cnt=1
for i in xrange(n-1):
    if a[i+1]>a[i]:
        cnt+=1
    else:
        tt.append(cnt)
        cnt=1
tt.append(cnt)
print max(tt)


import math,sys

n=int(sys.stdin.readline())
arr=map(int,sys.stdin.readline().split())
arr.append(0)
max_sofar=0
current=1
for i in xrange(1,n+1):
	if arr[i]>arr[i-1]:
		current+=1
	else:
		max_sofar=max(max_sofar,current)
		current=1
print max_sofar


n=input()
x,s,t=0,0,1
for y in map(int,raw_input().split()):
  if y>x:
    s+=1
  else:
    s=1
  t=max(t,s)
  x=y
print t


n = input()
x = map(int, raw_input().split())

ans = 1
m = x[0]
val = 1
for i in x[1:]:
    if i > m:
        val += 1
    else:
        val = 1
    m = i
    ans = max(ans, val)
print ans


n=int(raw_input())
a=map(int, raw_input().split())

if n==1:
    print 1
    exit()
ct=1
ctm=1
st=a[0]

j=1
while j<n:
    if a[j]>st:
        ct+=1
        st=a[j]
    else:
        ct=1
        st=a[j]
    ctm=max(ctm,ct)
    j+=1
print ctm
exit()


n = raw_input()
a=[]
maxlen = 0
n = int(n)

if n > 0:
	maxlen = 1
	len = 1

if n == 0:
	maxlen = 0

a= (raw_input().split())

a = map(int,a)

for i in range(n):
	if i != n-1:
		if a[i+1] > a[i]:
			len += 1
			if len >= maxlen:
				maxlen = len
		else:
			len = 1

print maxlen


n = raw_input()
a=[]
maxlen = 0
n = int(n)

if n > 0:
	maxlen = 1
	len = 1
print n

a= (raw_input().split())

a = map(int,a)
print len
for i in range(n):
	if i != n-1:
		if a[i+1] > a[i]:
			len += 1
			if len >= maxlen:
				maxlen = len
		else:
			len = 1

print maxlen


n = int(raw_input())

l = map(int, raw_input().split(' '))

max_length = 1
cur_length = 1
for i in xrange(1,n):
    if l[i] > l[i-1]:
        cur_length += 1
    else:
        if cur_length > max_length:
            max_length = cur_length
        cur_length = 1
if cur_length > max_length:
    max_length = cur_length

print max_length


n = int(raw_input())

l = map(int, raw_input().split(' '))

max_length = 1
cur_length = 0
for i in xrange(1,n):
    if l[i] > l[i-1]:
        cur_length += 1
    else:
        if cur_length > max_length:
            max_length = cur_length
        cur_length = 1
if cur_length > max_length:
    max_length = cur_length

print max_length


a = int(raw_input())
b = map(int,raw_input().split())
c = [0]
maxincrease = 0
for i in xrange(a-1):
    if (b[i+1]-b[i])<=0:
        c.append(i+1)
        if i+1-c[-2]>maxincrease:
            maxincrease=i+1-c[-2]
if a-c[-1]>maxincrease:
    maxincrease=a-c[-1]
print maxincrease


n = int(raw_input())
a = map(int, raw_input().split())
cur_value = 1
max_value = 1
for i in range(1,len(a)):
	if a[i] > a[i-1]:
		cur_value += 1
		if max_value < cur_value:
			max_value = cur_value
	else:
		cur = 1
print max_value


n = int(raw_input())
a = map(int, raw_input().split())
cur_value = 1
max_value = 1
for i in range(1,len(a)):
	if a[i] > a[i-1]:
		cur_value += 1
	else:
		cur_value = 1
	if max_value < cur_value:
		max_value = cur_value
print max_value


n = int(raw_input())
a = map(int, raw_input().split())

r = 0
for i in range(len(a)):
    if i and a[i] > a[i - 1]:
        c += 1
    else:
        c = 1
    r = max(c, r)
print r


n = input()
a = map(int, raw_input().split())
fmaxx = 1
for i in range(1, n):
	if a[i] > a[i-1]: fmaxx += 1
	else: fmaxx = 1
print fmaxx


n = input()
a = map(int, raw_input().split())
maxx = 1
fmaxx = 1
for i in range(1, n):
	if a[i] > a[i-1]: maxx += 1
	else:
		if maxx > fmaxx: fmaxx = maxx
		maxx = 1
if maxx > fmaxx: fmaxx = maxx
print fmaxx


n = input()
a = map(int, raw_input().split())
maxx = 1
fmaxx = 1
for i in range(1, n):
	if a[i] > a[i-1]: maxx += 1
	else:
		if maxx > fmaxx: fmaxx = maxx
		maxx = 1
print fmaxx


max1 = 1
k = 1
n = int(raw_input())
a = map(int, raw_input().split())
for i in range(1,len(a)):
    if a[i]>a[i-1]:
        k+=1
        max1=max(max1,k)
    else:
        k=1
print max1


#import sys
#sys.stdin=open("input.txt")
n=int(raw_input())
arr=map(int,raw_input().split())
c=0
ans=1
i=0
while i<n-1:
	if arr[i]<arr[i+1]:
		c=c+1
		#print arr[i],arr[i+1],"c :",c
	else:
		if ans<c:
			ans=c
		c=0
		#print "ans: ",ans
	i+=1
if c>ans:
	ans=c
if c==0:
	print ans
else:
	print ans+1


#import sys
#sys.stdin=open("input.txt")
n=int(raw_input())
arr=map(int,raw_input().split())
c=1
ans=1
i=0
while i<n-1:
	if arr[i]<arr[i+1]:
		c=c+1

	else:
		if ans<c:
			ans=c
		c=1
	i+=1

if ans<c:
	ans=c
print ans


n=int(raw_input())
a=map(int, raw_input().split())
cnt=1
ans=1
for idx in xrange(1,n):
    if a[idx]<=a[idx-1]:
        cnt=0
    cnt+=1
    ans=max(ans,cnt)

print ans


n=int(raw_input())
a=map(int, raw_input().split())
cnt=1
ans=0
for idx in xrange(1,n):
    if a[idx]<=a[idx-1]:
        cnt=0
    cnt+=1
    ans=max(ans,cnt)

print ans


n=int(raw_input)
array=map(int, raw_input())

length=0
partialLength=1

for i in xrange (len (array)-1):
    if array[i+1]>array[i]:
        partialLength+=1
    else:
        length=max(length, partialLength)
        partialLength=1

print max (length, partialLength)


n=int(raw_input)
array=map(int, raw_input().split())

length=0
partialLength=1

for i in xrange (len (array)-1):
    if array[i+1]>array[i]:
        partialLength+=1
    else:
        length=max(length, partialLength)
        partialLength=1

print max (length, partialLength)


n=int(raw_input())
array=map(int, raw_input().split())

length=0
partialLength=1

for i in xrange (len (array)-1):
    if array[i+1]>array[i]:
        partialLength+=1
    else:
        length=max(length, partialLength)
        partialLength=1

print max (length, partialLength)


import sys
n = input()
num = map(int,sys.stdin.readline().split())
i = 1
jmax = 1
j = 1
while (i < n):
	if (num[i] > num[i - 1]):
		j = j + 1
	else:
		if j >= jmax:
			jmax = j
		j = 1
	i = i + 1
print (jmax)


import sys
n = input()
num = map(int,sys.stdin.readline().split())
i = 1
jmax = 0
j = 1
while (i < n):
	if (num[i] > num[i - 1]):
		j = j + 1
	else:
		if j > jmax:
			jmax = j
		j = 1
	i = i + 1
print (jmax)


import sys
n = input()
num = map(int,sys.stdin.readline().split())
i = 1
jmax = 1
j = 1
while (i < n):
	if (num[i] > num[i - 1]):
		j = j + 1
	else:
		if j >= jmax:
			jmax = j
		j = 1
	i = i + 1
if j > jmax:
	jmax = j
print (jmax)


#include<stdio.h>
#define MAX(a,b) a>b?a:b
int tc[200000],x[200000];
int main()
{
    int n;
    scanf("%d",&n);
    int current[n],i;
    for(i=0; i<n; i++)
        scanf("%d",&current[i]);
    int q;
    scanf("%d",&q);
    int serial,max=0,t,tx;
    for(i=0; i<q; i++)
    {
        scanf("%d",&serial);
        if(serial==1)
        {
            scanf("%d%d",&t,&tx);
            current[t-1]=tx;
            tc[t-1]=i;
        }
        else
            scanf("%d",&x[i]);
    }
    for(i=q-1; i>=0; i--)
        x[i]=MAX(x[i],x[i+1]);
    for(i=0; i<n; i++)
        printf("%d ",MAX(current[i],x[tc[i]]));
    return 0;
}


#include<stdio.h>
int px[200000];
int main()
{
    int n,a[200000],m,x,y,q,i,max=0,mxp;
    scanf("%d",&n);
    for(i=0; i<n; i++)
        scanf("%d",&a[i]);
    scanf("%d",&q);
    for(i=0; i<q; i++)
    {
        scanf("%d",&m);
        if(m==2)
        {
            scanf("%d",&x);
            if(x>max)
                max=x,mxp=i;
        }
        else
        {
            scanf("%d%d",&x,&y);
            px[x-1]=i;
            a[x-1]=y;
        }
    }
    for(i=0; i<n; i++)
    {
        if(a[i]>=max)
        {
            printf("%d ",a[i]);
            continue;
        }
        if(px[i])
            if(px[i]>mxp)
                printf("%d ",a[i]);
            else
                printf("%d ",max);
        else
            printf("%d ",max);
    }
    return 0;
}


#include<stdio.h>
int px[200000];
int main()
{
    int n,a[200000],m,x,y,q,i,max=0,mxp;
    scanf("%d",&n);
    for(i=0; i<n; i++)
        scanf("%d",&a[i]);
    scanf("%d",&q);
    for(i=0; i<q; i++)
    {
        scanf("%d",&m);
        if(m==2)
        {
            scanf("%d",&x);
            if(x>max)
                max=x,mxp=i;
        }
        else
        {
            scanf("%d%d",&x,&y);
            px[x-1]=i;
            a[x-1]=y;
        }
    }
    for(i=0; i<n; i++)
        if(a[i]<max)
            if(px[i])
            {
                if(px[i]<=mxp)
                    a[i]=max;
            }
            else
                a[i]=max;
    for(i=0; i<n; i++)
        printf("%d ",a[i]);
    return 0;
}


#include<stdio.h>
#define MAX(a,b) a>b?a:b
int tc[200000],x[200000];
int main()
{
    int n;
    scanf("%d",&n);
    int current[n],i;
    for(i=0; i<n; i++)
        scanf("%d",&current[i]);
    int q;
    scanf("%d",&q);
    int serial,max=0,t,tx;
    for(i=0; i<q; i++)
    {
        scanf("%d",&serial);
        if(serial==1)
        {
            scanf("%d%d",&t,&tx);
            current[t-1]=tx;
            tc[t-1]=i;
        }
        else
            scanf("%d",&x[i]);
    }
    for(i=q-2; i>=0; i--)
        x[i]=MAX(x[i],x[+1]);
    for(i=0; i<n; i++)
        printf("%d ",MAX(current[i],x[tc[i]]));
    return 0;
}


#include<stdio.h>
#define MAX(a,b) a>b?a:b
int tc[200000];
int main()
{
    int n;
    scanf("%d",&n);
    int current[n],i;
    for(i=0; i<n; i++)
        scanf("%d",&current[i]);
    int q;
    scanf("%d",&q);
    int serial[q],max=0,x[200000]={0},p[q],t,tx;
    for(i=0; i<q; i++)
    {
        scanf("%d",&serial[i]);
        if(serial[i]==1)
        {
            scanf("%d%d",&t,&tx);
            current[p[i]-1]=tx;
            tc[t-1]=i;
        }
        else
            scanf("%d",&x[i]);
    }
    for(i=q-1; i>=0; i--)
        x[i]=MAX(x[i],x[i+1]);
    for(i=0; i<n; i++)
        printf("%d ",MAX(current[i],x[tc[i]]));
    return 0;
}


#include<stdio.h>
#define MAX(a,b) a>b?a:b
int tc[200000],x[200000];
int main()
{
    int n;
    scanf("%d",&n);
    int current[n],i;
    for(i=0; i<n; i++)
        scanf("%d",&current[i]);
    int q;
    scanf("%d",&q);
    int serial[q],max=0,p[q],t,tx;
    for(i=0; i<q; i++)
    {
        scanf("%d",&serial[i]);
        if(serial[i]==1)
        {
            scanf("%d%d",&t,&tx);
            current[p[i]-1]=tx;
            tc[t-1]=i;
        }
        else
            scanf("%d",&x[i]);
    }
    for(i=q-1; i>=0; i--)
        x[i]=MAX(x[i],x[i+1]);
    for(i=0; i<n; i++)
        printf("%d ",MAX(current[i],x[tc[i]]));
    return 0;
}


#include<stdio.h>
#define MAX(a,b) a>b?a:b
int tc[200000];
int main()
{
    int n;
    scanf("%d",&n);
    int current[n],i;
    for(i=0; i<n; i++)
        scanf("%d",&current[i]);
    int q;
    scanf("%d",&q);
    int serial[q],max=0,x[q],p[q];
    for(i=0; i<q; i++)
    {
        scanf("%d",&serial[i]);
        if(serial[i]==1)
        {
            scanf("%d%d",&p[i],&x[i]);
            current[p[i]-1]=x[i];
            tc[p[i]-1]=1;
        }
        else
            scanf("%d",&x[i]);
    }
    for(i=q-1; i>=0; i--)
    {
        if(serial[i]==2)
            max=MAX(max,x[i]);
        else
            current[p[i]-1]=MAX(max,current[p[i]-1]);
    }
    for(i=0;i<n;i++)
        if(tc[i]==0)
            current[i]=MAX(current[i],max);
    for(i=0; i<n; i++)
        printf("%d ",current[i]);
    return 0;
}


using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
		string[] str = Console.ReadLine().Split();
		int[]A = new int[N];
		for(var i=0;i<N;i++){
			A[i] = int.Parse(str[i]);
		}
		int Q = int.Parse(Console.ReadLine());
		int[,]P = new int[Q,3];
		for(var i=0;i<Q;i++){
			string[] str3 = Console.ReadLine().Split();
			P[i,0] = int.Parse(str3[0]);
			P[i,1] = int.Parse(str3[1]);
			if(P[i,0]==1){
				P[i,2] = int.Parse(str3[2]);
			}
		}
		var listP = new List<int[]>();
		for(var i=0;i<Q;i++){
			if(P[i,0]==2){
				listP.Add(new int[2]{i,P[i,1]});
			}
		}
		int[]P2 = new int[N];
		int mp = 0;
		for(var i=Q-1;i>=0;i--){
			if(P[i,0]==2){
				mp = Math.Max(P[i,1],mp);
			}
			P2[i] = mp;
		}
		int[]C = new int[N];
		for(var i=0;i<N;i++){
			C[i] = -1;
		}
		int[]D = new int[N];
		for(var i=0;i<Q;i++){
			if(P[i,0]==1){
				D[P[i,1]-1] = P[i,2];
				C[P[i,1]-1] = i;
			}
		}
		int[]E = new int[N];
		for(var i=0;i<N;i++){
			if(C[i] == -1){
				E[i] = Math.Max(A[i],P2[0]);
			} else {
				E[i] = Math.Max(P2[C[i]],D[i]);
			}
		}
		Console.Write(E[0]);
		for(var i=1;i<N;i++){
			Console.Write(" "+E[i]);
		}
	}
}


using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
		string[] str = Console.ReadLine().Split();
		int[]A = new int[N];
		for(var i=0;i<N;i++){
			A[i] = int.Parse(str[i]);
		}
		int Q = int.Parse(Console.ReadLine());
		int[,]P = new int[Q,3];
		for(var i=0;i<Q;i++){
			string[] str3 = Console.ReadLine().Split();
			P[i,0] = int.Parse(str3[0]);
			P[i,1] = int.Parse(str3[1]);
			if(P[i,0]==1){
				P[i,2] = int.Parse(str3[2]);
			}
		}
		var listP = new List<int[]>();
		for(var i=0;i<Q;i++){
			if(P[i,0]==2){
				listP.Add(new int[2]{i,P[i,1]});
			}
		}
		int[]P2 = new int[Q];
		int mp = 0;
		for(var i=Q-1;i>=0;i--){
			if(P[i,0]==2){
				mp = Math.Max(P[i,1],mp);
			}
			P2[i] = mp;
		}
		int[]C = new int[N];
		for(var i=0;i<N;i++){
			C[i] = -1;
		}
		int[]D = new int[N];
		for(var i=0;i<Q;i++){
			if(P[i,0]==1){
				D[P[i,1]-1] = P[i,2];
				C[P[i,1]-1] = i;
			}
		}
		int[]E = new int[N];
		for(var i=0;i<N;i++){
			if(C[i] == -1){
				E[i] = Math.Max(A[i],P2[0]);
			} else {
				E[i] = Math.Max(P2[C[i]],D[i]);
			}
		}
		Console.Write(E[0]);
		for(var i=1;i<N;i++){
			Console.Write(" "+E[i]);
		}
	}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.IO;
using System.Text;
using System.Diagnostics;

using static util;
using P = pair<int, int>;

using Binary = System.Func<System.Linq.Expressions.ParameterExpression,
                           System.Linq.Expressions.ParameterExpression,
                           System.Linq.Expressions.BinaryExpression>;
using Unary = System.Func<System.Linq.Expressions.ParameterExpression,
                          System.Linq.Expressions.UnaryExpression>;

class Program {
    static StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
    static Scan sc = new Scan();
    const int M = 1000000007;
    const int M2 = 998244353;
    const long LM = 1L << 60;
    const double eps = 1e-11;
    static void Main(string[] args)
    {
        int n = sc.Int;
        var a = sc.IntArr;
        int q = sc.Int;
        var lasts = new P[n];
        var ev = new int[q];
        for (int i = 0; i < n; i++)
        {
            lasts[i] = new P(-1, a[i]);
        }
        for (int i = 0; i < q; i++)
        {
            ev[i] = -1;
        }
        for (int i = 0; i < q; i++)
        {
            var s = sc.IntArr;
            if (s[0] == 1) {
                int p = s[1] - 1;
                int x = s[2];
                lasts[p] = new P(i, x);
            }
            else {
                int x = s[1];
                ev[i] = x;
            }
        }
        var max = new int[q + 1];
        max[q] = -1;
        for (int i = q - 1; i >= 0 ; i--)
        {
            max[i] = Math.Max(max[i + 1], ev[i]);
        }
        var ans = new int[n];
        for (int i = 0; i < n; i++)
        {
            ans[i] = Math.Max(lasts[i].v2, max[lasts[i].v1 + 1]);
        }
        Prt(ans);
        sw.Flush();
    }

    static void DBG(string a) => Console.WriteLine(a);
    static void DBG<T>(IEnumerable<T> a) => DBG(string.Join(" ", a));
    static void DBG(params object[] a) => DBG(string.Join(" ", a));
    static void Prt(string a) => sw.WriteLine(a);
    static void Prt<T>(IEnumerable<T> a) => Prt(string.Join(" ", a));
    static void Prt(params object[] a) => Prt(string.Join(" ", a));
}
class pair<T, U> : IComparable<pair<T, U>> {
    public T v1;
    public U v2;
    public pair() : this(default(T), default(U)) {}
    public pair(T v1, U v2) { this.v1 = v1; this.v2 = v2; }
    public int CompareTo(pair<T, U> a) {
        int c = Comparer<T>.Default.Compare(v1, a.v1);
        return c != 0 ? c : Comparer<U>.Default.Compare(v2, a.v2);
    }
    public override string ToString() => v1 + " " + v2;
    public void Deconstruct(out T a, out U b) { a = v1; b = v2; }
    public static bool operator>(pair<T, U> a, pair<T, U> b) => a.CompareTo(b) > 0;
    public static bool operator<(pair<T, U> a, pair<T, U> b) => a.CompareTo(b) < 0;
    public static bool operator>=(pair<T, U> a, pair<T, U> b) => a.CompareTo(b) >= 0;
    public static bool operator<=(pair<T, U> a, pair<T, U> b) => a.CompareTo(b) <= 0;
}
static class util {
    public static pair<T, U> make_pair<T, U>(T v1, U v2) => new pair<T, U>(v1, v2);
    public static T sq<T>(T a) => Operator<T>.Multiply(a, a);
    public static T Max<T>(params T[] a) => a.Max();
    public static T Min<T>(params T[] a) => a.Min();
    public static bool inside(int i, int j, int h, int w) => i >= 0 && i < h && j >= 0 && j < w;
    static readonly int[] dd = { 0, 1, 0, -1 };
    static readonly string dstring = "RDLU";
    public static P[] adjacents(this P p) => adjacents(p.v1, p.v2);
    public static P[] adjacents(this P p, int h, int w) => adjacents(p.v1, p.v2, h, w);
    public static pair<P, char>[] adjacents_with_str(int i, int j)
        => Enumerable.Range(0, dd.Length).Select(k => new pair<P, char>(new P(i + dd[k], j + dd[k ^ 1]), dstring[k])).ToArray();
    public static pair<P, char>[] adjacents_with_str(int i, int j, int h, int w)
        => Enumerable.Range(0, dd.Length).Select(k => new pair<P, char>(new P(i + dd[k], j + dd[k ^ 1]), dstring[k]))
                                         .Where(p => inside(p.v1.v1, p.v1.v2, h, w)).ToArray();
    public static P[] adjacents(int i, int j)
        => Enumerable.Range(0, dd.Length).Select(k => new P(i + dd[k], j + dd[k ^ 1])).ToArray();
    public static P[] adjacents(int i, int j, int h, int w)
        => Enumerable.Range(0, dd.Length).Select(k => new P(i + dd[k], j + dd[k ^ 1])).Where(p => inside(p.v1, p.v2, h, w)).ToArray();
    public static void Assert(bool cond) { if (!cond) throw new Exception(); }
    public static Dictionary<T, int> compress<T>(this IEnumerable<T> a)
        => a.Distinct().OrderBy(v => v).Select((v, i) => new { v, i }).ToDictionary(p => p.v, p => p.i);
    public static Dictionary<T, int> compress<T>(params IEnumerable<T>[] a) => compress(a.Aggregate(Enumerable.Union));
    public static void swap<T>(ref T a, ref T b) where T : struct { var t = a; a = b; b = t; }
    public static void swap<T>(this IList<T> a, int i, int j) where T : struct { var t = a[i]; a[i] = a[j]; a[j] = t; }
    public static T[] copy<T>(this IList<T> a) {
        var ret = new T[a.Count];
        for (int i = 0; i < a.Count; i++) ret[i] = a[i];
        return ret;
    }
}
static class Operator<T> {
    static readonly ParameterExpression x = Expression.Parameter(typeof(T), "x");
    static readonly ParameterExpression y = Expression.Parameter(typeof(T), "y");
    public static readonly Func<T, T, T> Add = Lambda(Expression.Add);
    public static readonly Func<T, T, T> Subtract = Lambda(Expression.Subtract);
    public static readonly Func<T, T, T> Multiply = Lambda(Expression.Multiply);
    public static readonly Func<T, T, T> Divide = Lambda(Expression.Divide);
    public static readonly Func<T, T> Plus = Lambda(Expression.UnaryPlus);
    public static readonly Func<T, T> Negate = Lambda(Expression.Negate);
    public static Func<T, T, T> Lambda(Binary op) => Expression.Lambda<Func<T, T, T>>(op(x, y), x, y).Compile();
    public static Func<T, T> Lambda(Unary op) => Expression.Lambda<Func<T, T>>(op(x), x).Compile();
}

class Scan {
    StreamReader sr;
    public Scan() { sr = new StreamReader(Console.OpenStandardInput()); }
    public Scan(string path) { sr = new StreamReader(path); }
    public int Int => int.Parse(Str);
    public long Long => long.Parse(Str);
    public double Double => double.Parse(Str);
    public string Str => sr.ReadLine().Trim();
    public pair<T, U> Pair<T, U>() {
        T a; U b;
        Multi(out a, out b);
        return new pair<T, U>(a, b);
    }
    public P P => Pair<int, int>();
    public int[] IntArr => StrArr.Select(int.Parse).ToArray();
    public long[] LongArr => StrArr.Select(long.Parse).ToArray();
    public double[] DoubleArr => StrArr.Select(double.Parse).ToArray();
    public string[] StrArr => Str.Split(new[]{' '}, StringSplitOptions.RemoveEmptyEntries);
    bool eq<T, U>() => typeof(T).Equals(typeof(U));
    T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
    T cv<T>(string s) => eq<T, int>()    ? ct<T, int>(int.Parse(s))
                       : eq<T, long>()   ? ct<T, long>(long.Parse(s))
                       : eq<T, double>() ? ct<T, double>(double.Parse(s))
                       : eq<T, char>()   ? ct<T, char>(s[0])
                                         : ct<T, string>(s);
    public void Multi<T>(out T a) => a = cv<T>(Str);
    public void Multi<T, U>(out T a, out U b)
    { var ar = StrArr; a = cv<T>(ar[0]); b = cv<U>(ar[1]); }
    public void Multi<T, U, V>(out T a, out U b, out V c)
    { var ar = StrArr; a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); }
    public void Multi<T, U, V, W>(out T a, out U b, out V c, out W d)
    { var ar = StrArr; a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<W>(ar[3]); }
    public void Multi<T, U, V, W, X>(out T a, out U b, out V c, out W d, out X e)
    { var ar = StrArr; a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<W>(ar[3]); e = cv<X>(ar[4]); }
}


using System;
using System.Linq;

namespace Solution
{
    internal static class Program
    {
        private static void Main(string[] args)
        {
            Reader(out var n, out var a, out var last, out var max);
            FindSolution(n, ref a, last, max);
            Writer(a);
        }

        private static void Reader(out int n, out int[] a, out int[] last, out int[] max)
        {
            n = Convert.ToInt32(Console.ReadLine());
            a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var q = Convert.ToInt32(Console.ReadLine());

            last = new int[n];
            max = new int[q];

            for (var i = 0; i < q; i++)
            {
                var cur = Console.ReadLine().Split().Select(int.Parse).ToArray();

                if (cur[0] == 1)
                {
                    max[i] = 0;
                    last[cur[1] - 1] = i;
                    a[cur[1] - 1] = cur[2];
                }

                if (cur[0] == 2)
                {
                    max[i] = cur[1];
                }
            }

            for (var i = q - 2; i >= 0; i--)
                max[i] = Math.Max(max[i], max[i + 1]);
        }

        private static void FindSolution(int n, ref int[] a, int[] last, int[] max)
        {
            for (var i = 0; i < n; i++)
                a[i] = Math.Max(max[last[i]], a[i]);
        }

        private static void Writer(int[] a)
        {
            foreach (var i in a)
            {
                Console.Write(i + " ");
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PIAA1912188
{
    class Program
    {
        static void Main(string[] args)
        {
            int citizensNumber = int.Parse(Console.ReadLine());
            int[] citizensBalance = Array.ConvertAll<string, int>(Console.ReadLine().Split(' '), int.Parse);
            int logLength = int.Parse(Console.ReadLine());
            int[] govermentGift = new int[logLength];
            int[] citizenBalanceChange = new int[citizensNumber];
            for (int i = 0; i < logLength; i++)
            {
                int[] currentLog = Array.ConvertAll<string, int>(Console.ReadLine().Split(' '), int.Parse);
                if (currentLog[0] == 1)
                {
                    citizenBalanceChange[currentLog[1] - 1] = i;
                    citizensBalance[currentLog[1] - 1] = currentLog[2];
                }
                else
                {
                    govermentGift[i] = currentLog[1];
                }
            }
            for (int i = logLength - 2; i >= 0; i--)
                govermentGift[i] = Math.Max(govermentGift[i + 1], govermentGift[i]);
            for (int i = 0; i < citizensNumber; i++)
            {
                citizensBalance[i] = Math.Max(citizensBalance[i], govermentGift[citizenBalanceChange[i]]);
                Console.Write(citizensBalance[i].ToString() + " ");
            }
            Console.Read();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using SB = System.Text.StringBuilder;
//using System.Threading.Tasks;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
using System.Numerics;
using static System.Math;
using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    readonly Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    readonly int dom = 998244353;
    bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (b.CompareTo(a) < 0) { a = b; return true; } return false; }

    void solve()
    {
        int N = cin.nextint;
        var A = cin.scanint;
        var B = new int[N];//i番目の徳政令前に支払い
        var L = new List<int>();

        int Q = cin.nextint;
        //var S = new SegTree<int>(Q, Max, -1);

        for (int i = 0; i < Q; i++)
        {
            if (cin.nextint == 1)
            {
                int p = cin.nextint - 1;
                int x = cin.nextint;
                A[p] = x;
                B[p] = L.Count;
            }
            else
            {
                L.Add(cin.nextint);
            }
        }

        var Z = L.ToArray();
        for (int i = Z.Length - 1 - 1; i >= 0; i--)
        {
            chmax(ref Z[i], Z[i + 1]);
        }

        for (int i = 0; i < A.Length; i++)
        {
            if (B[i] < Z.Length)
            {
                chmax(ref A[i], Z[B[i]]);
            }

        }
        A.join();

    }
    /// <OriginalAuthor>riantkb</OriginalAuthor>
    class SegTree<T>
    {
        readonly int n;
        int s, t;
        T[] tr;
        readonly Func<T, T, T> f;
        readonly T exnum;

        /// <summary>
        ///  セグメントツリーの構築1
        /// </summary>
        /// <param name="m">要素数</param>
        /// <param name="f">マージ関数</param>
        /// <param name="ex">単位元</param>
        public SegTree(int m, Func<T, T, T> f, T ex)
        {
            this.f = f; exnum = ex; n = 1;
            while (n < m) n <<= 1;
            tr = new T[(n << 1) - 1];
            for (int i = 0; i < tr.Length; i++) tr[i] = ex;
        }
        public SegTree(int m, Func<T, T, T> f, T ex, T ini) : this(m, f, ex)
        {
            for (int i = 0; i < m; i++) Assign(i, ini);
            All_Update();
        }
        public SegTree(int m, Func<T, T, T> f, T ex, IList<T> ini) : this(m, f, ex)
        {
            for (int i = 0; i < m; i++) Assign(i, ini[i]);
            All_Update();
        }
        public T Look(int j) => tr[j + n - 1];
        public T Peek() => tr[0];

        /// <summary>
        /// 最下層に値の代入
        /// </summary>
        /// <param name="j">代入するインデックス</param>
        /// <param name="x">代入する値</param>
        public void Assign(int j, T x) => tr[j + n - 1] = x;
        public void Update(int j, T x)
        {
            Assign(j, x);
            Update(j);
        }
        public void Update(int j)
        {
            int i = j + n - 1;
            while (i > 0) { i = i - 1 >> 1; tr[i] = f(tr[i << 1 | 1], tr[i + 1 << 1]); }
        }
        public void All_Update() { for (int i = n - 2; i >= 0; i--) tr[i] = f(tr[i << 1 | 1], tr[i + 1 << 1]); }
        /// <summary>
        /// return node[s, t] 区間クエリ
        /// </summary>
        /// <param name="s">左端 0-indexed</param>
        /// <param name="t">右端 0-indexed</param>
        /// <returns>node[s, t]</returns>
        public T this[int s, int t] => Run(s, t);
        T Run(int s, int t) { t++; this.s = s; this.t = t; return Query(0, 0, n); }
        T Query(int k, int l, int r) => r <= s || t <= l ? exnum : s <= l && r <= t ? tr[k]
                                  : f(Query(k << 1 | 1, l, l + r >> 1), Query(k + 1 << 1, l + r >> 1, r));

        public T[] Items
        {
            get
            {
                var ret = new T[n];
                for (int i = 0; i < ret.Length; i++)
                {
                    ret[i] = Look(i);
                }
                return ret;
            }
        }
    }

}

static class Ex
{
    public static void join<T>(this IEnumerable<T> values, string sep = " ") => WriteLine(string.Join(sep, values));
    public static string concat<T>(this IEnumerable<T> values) => string.Concat(values);
    public static string reverse(this string s) { var t = s.ToCharArray(); Array.Reverse(t); return t.concat(); }

    public static int lower_bound<T>(this IList<T> arr, T val) where T : IComparable<T>
    {
        int low = 0, high = arr.Count;
        int mid;
        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (arr[mid].CompareTo(val) < 0) low = mid + 1;
            else high = mid;
        }
        return low;
    }
    public static int upper_bound<T>(this IList<T> arr, T val) where T : IComparable<T>
    {
        int low = 0, high = arr.Count;
        int mid;
        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (arr[mid].CompareTo(val) <= 0) low = mid + 1;
            else high = mid;
        }
        return low;
    }
}

class Pair<T, U> : IComparable<Pair<T, U>> where T : IComparable<T> where U : IComparable<U>
{
    public T f; public U s;
    public Pair(T f, U s) { this.f = f; this.s = s; }
    public int CompareTo(Pair<T, U> a) => f.CompareTo(a.f) != 0 ? f.CompareTo(a.f) : s.CompareTo(a.s);
    public override string ToString() => $"{f} {s}";
}

class Scanner
{
    string[] s; int i;
    readonly char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan => ReadLine().Split();
    public int[] scanint => Array.ConvertAll(scan, int.Parse);
    public long[] scanlong => Array.ConvertAll(scan, long.Parse);
    public double[] scandouble => Array.ConvertAll(scan, double.Parse);
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint => int.Parse(next);
    public long nextlong => long.Parse(next);
    public double nextdouble => double.Parse(next);
}


#[allow(unused_imports)]
use std::cmp::{Ordering};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};

#[allow(unused_imports)]
use std::iter::FromIterator;

#[allow(unused_macros)]
macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::min($x, min!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::max($x, max!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! get {
    ([$t: ty]) => {
        {
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            line.split_whitespace().map(|t|t.parse::<$t>().unwrap()).collect::<Vec<_>>()
        }
    };
    ([$t: ty];$n: expr) => {
        (0..$n).map(|_|get!([$t])).collect::<Vec<_>>()
    };
    ($t: ty) => {
        {
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t: ty),*) => {
        {
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap(),)*)
        }
    };
    ($t: ty; $n: expr) => {
        (0..$n).map(|_|get!($t)).collect::<Vec<_>>()
    };
    ($($t: ty),*; $n: expr) => {
        (0..$n).map(|_|get!($($t),*)).collect::<Vec<_>>()
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

const BIG_STACK_SIZE: bool = true;

#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}

fn solve() {
    let n = get!(usize);
    let a = get!([u64]);
    let q = get!(usize);

    let mut vec = a.into_iter().map(|e| (e,0)).collect::<Vec<_>>();
    let mut maxs = vec![0;q+1];
    let mut queries = Vec::new();
    for i in 0..q {
        let mut line = String::new();
        stdin().read_line(&mut line).unwrap();
        let tokens = line.split_whitespace().collect::<Vec<_>>();
        if tokens.len() == 3 {
            let p = tokens[1].parse::<usize>().unwrap();
            let x = tokens[2].parse::<u64>().unwrap();
            vec[p-1] = (x,i);
            queries.push(None);
        } else {
            let x = tokens[1].parse::<u64>().unwrap();
            queries.push(Some(x));
        }
    }

    for i in (0..q).rev() {
        if let Some(x) = queries[i] {
            maxs[i] = max!(x, maxs[i+1]);
        } else {
            maxs[i] = maxs[i+1];
        }
    }

    for i in 0..n {
        print!("{} ", max!(vec[i].0, maxs[vec[i].1]));
    }
    println!("");
}


use std::i64;
use std::io::{self, BufRead};
use std::str::FromStr;

const DEBUG: bool = false;

macro_rules! debug {
    ($($arg:tt)*) => ({
        if DEBUG { println!($($arg)*); }
    })
}

struct MyHandler<H> {
    handler: H,
}

impl<H> MyHandler<H>
where
    H: BufRead,
{
    pub fn new(handler: H) -> Self {
        Self { handler: handler }
    }

    pub fn read_line(&mut self) -> String {
        let mut buffer = String::new();
        self.handler
            .read_line(&mut buffer)
            .expect("Error in read_line");
        buffer.trim().to_string()
    }

    pub fn read_elem<B: FromStr>(&mut self) -> B {
        let string = self.read_line();
        B::from_str(&string).ok().expect("Error in read_elem")
    }

    pub fn read_vec<B: FromStr>(&mut self) -> Vec<B> {
        let string = self.read_line();
        string
            .split_ascii_whitespace()
            .map(|s| B::from_str(s).ok().expect("Error in read_vec"))
            .collect::<Vec<B>>()
    }
}

fn main() {
    let stdin = io::stdin();
    let mut my_stdin = MyHandler::new(stdin.lock());

    let n = my_stdin.read_elem::<usize>();
    let mut init_balance = my_stdin.read_vec::<i64>();
    let mut init_pos = vec![0usize; n];

    let q = my_stdin.read_elem::<usize>();

    debug!("{} {:?} {}", n, init_balance, q);

    let mut payout_query = vec![-1i64; q];

    for i in 0..q {
        let temp = my_stdin.read_vec::<i64>();
        if temp[0] == 1 {
            let p = temp[1] as usize - 1;
            let v = temp[2];
            init_balance[p] = v;
            init_pos[p] = i;
        } else if temp[0] == 2 {
            payout_query[i] = temp[1];
        } else {
            unreachable!("Invalid Input");
        }
    }

    debug!("{:?}", init_balance);
    debug!("{:?}", init_pos);
    debug!("{:?}", payout_query);

    // get post-max
    for i in (0..q - 1).rev() {
        payout_query[i] = i64::max(payout_query[i], payout_query[i + 1]);
    }
    debug!("{:?}", payout_query);

    for i in 0..n {
        debug!(
            "{}: {} {} {}",
            i, init_balance[i], init_pos[i], payout_query[init_pos[i]]
        );
        let res = if payout_query[init_pos[i]] == -1 {
            // no payout
            init_balance[i]
        } else {
            i64::max(init_balance[i], payout_query[init_pos[i]])
        };
        print!("{} ", res);
    }
}


#![allow(unused_imports)]
use std::cmp::*;
use std::collections::*;

struct Scanner {
   buffer : std::collections::VecDeque<String>
}

impl Scanner {

   fn new() -> Scanner {
      Scanner {
         buffer: std::collections::VecDeque::new()
      }
   }

   fn next<T : std::str::FromStr >(&mut self) -> T {

      if self.buffer.len() == 0 {
         let mut input = String::new();
         std::io::stdin().read_line(&mut input).ok();
         for word in input.split_whitespace() {
            self.buffer.push_back(word.to_string())
         }
      }

      let front = self.buffer.pop_front().unwrap();
      front.parse::<T>().ok().unwrap()
   }
}

fn main() {
    let mut s = Scanner::new();
    let n : i32 = s.next();
    let mut a: Vec<i32> = Vec::new();
    let mut ops: Vec<(i32,i32,i32)> = Vec::new();
    let mut finish: Vec<bool> = Vec::new();
    for _i in 0..n {
        a.push(s.next());
        finish.push(false);
    }
    let q : i32 = s.next();
    for _i in 0..q {
        let op :i32 = s.next();
        let v1 :i32 = s.next();
        if op == 1 {
            let v2 :i32 = s.next();
            ops.push((op,v1-1,v2));
        }else{
            ops.push((op,v1,0));
        }
    }
    let mut lastmax:i32 = 0;
    for op in ops.iter().rev() {
        if op.0 == 2 {
            lastmax = max(lastmax,op.1);
            continue;
        }
        let idx:usize = op.1 as usize;
        let val = op.2;
        if finish[idx] {
            continue;
        }
        finish[idx] = true;
        a[idx] = max(val,lastmax);
    }
    for i in 0..n {
        let idx:usize = i as usize;
        print!("{} ", if finish[idx] { a[idx] } else { max(a[idx],lastmax) });
    }
    println!("");
}


#![allow(unused_imports)]
use std::collections::{HashSet, HashMap};
use std::cmp::{min,max};
use std::io::{self, Write};
use std::str;

struct Scanner<R> {
    reader: R,
    buf_str: Vec<u8>,
    buf_iter: str::SplitAsciiWhitespace<'static>,
}
impl<R: io::BufRead> Scanner<R> {
    fn new(reader: R) -> Self {
        Self { reader, buf_str: Vec::new(), buf_iter: "".split_ascii_whitespace() }
    }
    fn token<T: str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buf_iter.next() {
                return token.parse().ok().expect("Failed parse");
            }
            self.buf_str.clear();
            self.reader.read_until(b'\n', &mut self.buf_str).expect("Failed read");
            self.buf_iter = unsafe {
                let slice = str::from_utf8_unchecked(&self.buf_str);
                std::mem::transmute(slice.split_ascii_whitespace())
            }
        }
    }
}

fn main() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());

    let n = scan.token::<usize>();
    let mut a: Vec<usize> = (0..n).map(|_| scan.token()).collect();
    let mut t = vec![0; n];
    let q = scan.token::<usize>();
    let mut gen = Vec::with_capacity(q + 1);
    gen.push(0);
    for cur_t in 1..=q {
        let typ = scan.token::<usize>();
        if typ == 1 {
            let p = scan.token::<usize>() - 1;
            a[p] = scan.token::<usize>();
            t[p] = cur_t;
            gen.push(0);
        } else {
            gen.push(scan.token::<usize>());
        }
    }
    for i in (0..q).rev() {
        gen[i] = max(gen[i], gen[i + 1]);
    }
    for i in 0..n {
        write!(out, "{} ", max(a[i], gen[t[i]])).ok();
    }
    writeln!(out, "").ok();
}


#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Read, Write, BufWriter};

#[allow(dead_code)]
fn getline() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok().unwrap();
    ret
}

fn get_word() -> String {
    let stdin = std::io::stdin();
    let mut stdin=stdin.lock();
    let mut u8b: [u8; 1] = [0];
    loop {
        let mut buf: Vec<u8> = Vec::with_capacity(16);
        loop {
            let res = stdin.read(&mut u8b);
            if res.unwrap_or(0) == 0 || u8b[0] <= b' ' {
                break;
            } else {
                buf.push(u8b[0]);
            }
        }
        if buf.len() >= 1 {
            let ret = String::from_utf8(buf).unwrap();
            return ret;
        }
    }
}

#[allow(dead_code)]
fn get<T: std::str::FromStr>() -> T { get_word().parse().ok().unwrap() }

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }
    let n: usize = get();
    let a: Vec<i64> = (0..n).map(|_| get()).collect();
    let q: usize = get();
    let mut last = vec![(0, 0); n];
    for i in 0..n {
        last[i].1 = a[i];
    }
    let mut two: Vec<(usize, i64)> = vec![];
    for i in 1..q + 1 {
        let ty: i32 = get();
        if ty == 1 {
            let p: usize = get::<usize>() - 1;
            let x: i64 = get();
            last[p] = (i, x);
        } else {
            let x: i64 = get();
            while let Some(ev) = two.pop() {
                if ev.1 > x {
                    two.push(ev);
                    break;
                }
            }
            two.push((i, x));
        }
    }
    let mut ans = vec![0; n];
    for i in 0..n {
        let idx = two.binary_search(&last[i]).err().unwrap();
        if idx < two.len() && two[idx].1 >= last[i].1 {
            ans[i] = two[idx].1;
        } else {
            ans[i] = last[i].1;
        }
        puts!("{}\n", ans[i]);
    }
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


package main

import (
	"bufio"
	"os"
	"runtime"
	"strconv"
)

/* solution */

func solve() {

	n := readInt()
	balance := make([]int, n)
	pointer := make([]int, n)
	for i := 0; i < n; i++ {
		balance[i] = readInt()
	}

	q := readInt()
	social := make([]int, 0)

	for i := 0; i < q; i++ {
		op := readInt()
		if op == 1 {
			p, x := readInt()-1, readInt()
			balance[p] = x
			pointer[p] = len(social)
		} else {
			x := readInt()
			social = append(social, x)
		}
	}

	for i := len(social) - 2; i >= 0; i-- {
		if social[i+1] > social[i] {
			social[i] = social[i+1]
		}
	}

	for i := 0; i < n; i++ {
		if pointer[i] < len(social) && social[pointer[i]] > balance[i] {
			printInt(social[pointer[i]])
		} else {
			printInt(balance[i])
		}
	}

}

/* stubs */

func main() {

	var f *os.File
	if runtime.GOROOT() == "C:\\Soft\\Go" {
		f, _ = os.Open("input.txt")
	} else {
		f = os.Stdin
	}
	defer f.Close()

	writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	reader = bufio.NewScanner(f)
	reader.Split(bufio.ScanWords)

	solve()

}

var reader *bufio.Scanner
var writer *bufio.Writer

func readInt() int {
	reader.Scan()
	ret, _ := strconv.Atoi(reader.Text())
	return ret
}

func readString() string {
	reader.Scan()
	return reader.Text()
}

func print(s string) {
	writer.WriteString(s)
	writer.WriteString("\n")
}

func printInt(i int) {
	print(strconv.Itoa(i))
}


package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
)

var segTree = make([]int, 1000000)

func getTarget(index, target, left, right, maxLazy int) int {
	var value int
	if segTree[index] > maxLazy {
		value = segTree[index]
	} else {
		value = maxLazy
	}
	if left == right {
		return value
	} else {
		mid := (left + right) / 2
		if target <= mid {
			return getTarget(index * 2 + 1, target, left, mid, value)
		} else {
			return getTarget(index * 2 + 2, target, mid + 1, right, value)
		}
	}
}

func setTarget(index, target, value, left, right, lazy int) {
	if left == right {
		fmt.Printf("index=%d target=%d left=%d right=%d\n", index, target, left, right)
		segTree[index] = value
		return
	} else {
		if segTree[index] > lazy {
			lazy = segTree[index]
		}
		segTree[index] = 0
		mid := (left + right) / 2
		if target <= mid {
			setLazy(index * 2 + 2, lazy)
			setTarget(index * 2 + 1, target, value, left, mid, lazy)
			return
		} else {
			setLazy(index * 2 + 1, lazy)
			setTarget(index * 2 + 2, target, value, mid + 1, right, lazy)
			return
		}
	}
}

func setLazy(index, lazy int) {
	if index < len(segTree) && lazy > segTree[index] {
		segTree[index] = lazy
	}
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	for i := 0;i < n;i ++ {
		var money int
		if i == n - 1 {
			fmt.Fscanf(reader, "%d\n", &money)
		} else {
			fmt.Fscanf(reader, "%d ", &money)
		}
		setTarget(0, i, money, 0, n - 1, 0)
	}
	var q int
	fmt.Fscanf(reader, "%d\n", &q)
	for i := 0;i < q;i ++ {
		var req, p, x int
		fmt.Fscanf(reader, "%d ", &req)
		if req == 1 {
			fmt.Fscanf(reader, "%d %d\n", &p, &x)
			setTarget(0, p - 1, x, 0, n - 1, 0)
		} else {
			fmt.Fscanf(reader, "%d\n", &x)
			setLazy(0, x)
		}
	}
	for i := 0;i < n;i ++ {
		fmt.Printf("%d ", getTarget(0, i, 0, n - 1, 0))
	}
}


package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
)

var segTree = make([]int, 1000000)

func getTarget(index, target, left, right, maxLazy int) int {
	var value int
	if segTree[index] > maxLazy {
		value = segTree[index]
	} else {
		value = maxLazy
	}
	if left == right {
		return value
	} else {
		mid := (left + right) / 2
		if target <= mid {
			return getTarget(index * 2 + 1, target, left, mid, value)
		} else {
			return getTarget(index * 2 + 2, target, mid + 1, right, value)
		}
	}
}

func setTarget(index, target, value, left, right, lazy int) {
	if left == right {
		segTree[index] = value
		return
	} else {
		if segTree[index] > lazy {
			lazy = segTree[index]
		}
		segTree[index] = 0
		mid := (left + right) / 2
		if target <= mid {
			setLazy(index * 2 + 2, lazy)
			setTarget(index * 2 + 1, target, value, left, mid, lazy)
			return
		} else {
			setLazy(index * 2 + 1, lazy)
			setTarget(index * 2 + 2, target, value, mid + 1, right, lazy)
			return
		}
	}
}

func setLazy(index, lazy int) {
	if index < len(segTree) && lazy > segTree[index] {
		segTree[index] = lazy
	}
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	for i := 0;i < n;i ++ {
		var money int
		if i == n - 1 {
			fmt.Fscanf(reader, "%d\n", &money)
		} else {
			fmt.Fscanf(reader, "%d ", &money)
		}
		setTarget(0, i, money, 0, n - 1, 0)
	}
	var q int
	fmt.Fscanf(reader, "%d\n", &q)
	for i := 0;i < q;i ++ {
		var req, p, x int
		fmt.Fscanf(reader, "%d ", &req)
		if req == 1 {
			fmt.Fscanf(reader, "%d %d\n", &p, &x)
			setTarget(0, p - 1, x, 0, n - 1, 0)
		} else {
			fmt.Fscanf(reader, "%d\n", &x)
			setLazy(0, x)
		}
	}
	for i := 0;i < n;i ++ {
		fmt.Printf("%d ", getTarget(0, i, 0, n - 1, 0))
	}
}


package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
)

var segTree = make([]int, 500000)

func getTarget(index, target, left, right, maxLazy int) int {
	var value int
	if segTree[index] > maxLazy {
		value = segTree[index]
	} else {
		value = maxLazy
	}
	if left == right {
		return value
	} else {
		mid := (left + right) / 2
		if target <= mid {
			return getTarget(index * 2 + 1, target, left, mid, value)
		} else {
			return getTarget(index * 2 + 2, target, mid + 1, right, value)
		}
	}
}

func setTarget(index, target, value, left, right, lazy int) {
	if left == right {
		segTree[index] = value
		return
	} else {
		if segTree[index] > lazy {
			lazy = segTree[index]
		}
		segTree[index] = 0
		mid := (left + right) / 2
		if target <= mid {
			setLazy(index * 2 + 2, lazy)
			setTarget(index * 2 + 1, target, value, left, mid, lazy)
			return
		} else {
			setLazy(index * 2 + 1, lazy)
			setTarget(index * 2 + 2, target, value, mid + 1, right, lazy)
			return
		}
	}
}

func setLazy(index, lazy int) {
	if lazy > segTree[index] {
		segTree[index] = lazy
	}
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)

	var n int
	fmt.Fscanf(reader, "%d\r\n", &n)
	for i := 0;i < n;i ++ {
		var money int
		if i == n {
			fmt.Fscanf(reader, "%d\r\n", &money)
		} else {
			fmt.Fscanf(reader, "%d ", &money)
		}
		setTarget(0, i, money, 0, n - 1, 0)
	}
	var q int
	fmt.Fscanf(reader, "%d\r\n", &q)
	for i := 0;i < q;i ++ {
		var req, p, x int
		fmt.Fscanf(reader, "%d ", &req)
		if req == 1 {
			fmt.Fscanf(reader, "%d %d\r\n", &p, &x)
			setTarget(0, p - 1, x, 0, n - 1, 0)
		} else {
			fmt.Fscanf(reader, "%d\r\n", &x)
			setLazy(0, x)
		}
	}
	for i := 0;i < n;i ++ {
		fmt.Printf("%d ", getTarget(0, i, 0, n - 1, 0))
	}
}


package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
)

var segTree = make([]int, 500000)

func getTarget(index, target, left, right, maxLazy int) int {
	var value int
	if segTree[index] > maxLazy {
		value = segTree[index]
	} else {
		value = maxLazy
	}
	if left == right {
		return value
	} else {
		mid := (left + right) / 2
		if target <= mid {
			return getTarget(index * 2 + 1, target, left, mid, value)
		} else {
			return getTarget(index * 2 + 2, target, mid + 1, right, value)
		}
	}
}

func setTarget(index, target, value, left, right, lazy int) {
	if left == right {
		segTree[index] = value
		return
	} else {
		if segTree[index] > lazy {
			lazy = segTree[index]
		}
		segTree[index] = 0
		mid := (left + right) / 2
		if target <= mid {
			setLazy(index * 2 + 2, lazy)
			setTarget(index * 2 + 1, target, value, left, mid, lazy)
			return
		} else {
			setLazy(index * 2 + 1, lazy)
			setTarget(index * 2 + 2, target, value, mid + 1, right, lazy)
			return
		}
	}
}

func setLazy(index, lazy int) {
	if lazy > segTree[index] {
		segTree[index] = lazy
	}
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	for i := 0;i < n;i ++ {
		var money int
		if i == n - 1 {
			fmt.Fscanf(reader, "%d\n", &money)
		} else {
			fmt.Fscanf(reader, "%d ", &money)
		}
		setTarget(0, i, money, 0, n - 1, 0)
	}
	var q int
	fmt.Fscanf(reader, "%d\n", &q)
	for i := 0;i < q;i ++ {
		var req, p, x int
		fmt.Fscanf(reader, "%d ", &req)
		if req == 1 {
			fmt.Fscanf(reader, "%d %d\n", &p, &x)
			setTarget(0, p - 1, x, 0, n - 1, 0)
		} else {
			fmt.Fscanf(reader, "%d\n", &x)
			setLazy(0, x)
		}
	}
	for i := 0;i < n;i ++ {
		fmt.Printf("%d ", getTarget(0, i, 0, n - 1, 0))
	}
}


package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
)

var segTree = make([]int, 500000)

func getTarget(index, target, left, right, maxLazy int) int {
	var value int
	if segTree[index] > maxLazy {
		value = segTree[index]
	} else {
		value = maxLazy
	}
	if left == right {
		return value
	} else {
		mid := (left + right) / 2
		if target <= mid {
			return getTarget(index * 2 + 1, target, left, mid, value)
		} else {
			return getTarget(index * 2 + 2, target, mid + 1, right, value)
		}
	}
}

func setTarget(index, target, value, left, right, lazy int) {
	if left == right {
		segTree[index] = value
		return
	} else {
		if segTree[index] > lazy {
			lazy = segTree[index]
		}
		segTree[index] = 0
		mid := (left + right) / 2
		if target <= mid {
			setLazy(index * 2 + 2, lazy)
			setTarget(index * 2 + 1, target, value, left, mid, lazy)
			return
		} else {
			setLazy(index * 2 + 1, lazy)
			setTarget(index * 2 + 2, target, value, mid + 1, right, lazy)
			return
		}
	}
}

func setLazy(index, lazy int) {
	if index < len(segTree) && lazy > segTree[index] {
		segTree[index] = lazy
	}
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	for i := 0;i < n;i ++ {
		var money int
		if i == n - 1 {
			fmt.Fscanf(reader, "%d\n", &money)
		} else {
			fmt.Fscanf(reader, "%d ", &money)
		}
		setTarget(0, i, money, 0, n - 1, 0)
	}
	var q int
	fmt.Fscanf(reader, "%d\n", &q)
	for i := 0;i < q;i ++ {
		var req, p, x int
		fmt.Fscanf(reader, "%d ", &req)
		if req == 1 {
			fmt.Fscanf(reader, "%d %d\n", &p, &x)
			setTarget(0, p - 1, x, 0, n - 1, 0)
		} else {
			fmt.Fscanf(reader, "%d\n", &x)
			setLazy(0, x)
		}
	}
	for i := 0;i < n;i ++ {
		fmt.Printf("%d ", getTarget(0, i, 0, n - 1, 0))
	}
}


package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
)

var segTree = make([]int, 500000)

func getTarget(index, target, left, right, maxLazy int) int {
	var value int
	if segTree[index] > maxLazy {
		value = segTree[index]
	} else {
		value = maxLazy
	}
	if left == right {
		return value
	} else {
		mid := (left + right) / 2
		if target <= mid {
			return getTarget(index * 2 + 1, target, left, mid, value)
		} else {
			return getTarget(index * 2 + 2, target, mid + 1, right, value)
		}
	}
}

func setTarget(index, target, value, left, right, lazy int) {
	if left == right {
		segTree[index] = value
		return
	} else {
		if segTree[index] > lazy {
			lazy = segTree[index]
		}
		segTree[index] = 0
		mid := (left + right) / 2
		if target <= mid {
			setLazy(index * 2 + 2, lazy)
			setTarget(index * 2 + 1, target, value, left, mid, lazy)
			return
		} else {
			setLazy(index * 2 + 1, lazy)
			setTarget(index * 2 + 2, target, value, mid + 1, right, lazy)
			return
		}
	}
}

func setLazy(index, lazy int) {
	if lazy > segTree[index] {
		segTree[index] = lazy
	}
}

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	for i := 0;i < n;i ++ {
		var money int
		if i == n {
			fmt.Fscanf(reader, "%d\n", &money)
		} else {
			fmt.Fscanf(reader, "%d ", &money)
		}
		setTarget(0, i, money, 0, n - 1, 0)
	}
	var q int
	fmt.Fscanf(reader, "%d\n", &q)
	for i := 0;i < q;i ++ {
		var req, p, x int
		fmt.Fscanf(reader, "%d ", &req)
		if req == 1 {
			fmt.Fscanf(reader, "%d %d\n", &p, &x)
			setTarget(0, p - 1, x, 0, n - 1, 0)
		} else {
			fmt.Fscanf(reader, "%d\n", &x)
			setLazy(0, x)
		}
	}
	for i := 0;i < n;i ++ {
		fmt.Printf("%d ", getTarget(0, i, 0, n - 1, 0))
	}
}


// Author: sighduck
// URL: https://codeforces.com/problemset/problem/1198/B

package main

import (
	"bufio"
	"fmt"
	"os"
)

type ReceiptEvent struct {
	Person  int
	Balance int
}

type PayoutEvent struct {
	Min int
}

func Solve(n int, a []int, q int, queries []interface{}) []int {
	receipts := make([]int, n+1)
	payouts := make([]int, q+2)
	for i, query := range queries {
		switch query.(type) {
		case ReceiptEvent:
			r := query.(ReceiptEvent)
			receipts[r.Person] = i
			a[r.Person] = r.Balance
		case PayoutEvent:
			p := query.(PayoutEvent)
			payouts[i+1] = p.Min
		}
	}
	for i := q - 1; i >= 0; i-- {
		if payouts[i] < payouts[i+1] {
			payouts[i] = payouts[i+1]
		}
	}
	for i := 1; i <= n; i++ {
		if a[i] < payouts[receipts[i]+1] {
			a[i] = payouts[receipts[i]+1]
		}
	}
	return a[1:]
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	a := make([]int, n+1)
	for i := 1; i <= n; i++ {
		fmt.Fscanf(reader, "%d", &a[i])
	}
	fmt.Fscanf(reader, "\n")
	var q int
	fmt.Fscanf(reader, "%d\n", &q)
	queries := make([]interface{}, q)
	for i := 0; i < q; i++ {
		var queryType int
		fmt.Fscanf(reader, "%d", &queryType)
		if queryType == 1 {
			r := ReceiptEvent{}
			fmt.Fscanf(reader, "%d %d", &r.Person, &r.Balance)
			queries[i] = r
		} else {
			p := PayoutEvent{}
			fmt.Fscanf(reader, "%d", &p.Min)
			queries[i] = p
		}
		fmt.Fscanf(reader, "\n")
	}

	answer := Solve(n, a, q, queries)
	for _, elem := range answer {
		fmt.Fprintf(writer, "%d ", elem)
	}
	fmt.Fprintf(writer, "\n")
}


n = int(raw_input())
a = [int(x) for x in raw_input().split()]
q = int(raw_input())
while q:
    q -= 1
    print ' '.join([str(x) for x in a])
    b = [int(x) for x in raw_input().split()]
    if b[0] == 1:
        a[b[1]-1] = b[2]
    else:
        for i in xrange(n):
            a[i] = max(a[i], b[1])
print ' '.join([str(x) for x in a])


n = int(raw_input())
a = [int(x) for x in raw_input().split()]
q = int(raw_input())
while q:
    q -= 1
    b = [int(x) for x in raw_input().split()]
    if b[0] == 1:
        a[b[1]-1] = b[2]
    else:
        for i in xrange(n):
            a[i] = max(a[i], b[1])
print ' '.join([str(x) for x in a])


n = int(raw_input())
a = map(int, raw_input().split())
b1 = [-1 for x in xrange(n)]
b2 = 0
q = int(raw_input())
while q:
    q -= 1
    c = map(int, raw_input().split())
    if c[0] == 1:
        b1[c[1]-1] = c[2]
    else:
        b2 = max(b2, c[1])
for i in xrange(n):
    a[i] = max(b1[i], b2) if b1[i] != -1 else max(a[i], b2)
print ' '.join([str(x) for x in a])


n = int(raw_input())
a = map(int, raw_input().split())
q = int(raw_input())
Q = []
b = [-1 for i in xrange(n)]
c = -1

while q:
    q -= 1
    Q.append(map(int, raw_input().split()))

for q in Q[::-1]:
    if q[0] == 1:
        if b[q[1]-1] == -1:
            b[q[1]-1] = max(q[2],c)
    else:
        c = max(c, q[1])

for i in xrange(n):
    if b[i] == -1:
        b[i] = max(c, a[i])

print ' '.join(map(str, b))


from __future__ import division, print_function

DEBUG = 1

def main():
    n = int(input())
    a = input_as_list()

    st = [0]*n + a
    h = n.bit_length()

    def modify(idx, v):
        idx += n

        for d in range(h, 0, -1):
            i = idx >> d
            if st[i] != 0:
                assign(i<<1, st[i])
                assign(i<<1|1, st[i])
                st[i] = 0

        st[idx] = v

    def assign(idx, v):
        st[idx] = max(st[idx], v)

    for _ in range(int(input())):
        q = input_as_list()

        if q[0] == 1:
            modify(q[1]-1, q[2])
        else:
            assign(1, q[1])

    for i in range(1, n):
        assign(i<<1, st[i])
        assign(i<<1|1, st[i])
        st[i] = 0

    print(*st[n:], sep=" ")

import os, sys
from atexit import register
from io import BytesIO
import itertools

INF = float('inf')

if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

if DEBUG:
    debug_print = print
else:
    sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
    sys.stdout = BytesIO()
    register(lambda: os.write(1, sys.stdout.getvalue()))

    input = lambda: sys.stdin.readline().rstrip('\r\n')
    debug_print = lambda *x, **y: None

def input_as_list():
    return list(map(int, input().split()))

def array_of(f, *dim):
    return [array_of(f, *dim[1:]) for _ in range(dim[0])] if dim else f()

main()


from __future__ import division, print_function

DEBUG = 0

def main():
    n = int(input())
    a = input_as_list()

    st = [0]*n + a
    h = n.bit_length()

    def modify(idx, v):
        idx += n

        for d in range(h, 0, -1):
            i = idx >> d
            if st[i] != 0:
                st[i<<1] = max(st[i<<1], st[i])
                st[i<<1|1] = max(st[i<<1|1], st[i])
                st[i] = 0

        st[idx] = v

    for _ in range(int(input())):
        q = input_as_list()

        if q[0] == 1:
            modify(q[1]-1, q[2])
        else:
            st[1] = max(st[1], q[1])

    for i in range(1, n):
        st[i<<1] = max(st[i<<1], st[i])
        st[i<<1|1] = max(st[i<<1|1], st[i])
        st[i] = 0

    print(*st[n:], sep=" ")

import os, sys
from atexit import register
from io import BytesIO
import itertools

INF = float('inf')

if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

if DEBUG:
    debug_print = print
else:
    sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
    sys.stdout = BytesIO()
    register(lambda: os.write(1, sys.stdout.getvalue()))

    input = lambda: sys.stdin.readline().rstrip('\r\n')
    debug_print = lambda *x, **y: None

def input_as_list():
    return list(map(int, input().split()))

def array_of(f, *dim):
    return [array_of(f, *dim[1:]) for _ in range(dim[0])] if dim else f()

main()


from __future__ import division, print_function

DEBUG = 1

def main():
    n = int(input())
    a = input_as_list()

    st = [0]*n + a
    h = n.bit_length()

    def modify(idx, v):
        idx += n

        for d in range(h, 0, -1):
            i = idx >> d
            if st[i] != 0:
                st[i<<1] = max(st[i<<1], st[i])
                st[i<<1|1] = max(st[i<<1|1], st[i])
                st[i] = 0

        st[idx] = v

    for _ in range(int(input())):
        q = input_as_list()

        if q[0] == 1:
            modify(q[1]-1, q[2])
        else:
            st[1] = max(st[1], q[1])

    for i in range(1, n):
        st[i<<1] = max(st[i<<1], st[i])
        st[i<<1|1] = max(st[i<<1|1], st[i])
        st[i] = 0

    print(*st[n:], sep=" ")

import os, sys
from atexit import register
from io import BytesIO
import itertools

INF = float('inf')

if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

if DEBUG:
    debug_print = print
else:
    sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
    sys.stdout = BytesIO()
    register(lambda: os.write(1, sys.stdout.getvalue()))

    input = lambda: sys.stdin.readline().rstrip('\r\n')
    debug_print = lambda *x, **y: None

def input_as_list():
    return list(map(int, input().split()))

def array_of(f, *dim):
    return [array_of(f, *dim[1:]) for _ in range(dim[0])] if dim else f()

main()


n=input()
arr=map(int, raw_input().split())
q=input()
po=[]
l=[]
m=0
a=0
for i in xrange(q):
    t=map(int, raw_input().split())
    if t[0]==2:
        if t[1]>m:
            m=t[1]
            a=i
    else:
        l.append([t[1:], i])
for i in xrange(n):
    if arr[i]<m:
        arr[i]=m
# print 'a', a
for i in xrange(len(l)):
    # print "sdfsdf", l[i], l[i][1], a
    if l[i][1]>a or l[i][0][1]>m:
        arr[l[i][0][0]-1]=l[i][0][1]
    # elif l[i][0][1]>m:
    #     arr[l[i][0][0]-1]=l[i][0][1]
    else:
        arr[l[i][0][0]-1]=m
print ' '.join(map(str, arr))


n=input()
arr=map(int, raw_input().split())
q=input()
mw=[0]*q
queries=[]
d={}
maxw=0
for i in xrange(q):
	queries.append(map(int, raw_input().split()))

for i in xrange(q-1, -1, -1):
	if queries[i][0]==2:
		if queries[i][1] > maxw:
			maxw=queries[i][1]
			mw[i]=maxw
	else:
		mw[i]=maxw
		d[queries[i][1]-1]=[queries[i][2], i]

for i in xrange(n):
	if d.get(i, 0)!=0:
		arr[i]=max(d.get(i)[0], mw[d.get(i)[1]])
	else:
		arr[i]=max(arr[i], maxw)

print ' '.join(map(str, arr))


n=input()
arr=map(int, raw_input().split())
q=input()
po=[]
l=[]
m=0
a=0
for i in xrange(q):
    t=map(int, raw_input().split())
    if t[0]==2:
        if t[1]>m:
            m=t[1]
            a=i
    else:
        l.append([t[1]-1, t[2], i])

for i in xrange(n):
    if arr[i]<m:
        arr[i]=m

for i in xrange(len(l)):
    # print "sdfsdf", l[i], l[i][1], a
    if l[i][2]>a or l[i][1]>m:
        arr[l[i][0]]=l[i][1]
    else:
        arr[l[i][0]]=m
print ' '.join(map(str, arr))


n=input()
arr=map(int, raw_input().split())
q=input()
mw=[0]*q
queries=[]
d={}
maxw=0
for i in xrange(q):
	t=map(int, raw_input().split())
	queries.append(t)
	if t[0]==1:
		d[t[1]-1]=[t[2], i]

for i in xrange(q-1, -1, -1):
	if queries[i][0]==2:
		if queries[i][1] > maxw:
			maxw=queries[i][1]
			mw[i]=maxw
	else:
		mw[i]=maxw
# print queries
# print mw
# print d
for i in xrange(n):
	if d.get(i, 0)!=0:
		arr[i]=max(d.get(i)[0], mw[d.get(i)[1]])
	else:
		arr[i]=max(arr[i], maxw)

print ' '.join(map(str, arr))


####
rr = raw_input
rri = lambda: int(raw_input())
rrm = lambda: map(int, raw_input().split())

N = rri()
A = rrm()
Q = rri()
queries = [rrm() for _ in xrange(Q)]

ans = [None] * N
floor = 0
for query in reversed(queries):
    if query[0] == 1:
        # set key=query[1] to val=query[2]
        key = query[1]
        val = query[2]
        if ans[key-1] is None:
            ans[key-1] = max(floor, val)
    else:
        # everyone up to floor=query[1]
        floor = max(floor, query[1])

for i, x in enumerate(ans):
    if x is None:
        ans[i] = max(floor, A[i])

print " ".join(map(str, ans))


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import random
import collections
import math
import itertools
import bisect

class LazySegmentTree:
    def __init__(self, data, default=0, func=max):
        """initialize the lazy segment tree with data"""
        self._default = default
        self._func = func

        self._len = len(data)
        self._size = _size = 1 << (self._len - 1).bit_length()
        self._lazy = [0] * (2 * _size)

        self.data = [default] * (2 * _size)
        self.data[_size:_size + self._len] = data
        # for i in reversed(range(_size)):
        #     self.data[i] = func(self.data[i + i], self.data[i + i + 1])

    def __len__(self):
        return self._len

    def _push(self, idx):
        """push query on idx to its children"""
        # Let the children know of the queries
        q, self._lazy[idx] = self._lazy[idx], 0
        if q:
            self._lazy[2 * idx] = max(self._lazy[2 * idx], q)
            self._lazy[2 * idx + 1] = max(self._lazy[2 * idx + 1], q)
            self.data[2 * idx] = max(self.data[2 * idx], q)
            self.data[2 * idx + 1] = max(self.data[2 * idx + 1], q)

    def _update(self, idx):
        """updates the node idx to know of all queries applied to it via its ancestors"""
        for i in reversed(range(1, idx.bit_length())):
            self._push(idx >> i)

    def _build(self, idx):
        """make the changes to idx be known to its ancestors"""
        idx >>= 1
        while idx:
            self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1]) + self._lazy[idx]
            idx >>= 1

    def set_force(self, idx, value):
        tidx = idx + self._size
        self._update(tidx)
        self.data[tidx] = value

    def set_gov(self, start, stop, value):
        """lazily add value to [start, stop)"""
        start = start + self._size
        stop = stop + self._size
        while start < stop:
            if start & 1:
                self._lazy[start] = max(value, self._lazy[start])
                self.data[start] = max(value, self.data[start])
                start += 1
            if stop & 1:
                stop -= 1
                self._lazy[stop] = max(value, self._lazy[stop])
                self.data[stop] = max(value, self.data[stop])
            start >>= 1
            stop >>= 1

    def query(self, idx):
        tidx = idx + self._size
        self._update(tidx)
        return self.data[tidx]

    def __repr__(self):
        return 'LazySegmentTree({0})'.format(self.data)

def real_main():
    n = read_int()
    b = read_int_array()
    seg_tree = LazySegmentTree(b)
    # print(seg_tree)
    q = read_int()
    for _ in range(q):
        ops = read_int_array()
        if ops[0] == 1:
            seg_tree.set_force(ops[1] - 1, ops[2])
        else:
            seg_tree.set_gov(0, n, ops[1])
        # print(seg_tree)
    ans = []
    for i in range(n):
        ans.append(seg_tree.query(i))
    print(' '.join(str(x) for x in ans))

def solve():
    pass

def main():
    if False and 'PYCHARM_HOSTED' in os.environ:
        main_pycharm()
    else:
        real_main()

from copy import deepcopy
def main_pycharm():
    solution = solve

    test_inputs = None
    test_outputs = None
    judge = None
    slow_solution = None
    if solution is not None:
        if test_outputs is not None:
            test_with_answers(solution, test_inputs, test_outputs)
        if judge is not None:
            test_with_judge(solution, test_inputs, judge)
        if slow_solution is not None:
            test_with_slow_solution(solution, test_inputs, slow_solution)

def test_with_answers(solution, inputs, answers):
    total, wrong = 0, 0
    for args, test_ans in zip(inputs, answers):
        ans = solution(*deepcopy(args))
        if ans != test_ans:
            print('WRONG! ans=%s, test_ans=%s, args=%s' % (ans, test_ans, args))
            wrong += 1
        else:
            print('GOOD')
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))

def test_with_judge(solution, inputs_gen, judge):
    total, wrong = 0, 0
    for args in inputs_gen:
        ans = solution(*deepcopy(args))
        if not judge(deepcopy(ans), *deepcopy(args)):
            print('WRONG! ans=%s, args=%s' % (ans, args))
            wrong += 1
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))

def test_with_slow_solution(solution, inputs_gen, solution_slow):
    total, wrong = 0, 0
    for args in inputs_gen:
        ans = solution(*deepcopy(args))
        slow = solution_slow(*deepcopy(args))
        if ans != slow:
            print('WRONG! ans=%s, slow=%s, args=%s' % (ans, slow, args))
            wrong += 1
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))

def generate_nums(n, min, max, check_if_good=None):
    while True:
        nums = [random.randint(min, max) for _ in range(n)]
        if check_if_good is None or check_if_good(nums):
            return nums

# This mergesort can be like 7 times faster than build in sort
# (for stupid reasons)
def mergesort(A, key=lambda x: x, reverse=False):
    C = A
    A = list(range(len(A)))
    B = list(A)

    n = len(A)
    for i in range(0, n - 1, 2):
        if key(C[A[i]]) > key(C[A[i ^ 1]]):
            A[i], A[i ^ 1] = A[i ^ 1], A[i]

    width = 2
    while width < n:
        for i in range(0, n, 2 * width):
            R1, R2 = min(i + width, n), min(i + 2 * width, n)
            j, k = R1, i
            while i < R1 and j < R2:
                if key(C[A[i]]) > key(C[A[j]]):
                    B[k] = A[j]
                    j += 1
                else:
                    B[k] = A[i]
                    i += 1
                k += 1
            while i < R1:
                B[k] = A[i]
                k += 1
                i += 1
            while k < R2:
                B[k] = A[k]
                k += 1
        A, B = B, A
        width *= 2

    if reverse:
        A.reverse()
    return A

def mergesort_simple(A, reverse=False):
    C = A
    A = list(range(len(A)))
    B = list(A)

    n = len(A)
    for i in range(0, n - 1, 2):
        if C[A[i]] > C[A[i ^ 1]]:
            A[i], A[i ^ 1] = A[i ^ 1], A[i]

    width = 2
    while width < n:
        for i in range(0, n, 2 * width):
            R1, R2 = min(i + width, n), min(i + 2 * width, n)
            j, k = R1, i
            while i < R1 and j < R2:
                if C[A[i]] > C[A[j]]:
                    B[k] = A[j]
                    j += 1
                else:
                    B[k] = A[i]
                    i += 1
                k += 1
            while i < R1:
                B[k] = A[i]
                k += 1
                i += 1
            while k < R2:
                B[k] = A[k]
                k += 1
        A, B = B, A
        width *= 2

    if reverse:
        A.reverse()
    return A

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

def read():
    return input()

def read_int():
    return int(input())

def read_array(sep=None, maxsplit=-1):
    return input().split(sep, maxsplit)

def read_int_array():
    return [int(a) for a in read_array()]

# endregion

if __name__ == "__main__":
    main()