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

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

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

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

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

c = A("c")
l = B("l")
a = C("a")
k = D("k")
f = E("f")
n = C("n")

c.z = l
c.o = f
l.y = n
l.v = n
a.p = n
a.q = n
a.t = l
a.w = l
k.u = l
f.o = k
n.p = a
n.q = a
n.t = l
n.w = l
assert n.q.p.w.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

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

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

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

c = A("c")
l = B("l")
a = C("a")
k = D("k")
f = E("f")
n = C("n")

c.z = l
c.o = f
l.y = n
l.v = n
a.p = n
a.q = n
a.t = l
a.w = l
k.u = l
f.o = k
n.p = a
n.q = a
n.t = l
n.w = l
assert n.q.p.w.v.w.txt == "l"