Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = []

for i in range(N):
	b= input()
	if (" " in b):
		b, c = b.split()
		c = int(c)
	
	if b == "insert":
		A.insert(0, c)
	elif b == "delete":
		if (c in A):
			A.remove(c)
	elif b == "deleteFirst":
		A.pop(0)
	elif b == "deleteLast":
		A.pop()

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

Fixed submission:
from collections import deque

N = int(input())

A = deque()

for i in range(N):
	b= input()
	if b == "deleteFirst":
		A.popleft()
	elif b == "deleteLast":
		A.pop()
	else:
		b, c = b.split()
		c = int(c)
	
		if b == "insert":
			A.appendleft(c)
		elif b == "delete":
			if (c in A):
				A.remove(c)

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

Buggy python submission (verdict: Runtime Error):
N = int(input())

A = []

for i in xrange(N):
	b= input()
	if (" " in b):
		b, c = b.split()
		c = int(c)
	
	if b == "insert":
		A.insert(0, c)
	elif b == "delete":
		if (c in A):
			A.remove(c)
	elif b == "deleteFirst":
		A.pop(0)
	elif b == "deleteLast":
		A.pop()

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

Fixed submission:
from collections import deque

N = int(input())

A = deque()

for i in range(N):
	b= input()
	if b == "deleteFirst":
		A.popleft()
	elif b == "deleteLast":
		A.pop()
	else:
		b, c = b.split()
		c = int(c)
	
		if b == "insert":
			A.appendleft(c)
		elif b == "delete":
			if (c in A):
				A.remove(c)

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = []

for i in range(N):
	b= input()
	if (" " in b):
		b, c = b.split()
		c = int(c)
	
	if b == "insert":
		A.insert(0, c)
	elif b == "delete":
		if (c in A):
			A.remove(c)
	elif b == "deleteFirst":
		A.pop(0)
	elif b == "deleteLast":
		A.pop()

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

Fixed submission:
from collections import deque

N = int(input())

A = deque()

for i in range(N):
	b= input()
	if b == "deleteFirst":
		A.popleft()
	elif b == "deleteLast":
		A.pop()
	else:
		b, c = b.split()
		c = int(c)
	
		if b == "insert":
			A.appendleft(c)
		elif b == "delete":
			if (c in A):
				A.remove(c)

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

Buggy python submission (verdict: Runtime Error):
N = int(input())

A = []
pop = A.pop
remove = A.remove
insert = A.insert
split = b.split

for i in range(N):
	b= input()
	if (" " in b):
		b, c = split()
		c = int(c)
	
	if b == "insert":
		insert(0, c)
	elif b == "delete":
		if (c in A):
			remove(c)
	elif b == "deleteFirst":
		pop(0)
	elif b == "deleteLast":
		pop()

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

Fixed submission:
from collections import deque

N = int(input())

A = deque()

for i in range(N):
	b= input()
	if b == "deleteFirst":
		A.popleft()
	elif b == "deleteLast":
		A.pop()
	else:
		b, c = b.split()
		c = int(c)
	
		if b == "insert":
			A.appendleft(c)
		elif b == "delete":
			if (c in A):
				A.remove(c)

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = []

for i in range(N):
	b= input()
	if b == "deleteFirst":
		A.pop(0)
	elif b == "deleteLast":
		A.pop()
	else:
		b, c = b.split()
		c = int(c)
	
		if b == "insert":
			A.insert(0, c)
		elif b == "delete":
			if (c in A):
				A.remove(c)

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

Fixed submission:
from collections import deque

N = int(input())

A = deque()

for i in range(N):
	b= input()
	if b == "deleteFirst":
		A.popleft()
	elif b == "deleteLast":
		A.pop()
	else:
		b, c = b.split()
		c = int(c)
	
		if b == "insert":
			A.appendleft(c)
		elif b == "delete":
			if (c in A):
				A.remove(c)

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

Buggy python submission (verdict: Runtime Error):
from collections in deque

N = int(input())

A = deque()

for i in range(N):
	b= input()
	if b == "deleteFirst":
		A.popleft()
	elif b == "deleteLast":
		A.pop()
	else:
		b, c = b.split()
		c = int(c)
	
		if b == "insert":
			A.appendleft(c)
		elif b == "delete":
			if (c in A):
				A.remove(c)

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

Fixed submission:
from collections import deque

N = int(input())

A = deque()

for i in range(N):
	b= input()
	if b == "deleteFirst":
		A.popleft()
	elif b == "deleteLast":
		A.pop()
	else:
		b, c = b.split()
		c = int(c)
	
		if b == "insert":
			A.appendleft(c)
		elif b == "delete":
			if (c in A):
				A.remove(c)

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