l=[]
def push(li):
e=int(input("Enter the element to push"))
li.append(e)
def pop(li):
if ((len(li)!=0)):
e=li.pop()
print("Popped item is",e)
else:
print("Underflow")
def peek(li):
if ((len(li)!=0)):
print("Topmost item is",li[-1])
else:
print("Underflow")
def display(li):
if ((len(li)!=0)):
top=len(li)-1
print(li[top],"<-top")
for item in range((top-1),-1,-1):
print(li[item])
else:
print("Stack is Empty")
while True:
op=int(input("Enter the option from 1 to 5: "))
if op==1:
push(l)
elif op==2:
pop(l)
elif op==3:
peek(l)
elif op==4:
display(l)
elif op==5:
break
else:
print("Valid option")