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

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

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

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

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

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

d.v = i
i.y = b
i.o = k
i.s = l
m.w = i
m.z = d
m.x = d
m.o = k
m.v = k
b.z = i
k.r = m
k.o = i
k.v = i
l.v = i
assert k.o.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

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

d.v = i
i.y = b
i.o = k
i.s = l
m.w = i
m.z = d
m.x = d
m.o = k
m.v = k
b.z = i
k.r = m
k.o = i
k.v = i
l.v = i
assert k.o.y.z.txt == "i"