class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

e = A("e")
d = B("d")
j = C("j")
l = D("l")
n = E("n")
h = C("h")
a = A("a")

e.q = j
d.z = l
d.w = l
d.q = h
j.v = l
j.x = h
l.z = e
l.y = n
n.u = l
n.s = d
n.t = j
h.v = l
h.x = j
a.q = j
assert h.x.v.y.s.w.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

e = A("e")
d = B("d")
j = C("j")
l = D("l")
n = E("n")
h = C("h")
a = A("a")

e.q = j
d.z = l
d.w = l
d.q = h
j.v = l
j.x = h
l.z = e
l.y = n
n.u = l
n.s = d
n.t = j
h.v = l
h.x = j
a.q = j
assert h.x.v.y.s.w.z.q.txt == "j"