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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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