class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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