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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.q: C = None
        self.w: A = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.t: D = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.q: C = None
        self.w: A = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.t: D = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

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

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

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

h.w = c
h.u = j
h.z = b
j.o = m
j.y = c
j.q = e
j.w = h
j.x = h
e.x = b
e.t = b
e.r = b
e.q = j
e.o = h
m.x = c
c.u = m
b.x = c
assert b.x.u.x.u.x.u.txt == "m"