class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

i = A("i")
e = B("e")
n = B("n")
c = B("c")
h = B("h")
k = A("k")
l = A("l")
j = A("j")

i.t = h
i.u = j
e.w = l
n.w = l
c.w = j
h.w = j
k.t = h
k.u = l
l.t = e
l.u = j
j.t = n
j.u = k
assert c.w.u.u.u.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

i = A("i")
e = B("e")
n = B("n")
c = B("c")
h = B("h")
k = A("k")
l = A("l")
j = A("j")

i.t = h
i.u = j
e.w = l
n.w = l
c.w = j
h.w = j
k.t = h
k.u = l
l.t = e
l.u = j
j.t = n
j.u = k
assert c.w.u.u.u.t.w.txt == "l"