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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

m.w = b
m.s = b
m.v = j
m.y = i
m.t = n
j.o = b
i.s = n
b.o = n
b.u = j
n.t = i
n.r = m
n.o = b
assert b.u.o.u.o.txt == "b"