# Path: djb2.py
# def djb2(s):
#     h = 5381
#     for c in s:
#         h = (33 * ord(c) + h) % 65536
#     return h


from djb2 import djb2
    from stringtabletest import stringtabletest
# Copyright © 2014 Bart Massey
# StringTable class as a hash table.


class StringTable(object):
    def __init__(self):
        self.table = []
        for _ in range(65536):
            self.table += [[]]

    # Return the value at position k.
    def lookup(self, k):
        for kv in self.table[djb2(k)]:
            (ck, cv) = kv
            if ck == k:
                return cv
        return None

    # Insert the value v at position k,
    # overwriting any existing value at k.
    def insert(self, k, v):

# Path: djb2.py
# def djb2(s):
#     h = 5381
#     for c in s:
#         h = (33 * ord(c) + h) % 65536
#     return h


# Path: stringtable.py
from djb2 import djb2
    from stringtabletest import stringtabletest

# Copyright © 2014 Bart Massey
# StringTable class as a hash table.


class StringTable(object):
    def __init__(self):
        self.table = []
        for _ in range(65536):
            self.table += [[]]

    # Return the value at position k.
    def lookup(self, k):
        for kv in self.table[djb2(k)]:
            (ck, cv) = kv
            if ck == k:
                return cv
        return None

    # Insert the value v at position k,
    # overwriting any existing value at k.
    def insert(self, k, v):

        h = djb2(k)