class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: B = None
        self.u: B = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

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

m.w = i
m.q = i
m.u = i
m.y = n
i.v = b
i.p = b
i.u = n
n.o = i
b.p = n
b.t = e
b.o = e
e.y = m
e.p = b
e.v = b
assert b.p.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: B = None
        self.u: B = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

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

m.w = i
m.q = i
m.u = i
m.y = n
i.v = b
i.p = b
i.u = n
n.o = i
b.p = n
b.t = e
b.o = e
e.y = m
e.p = b
e.v = b
assert b.p.o.v.txt == "b"