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

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

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

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

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

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

j.s = e
j.z = h
j.q = b
j.w = b
j.v = b
d.p = h
d.r = h
d.o = h
d.u = e
d.w = j
n.t = d
h.t = n
h.z = j
b.u = h
e.p = h
e.r = h
e.o = h
e.u = d
e.w = j
assert h.z.q.u.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: D = None
        self.q: E = None
        self.w: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

j.s = e
j.z = h
j.q = b
j.w = b
j.v = b
d.p = h
d.r = h
d.o = h
d.u = e
d.w = j
n.t = d
h.t = n
h.z = j
b.u = h
e.p = h
e.r = h
e.o = h
e.u = d
e.w = j
assert h.z.q.u.z.z.txt == "h"