class Solution(object):
def buildArray(self, target, n):
"""
:type target: List[int]
:type n: int
:rtype: List[str]
"""
ans = []
p = 0
for cur_num in range(1, n + 1):
if target[p] == cur_num:
ans.append("Push")
p += 1
if p >= len(target):
break
else:
ans.append("Push")
ans.append("Pop")
return ans