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

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: D = None
        self.txt = txt

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

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

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