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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: E = None
        self.s: A = None
        self.x: D = None
        self.v: E = None
        self.txt = txt

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

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

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

m = A("m")
n = B("n")
h = C("h")
c = D("c")
i = E("i")
l = B("l")
d = B("d")
j = D("j")

m.x = l
n.z = h
n.r = i
n.v = i
n.s = m
n.x = j
h.s = m
h.v = d
c.z = i
c.r = j
i.r = h
i.z = h
i.s = j
l.z = h
l.r = i
l.v = i
l.s = m
l.x = c
d.z = h
d.r = i
d.v = i
d.s = m
d.x = c
j.z = i
j.r = c
assert h.s.x.s.x.z.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: E = None
        self.s: A = None
        self.x: D = None
        self.v: E = None
        self.txt = txt

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

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

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

m = A("m")
n = B("n")
h = C("h")
c = D("c")
i = E("i")
l = B("l")
d = B("d")
j = D("j")

m.x = l
n.z = h
n.r = i
n.v = i
n.s = m
n.x = j
h.s = m
h.v = d
c.z = i
c.r = j
i.r = h
i.z = h
i.s = j
l.z = h
l.r = i
l.v = i
l.s = m
l.x = c
d.z = h
d.r = i
d.v = i
d.s = m
d.x = c
j.z = i
j.r = c
assert h.s.x.s.x.z.v.z.txt == "h"