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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: A = None
        self.u: A = None
        self.v: A = None
        self.txt = txt

e = A("e")
h = B("h")
l = C("l")
a = D("a")

e.t = l
h.s = l
h.z = l
h.o = e
l.w = a
a.o = h
a.p = e
a.u = e
a.v = e
assert e.t.w.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: A = None
        self.u: A = None
        self.v: A = None
        self.txt = txt

e = A("e")
h = B("h")
l = C("l")
a = D("a")

e.t = l
h.s = l
h.z = l
h.o = e
l.w = a
a.o = h
a.p = e
a.u = e
a.v = e
assert e.t.w.o.s.txt == "l"