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

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

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

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

c = A("c")
h = B("h")
e = C("e")
i = D("i")
f = B("f")

c.z = i
c.s = i
h.x = i
h.y = i
h.z = f
e.q = f
e.o = f
e.v = h
e.x = h
i.z = h
f.x = i
f.y = i
f.z = h
assert h.y.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: D = None
        self.txt = txt

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

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

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

c = A("c")
h = B("h")
e = C("e")
i = D("i")
f = B("f")

c.z = i
c.s = i
h.x = i
h.y = i
h.z = f
e.q = f
e.o = f
e.v = h
e.x = h
i.z = h
f.x = i
f.y = i
f.z = h
assert h.y.z.z.txt == "f"