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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: D = None
        self.v: B = None
        self.txt = txt

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

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

c.s = i
c.y = h
c.t = h
c.z = e
e.u = h
h.p = e
h.v = e
h.s = i
i.w = c
i.s = h
assert c.z.u.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: C = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: D = None
        self.v: B = None
        self.txt = txt

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

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

c.s = i
c.y = h
c.t = h
c.z = e
e.u = h
h.p = e
h.v = e
h.s = i
i.w = c
i.s = h
assert c.z.u.s.s.txt == "h"