class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: C = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.z: A = None
        self.txt = txt

l = A("l")
k = B("k")
i = C("i")
h = D("h")
b = E("b")
m = D("m")
a = E("a")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.z: A = None
        self.txt = txt

l = A("l")
k = B("k")
i = C("i")
h = D("h")
b = E("b")
m = D("m")
a = E("a")

l.w = k
l.s = k
l.z = i
l.o = b
k.z = l
k.r = m
k.p = i
k.y = b
i.w = a
h.q = k
h.t = l
b.x = k
b.t = k
b.z = l
m.q = k
m.t = l
a.x = k
a.t = k
a.z = l
assert a.x.z.o.t.txt == "k"