n, q = map(int, input().split()) l = [] for i in range(q): a = input().split() if a[0] == "push": if len(l) < n: l.insert(0, a[1])#append(a[1])# else: print("full") if a[0] == "front": if len(l) == 0: ...