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

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

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

e = A("e")
l = B("l")
i = C("i")
h = C("h")
b = B("b")
f = A("f")
k = C("k")
c = B("c")

e.w = l
l.z = e
l.w = e
l.r = e
i.x = f
i.u = k
i.t = e
h.x = f
h.t = f
h.u = k
b.z = f
b.w = e
b.r = e
f.w = l
k.x = e
k.t = e
k.u = h
c.z = e
c.w = f
c.r = f
assert h.u.x.w.r.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

e = A("e")
l = B("l")
i = C("i")
h = C("h")
b = B("b")
f = A("f")
k = C("k")
c = B("c")

e.w = l
l.z = e
l.w = e
l.r = e
i.x = f
i.u = k
i.t = e
h.x = f
h.t = f
h.u = k
b.z = f
b.w = e
b.r = e
f.w = l
k.x = e
k.t = e
k.u = h
c.z = e
c.w = f
c.r = f
assert h.u.x.w.r.w.w.w.txt == "l"