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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.x: E = None
        self.w: B = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: D = None
        self.r: D = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

a.y = j
a.s = c
h.o = b
c.z = m
c.u = b
c.x = i
c.w = h
c.r = j
j.s = h
j.q = h
j.p = m
j.z = c
b.o = h
b.v = j
b.r = j
b.u = i
b.w = i
i.o = h
i.v = j
i.r = j
i.u = b
i.w = b
m.o = b
assert h.o.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.x: E = None
        self.w: B = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: D = None
        self.r: D = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

a.y = j
a.s = c
h.o = b
c.z = m
c.u = b
c.x = i
c.w = h
c.r = j
j.s = h
j.q = h
j.p = m
j.z = c
b.o = h
b.v = j
b.r = j
b.u = i
b.w = i
i.o = h
i.v = j
i.r = j
i.u = b
i.w = b
m.o = b
assert h.o.w.u.txt == "b"