if __name__ == '__main__':
    N = int(input())
    L = []
    for _ in range(0, N):
        user_input = input().split(' ')
        command = user_input.pop(0)
        if len(user_input) > 0:
            if 'insert' == command:
                eval("L.{0}({1}, {2})".format(command, user_input[0], user_input[1]))
            else:
                eval("L.{0}({1})".format(command, user_input[0]))
        elif command == 'print':
            print (L)
        else:
            eval("L.{0}()".format(command))

"""
Explanation: Basic Data Types:
Task 1 -- Lists:
Python List Examples – Insert, Append, Length, Index, Remove, Pop
Consider a list (list = []). You can perform the following commands:
1) insert i e: Insert integer  at position .
2) print: Print the list.
3) remove e: Delete the first occurrence of integer .
4) append e: Insert integer  at the end of the list.
5) sort: Sort the list.
6) pop: Pop the last element from the list.
7) reverse: Reverse the list.
Initialize your list and read in the value of  followed by  lines of commands where each command will be of the types listed above. Iterate through each command in order and perform the corresponding operation on your list.
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.
Sample Input
12
insert 0 5
insert 1 10
insert 0 6
print 
remove 6
append 9
append 1
sort 
print
pop
reverse
print
Sample Output
[6, 5, 10]
[1, 5, 9, 10]
[9, 5, 1]
Answer:
End of explanation
"""


if __name__ == '__main__':
    n = int(input())
    integer_list = map(int, input().split())
    t = (tuple(integer_list))
    if len(t) == n:
        print (hash(t))     

"""
Explanation: Task 2 -- Tuples:
Task
Given an integer, , and  space-separated integers as input, create a tuple, , of those  integers. Then compute and print the result of .
Note: hash() is one of the functions in the builtins module, so it need not be imported.
Input Format:
The first line contains an integer, , denoting the number of elements in the tuple. 
The second line contains  space-separated integers describing the elements in tuple .
Output Format:
Print the result of hash(t).
Sample Input:
2
1 2
Sample Output:
3713081631934410656
Answer:
End of explanation
"""


# Without using list comprehnsions:
x = int ( input())
y = int ( input())
n = int ( input())
ar = []
p = 0
for i in range ( x + 1 ) :
    for j in range( y + 1):
        if i+j != n:
            ar.append([])
            ar[p] = [ i , j ]
            p+=1
print (ar)    

# Using list comprehensions:
x, y, n = (int(input()) for _ in range(3))
print ([[i, j] for i in range(x+1) for j in range(y+1) if((i+j)!= n)])

"""
Explanation: Task 3 -- List Comprehensions:
Let's learn about list comprehensions! You are given three integers  X, Y and Z representing the dimensions of a cuboid along with an integer N. You have to print a list of all possible coordinates given by  (i,j,k) on a 3D grid where the sum of  i+j+k is not equal to N. Here: 0<=i<=X; 0<=j<=Y; 0<=k<=Z 
Input Format:
Four integers  X, Y, Z and N  each on four separate lines, respectively.
Constraints:
Print the list in lexicographic increasing order.
Sample Input:
1
1
1
2
Sample Output:
[[0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 0], [1, 1, 1]] 
Explanation:
Concept:
You have already used lists in previous hacks. List comprehensions are an elegant way to build a list without having to use different for loops to append values one by one. This example might help.
Example:
You are given two integers x and y . You need to find out the ordered pairs ( i , j ) , such that ( i + j ) is not equal to n and print them in lexicographic order.( 0 <= i <= x ) and ( 0 <= j <= y).
Below are two code examples for the problem above, first; without using list comprehensions and second; using list comprehensions.
End of explanation
"""


x, y, z, n = (int(input()) for _ in range(4)) 
print ([[i,j,k] for i in range(0,x+1) for j in range(0,y+1) for k in range(0,z+1) if i + j + k != n ])

"""
Explanation: Answer:
End of explanation
"""


