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

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

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

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

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

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

i.t = n
n.x = m
n.v = m
n.w = d
j.o = m
j.y = e
j.u = k
e.w = m
e.p = n
e.z = n
e.s = b
m.t = k
d.o = m
d.y = b
d.u = j
k.o = m
k.y = e
k.u = d
b.w = m
b.p = n
b.z = n
b.s = e
assert m.t.y.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

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

i.t = n
n.x = m
n.v = m
n.w = d
j.o = m
j.y = e
j.u = k
e.w = m
e.p = n
e.z = n
e.s = b
m.t = k
d.o = m
d.y = b
d.u = j
k.o = m
k.y = e
k.u = d
b.w = m
b.p = n
b.z = n
b.s = e
assert m.t.y.s.w.txt == "m"