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

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

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

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

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

k = A("k")
i = B("i")
c = C("c")
j = D("j")
a = E("a")
d = B("d")
l = E("l")
e = B("e")

k.o = c
i.o = k
i.z = j
c.w = j
c.z = j
j.v = c
j.t = c
a.r = j
d.o = k
d.z = j
l.r = j
e.o = k
e.z = j
assert l.r.t.w.t.z.v.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

k = A("k")
i = B("i")
c = C("c")
j = D("j")
a = E("a")
d = B("d")
l = E("l")
e = B("e")

k.o = c
i.o = k
i.z = j
c.w = j
c.z = j
j.v = c
j.t = c
a.r = j
d.o = k
d.z = j
l.r = j
e.o = k
e.z = j
assert l.r.t.w.t.z.v.w.t.txt == "c"