class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

b = A("b")
l = B("l")
d = C("d")
e = D("e")
h = E("h")
m = A("m")

b.z = m
b.p = m
b.r = e
b.w = e
l.y = h
l.v = e
l.z = e
l.t = d
l.u = b
d.w = l
e.s = h
e.x = m
h.x = d
h.w = l
m.z = b
m.p = b
m.r = e
m.w = e
assert m.p.r.x.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

b = A("b")
l = B("l")
d = C("d")
e = D("e")
h = E("h")
m = A("m")

b.z = m
b.p = m
b.r = e
b.w = e
l.y = h
l.v = e
l.z = e
l.t = d
l.u = b
d.w = l
e.s = h
e.x = m
h.x = d
h.w = l
m.z = b
m.p = b
m.r = e
m.w = e
assert m.p.r.x.w.s.txt == "h"