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

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

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

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

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

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

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

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

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

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

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

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

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