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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: B = None
        self.t: D = None
        self.v: B = None
        self.r: B = None
        self.txt = txt

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

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

k = A("k")
j = B("j")
m = C("m")
i = D("i")
c = E("c")

k.z = m
k.v = m
k.x = c
k.p = j
j.q = c
j.y = i
j.r = m
m.y = c
m.o = j
m.v = j
m.r = j
m.t = i
i.z = c
i.x = m
c.w = j
c.o = m
assert i.x.y.o.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: E = None
        self.v: C = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: B = None
        self.t: D = None
        self.v: B = None
        self.r: B = None
        self.txt = txt

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

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

k = A("k")
j = B("j")
m = C("m")
i = D("i")
c = E("c")

k.z = m
k.v = m
k.x = c
k.p = j
j.q = c
j.y = i
j.r = m
m.y = c
m.o = j
m.v = j
m.r = j
m.t = i
i.z = c
i.x = m
c.w = j
c.o = m
assert i.x.y.o.t.z.txt == "c"