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

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

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

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

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

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

d.v = i
d.s = i
d.t = m
d.r = e
d.z = b
e.u = b
m.z = b
m.u = i
m.x = i
m.r = i
m.o = e
i.w = e
i.y = b
i.u = b
i.z = m
b.o = d
assert b.o.z.o.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: C = None
        self.s: D = None
        self.r: B = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

d.v = i
d.s = i
d.t = m
d.r = e
d.z = b
e.u = b
m.z = b
m.u = i
m.x = i
m.r = i
m.o = e
i.w = e
i.y = b
i.u = b
i.z = m
b.o = d
assert b.o.z.o.t.r.txt == "i"