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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: B = None
        self.txt = txt

e = A("e")
c = B("c")
a = C("a")
h = B("h")
l = C("l")
m = A("m")
k = C("k")

e.w = a
e.z = c
e.y = k
c.x = k
c.t = l
a.t = c
a.r = h
h.x = l
h.t = k
l.t = c
l.r = h
m.w = k
m.z = c
m.y = a
k.t = c
k.r = c
assert h.x.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: B = None
        self.txt = txt

e = A("e")
c = B("c")
a = C("a")
h = B("h")
l = C("l")
m = A("m")
k = C("k")

e.w = a
e.z = c
e.y = k
c.x = k
c.t = l
a.t = c
a.r = h
h.x = l
h.t = k
l.t = c
l.r = h
m.w = k
m.z = c
m.y = a
k.t = c
k.r = c
assert h.x.t.t.txt == "l"