Input Format
The first line contains an integer, , denoting the number of commands.
Each line  of the  subsequent lines contains one of the commands described above.
Constraints
• The elements added to the list must be integers.
Output Format
For each command of type print, print the list on a new line.

### Problem solution in python 2 programming language.

arr = []
for i in range(int(raw_input())):
s = raw_input().split()
for i in range(1,len(s)):
s[i] = int(s[i])

if s == "append":
arr.append(s)
elif s == "extend":
arr.extend(s[1:])
elif s == "insert":
arr.insert(s,s)
elif s == "remove":
arr.remove(s)
elif s == "pop":
arr.pop()
elif s == "index":
print arr.index(s)
elif s == "count":
print arr.count(s)
elif s == "sort":
arr.sort()
elif s == "reverse":
arr.reverse()
elif s == "print":
print arr

### Problem solution in python 3 programming language.

if __name__ == '__main__':
N = int(input())
empty = []
conv = []
for i in range(N):
x = input().split()
empty.append(x)
for i in range(len(empty)):
if empty[i] == 'insert':
x = int(empty[i])
y = int(empty[i])
conv.insert(x,y)
elif empty[i] == 'print':
print(conv)
elif empty[i] == 'remove':
conv.remove(int(empty[i]))
elif empty[i] == 'append':
conv.append(int(empty[i]))
elif empty[i] == 'sort':
conv.sort()
elif empty[i] == 'pop':
conv.pop()
elif empty[i] == 'reverse':
conv.reverse()