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

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

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

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

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

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

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

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

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

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

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

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

e.q = a
e.u = a
e.o = d
e.t = l
l.r = n
d.w = l
d.x = a
h.z = l
h.x = a
n.q = h
n.y = h
m.q = d
m.o = a
m.u = a
m.t = l
a.w = l
a.x = d
assert l.r.q.x.x.x.w.txt == "l"