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

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

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

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

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

f = A("f")
m = B("m")
n = C("n")
e = D("e")
h = E("h")
d = B("d")

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

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

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

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

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

f = A("f")
m = B("m")
n = C("n")
e = D("e")
h = E("h")
d = B("d")

f.v = m
f.u = e
f.t = e
f.z = h
m.v = f
m.p = h
m.t = h
m.o = n
m.s = d
n.y = e
n.s = e
e.w = m
e.u = d
h.x = m
h.w = m
h.s = d
h.r = f
d.v = f
d.p = h
d.t = h
d.o = n
d.s = m
assert f.z.s.p.w.v.v.txt == "m"