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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

h = A("h")
b = B("b")
i = C("i")
m = D("m")
j = E("j")

h.u = m
h.t = m
h.x = j
h.r = b
b.p = j
i.p = j
i.y = j
i.w = j
i.r = m
m.s = j
m.z = i
m.p = i
m.w = b
j.o = m
assert h.u.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: D = None
        self.x: E = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

h = A("h")
b = B("b")
i = C("i")
m = D("m")
j = E("j")

h.u = m
h.t = m
h.x = j
h.r = b
b.p = j
i.p = j
i.y = j
i.w = j
i.r = m
m.s = j
m.z = i
m.p = i
m.w = b
j.o = m
assert h.u.z.p.txt == "j"