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

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

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

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

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

k.x = a
k.z = e
k.t = e
l.t = k
l.y = a
l.o = a
h.p = k
h.w = a
e.z = k
e.w = k
e.u = h
e.s = h
a.t = k
a.y = l
a.o = l
assert e.w.x.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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