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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: C = None
        self.r: E = None
        self.w: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: C = None
        self.r: E = None
        self.w: E = None
        self.q: A = None
        self.txt = txt

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

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

l.t = i
l.o = b
i.w = e
i.x = n
i.z = a
b.s = n
b.p = f
a.p = n
a.u = b
a.r = m
a.w = m
a.q = h
m.x = i
m.r = i
m.w = i
d.t = i
d.o = n
f.s = b
f.p = b
e.t = i
e.o = n
n.s = b
n.p = b
h.t = i
h.o = n
assert l.t.x.p.p.p.txt == "b"