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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: A = None
        self.y: C = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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

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

l = A("l")
j = B("j")
m = C("m")
k = D("k")
d = E("d")
f = D("f")

l.y = d
l.v = m
j.w = m
j.y = m
j.q = m
j.p = l
j.s = k
m.z = l
k.o = j
k.p = l
k.u = f
k.s = m
d.t = m
f.o = j
f.p = l
f.u = k
f.s = m
assert m.z.y.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: A = None
        self.y: C = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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

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

l = A("l")
j = B("j")
m = C("m")
k = D("k")
d = E("d")
f = D("f")

l.y = d
l.v = m
j.w = m
j.y = m
j.q = m
j.p = l
j.s = k
m.z = l
k.o = j
k.p = l
k.u = f
k.s = m
d.t = m
f.o = j
f.p = l
f.u = k
f.s = m
assert m.z.y.t.z.txt == "l"