Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("AQBE");p=0;c=input();Q=[]
- while len(c)>p:
- if c[p]=="p":Q.append(c[p+1]);p+=1
- elif c[p]=="q":Q.pop(0)
- elif c[p]=="Q":print(Q.pop(0),end="")
- elif c[p]=="!":
- while c[p]!="!":p+=1
- elif c[p]=="}":
- if not Q:...
- else:
- while c[p]!="{":p-=1
- p+=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement