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

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

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

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

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

n = A("n")
a = B("a")
c = C("c")
e = D("e")
d = E("d")
g = D("g")
k = C("k")
h = D("h")
m = B("m")
b = D("b")

n.z = m
n.s = h
a.x = m
c.v = g
c.x = a
c.z = m
c.u = n
e.s = a
e.o = k
e.p = g
e.t = c
d.u = k
d.z = m
g.s = a
g.o = k
g.t = k
g.p = h
k.v = b
k.x = a
k.z = m
k.u = n
h.s = m
h.o = k
h.t = k
h.p = e
m.x = a
b.s = m
b.o = c
b.t = c
b.p = h
assert c.z.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

n = A("n")
a = B("a")
c = C("c")
e = D("e")
d = E("d")
g = D("g")
k = C("k")
h = D("h")
m = B("m")
b = D("b")

n.z = m
n.s = h
a.x = m
c.v = g
c.x = a
c.z = m
c.u = n
e.s = a
e.o = k
e.p = g
e.t = c
d.u = k
d.z = m
g.s = a
g.o = k
g.t = k
g.p = h
k.v = b
k.x = a
k.z = m
k.u = n
h.s = m
h.o = k
h.t = k
h.p = e
m.x = a
b.s = m
b.o = c
b.t = c
b.p = h
assert c.z.x.x.x.txt == "a"