# Hashing big integers into a little list of lists
# This is a way of faking a dictionary

def hashFunc(bigInt,length):
    smallInt = bigInt % length
    return smallInt

# Use this data; in a real program, we'd read a lot
# of data items from a file.
data = [[577837224, "Oswald, Astrid"], \
	[578364010, "Ortiz, Esteban"], \
        [577947023, "Ogilvie, Isabel"]]

# Build a list with a fixed size
l = 20 # the length of the list

L = []
for i in range(l):
    L = L + [""]
print L

# Store the data in into the list
for record in data:
    id = record[0]
    name = record[1]
    # Convert the id to an index
    smallInt = hashFunc(id,l)
    L[smallInt] = name
print L

# Now answer queries
query = int(raw_input("Enter an SID number: "))
# Convert it to an index
smallInt = hashFunc(query,l)
print "The name is",L[smallInt]


