Buggy python submission (verdict: Time Limit Exceeded):
m = 1000000
NIL = 1e9

def h1(key):
    return key % m

def h2(key):
    return 1 + (key % (m - 1))

def h(key, i):
    return (h1(key) + i * h2(key)) % m

def insert(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == NIL:
            t[j] = key
            return j
        else:
            i += 1

def find(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == key:
            return j
        elif t[j] == NIL or i >= m:
            return NIL
        else:
            i += 1

def convert(word):
    result = ""
    for i in word:
        if i == "A":
            result += "1"
        elif i == "T":
            result += "2"
        elif i == "G":
            result += "3"
        else:
            result += "4"
    return int(result)


t = [NIL]*m
n = int(input())
for i in range(n):
    com = input().split()
    key = convert(com[1])
    if com[0] == "insert":
        insert(t, key)
    else:
        if find(t, key) != NIL:
            print("yes")
        else:
            print("no")


Fixed submission:
n = int(input())
d = set()

for i in range(n):
    com = input().split()
    if com[0] == "insert":
        d.add(com[1])
    else:
        print("yes" if com[1] in d else "no")

Buggy python submission (verdict: Time Limit Exceeded):
m = 1000000
NIL = -1

def h1(key):
    return key % m

def h2(key):
    return 1 + (key % (m - 1))

def h(key, i):
    return (h1(key) + i * h2(key)) % m

def insert(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == NIL:
            t[j] = key
            return j
        else:
            i += 1

def find(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == key:
            return j
        elif t[j] == NIL or i >= m:
            return NIL
        else:
            i += 1

def convert(word):
    result = ""
    for i in word:
        if i == "A":
            result += "1"
        elif i == "T":
            result += "2"
        elif i == "G":
            result += "3"
        else:
            result += "4"
    return int(result)


t = [NIL]*m
n = int(input())
for i in range(n):
    com = input().split()
    key = convert(com[1])
    if com[0] == "insert":
        insert(t, key)
    else:
        if find(t, key) != NIL:
            print("yes")
        else:
            print("no")



Fixed submission:
n = int(input())
d = set()

for i in range(n):
    com = input().split()
    if com[0] == "insert":
        d.add(com[1])
    else:
        print("yes" if com[1] in d else "no")

Buggy python submission (verdict: Time Limit Exceeded):
m = 10000
NIL = -1

def h1(key):
    return key % m

def h2(key):
    return 1 + (key % (m - 1))

def h(key, i):
    return (h1(key) + i * h2(key)) % m

def insert(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == NIL:
            t[j] = key
            return j
        else:
            i += 1

def find(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == key:
            return j
        elif t[j] == NIL or i >= m:
            return NIL
        else:
            i += 1

def convert(word):
    result = ""
    for i in word:
        if i == "A":
            result += "1"
        elif i == "T":
            result += "2"
        elif i == "G":
            result += "3"
        else:
            result += "4"
    return int(result)


t = [NIL]*m
n = int(input())
for i in range(n):
    com = input().split()
    key = convert(com[1])
    if com[0] == "insert":
        insert(t, key)
    else:
        if find(t, key) != NIL:
            print("yes")
        else:
            print("no")



Fixed submission:
n = int(input())
d = set()

for i in range(n):
    com = input().split()
    if com[0] == "insert":
        d.add(com[1])
    else:
        print("yes" if com[1] in d else "no")

Buggy python submission (verdict: Runtime Error):
m = 1e13
NIL = -1

def h1(key):
    return key % m

def h2(key):
    return 1 + (key % (m - 1))

def h(key, i):
    return (h1(key) + i * h2(key)) % m

def insert(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == NIL:
            t[j] = key
            return j
        else:
            i += 1

def find(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == key:
            return j
        elif t[j] == NIL or i >= m:
            return NIL
        else:
            i += 1

def convert(word):
    result = ""
    for i in word:
        if i == "A":
            result += "1"
        elif i == "T":
            result += "2"
        elif i == "G":
            result += "3"
        else:
            result += "4"
    return int(result)


t = [NIL]*m
n = int(input())
for i in range(n):
    com = input().split()
    key = convert(com[1])
    if com[0] == "insert":
        insert(t, key)
    else:
        if find(t, key) != NIL:
            print("yes")
        else:
            print("no")



Fixed submission:
n = int(input())
d = set()

for i in range(n):
    com = input().split()
    if com[0] == "insert":
        d.add(com[1])
    else:
        print("yes" if com[1] in d else "no")

Buggy python submission (verdict: Runtime Error):
m = 1e8
NIL = -1

def h1(key):
    return key % m

def h2(key):
    return 1 + (key % (m - 1))

def h(key, i):
    return (h1(key) + i * h2(key)) % m

def insert(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == NIL:
            t[j] = key
            return j
        else:
            i += 1

def find(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == key:
            return j
        elif t[j] == NIL or i >= m:
            return NIL
        else:
            i += 1

def convert(word):
    result = ""
    for i in word:
        if i == "A":
            result += "1"
        elif i == "T":
            result += "2"
        elif i == "G":
            result += "3"
        else:
            result += "4"
    return int(result)


t = [NIL]*m
n = int(input())
for i in range(n):
    com = input().split()
    key = convert(com[1])
    if com[0] == "insert":
        insert(t, key)
    else:
        if find(t, key) != NIL:
            print("yes")
        else:
            print("no")



Fixed submission:
n = int(input())
d = set()

for i in range(n):
    com = input().split()
    if com[0] == "insert":
        d.add(com[1])
    else:
        print("yes" if com[1] in d else "no")

Buggy python submission (verdict: Time Limit Exceeded):
m = 10000000
NIL = -1

def h1(key):
    return key % m

def h2(key):
    return 1 + (key % (m - 1))

def h(key, i):
    return (h1(key) + i * h2(key)) % m

def insert(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == NIL:
            t[j] = key
            return j
        else:
            i += 1

def find(t, key):
    i = 0
    while True:
        j = h(key, i)
        if t[j] == key:
            return j
        elif t[j] == NIL or i >= m:
            return NIL
        else:
            i += 1

def convert(word):
    result = ""
    for i in word:
        if i == "A":
            result += "1"
        elif i == "T":
            result += "2"
        elif i == "G":
            result += "3"
        else:
            result += "4"
    return int(result)


t = [NIL]*m
n = int(input())
for i in range(n):
    com = input().split()
    key = convert(com[1])
    if com[0] == "insert":
        insert(t, key)
    else:
        if find(t, key) != NIL:
            print("yes")
        else:
            print("no")



Fixed submission:
n = int(input())
d = set()

for i in range(n):
    com = input().split()
    if com[0] == "insert":
        d.add(com[1])
    else:
        print("yes" if com[1] in d else "no")