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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: H = None
        self.z: A = None
        self.y: C = None
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: G = None
        self.w: D = None
        self.s: E = None
        self.t: H = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: B = None
        self.txt = txt

m = A("m")
l = B("l")
d = C("d")
a = D("a")
k = E("k")
h = F("h")
i = G("i")
g = H("g")
c = E("c")

m.z = a
l.s = m
d.p = h
d.o = m
a.o = g
a.p = g
a.z = m
a.y = d
a.x = k
k.r = d
k.v = c
k.p = i
k.s = i
h.y = d
h.p = i
h.x = i
h.z = i
h.w = a
h.s = c
h.t = g
i.v = d
g.s = h
g.w = l
c.r = d
c.v = k
c.p = i
c.s = i
assert d.p.w.x.s.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: H = None
        self.z: A = None
        self.y: C = None
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: G = None
        self.w: D = None
        self.s: E = None
        self.t: H = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: B = None
        self.txt = txt

m = A("m")
l = B("l")
d = C("d")
a = D("a")
k = E("k")
h = F("h")
i = G("i")
g = H("g")
c = E("c")

m.z = a
l.s = m
d.p = h
d.o = m
a.o = g
a.p = g
a.z = m
a.y = d
a.x = k
k.r = d
k.v = c
k.p = i
k.s = i
h.y = d
h.p = i
h.x = i
h.z = i
h.w = a
h.s = c
h.t = g
i.v = d
g.s = h
g.w = l
c.r = d
c.v = k
c.p = i
c.s = i
assert d.p.w.x.s.v.p.txt == "h"