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

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

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

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

c = A("c")
j = B("j")
e = C("e")
k = D("k")
g = D("g")

c.w = g
c.z = g
c.s = k
j.y = c
e.y = k
e.t = g
k.o = c
k.x = c
k.u = j
g.o = c
g.x = c
g.u = j
assert g.x.w.o.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.z: D = None
        self.txt = txt

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

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

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

c = A("c")
j = B("j")
e = C("e")
k = D("k")
g = D("g")

c.w = g
c.z = g
c.s = k
j.y = c
e.y = k
e.t = g
k.o = c
k.x = c
k.u = j
g.o = c
g.x = c
g.u = j
assert g.x.w.o.s.u.txt == "j"