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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: A = None
        self.s: C = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: D = None
        self.t: G = None
        self.o: C = None
        self.y: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: D = None
        self.s: B = None
        self.y: G = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: C = None
        self.u: D = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: F = None
        self.y: C = None
        self.w: E = None
        self.v: B = None
        self.txt = txt

b = A("b")
m = B("m")
h = C("h")
k = D("k")
d = E("d")
a = F("a")
n = G("n")
j = H("j")
g = C("g")

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: A = None
        self.s: C = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: D = None
        self.t: G = None
        self.o: C = None
        self.y: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: D = None
        self.s: B = None
        self.y: G = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: C = None
        self.u: D = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: F = None
        self.y: C = None
        self.w: E = None
        self.v: B = None
        self.txt = txt

b = A("b")
m = B("m")
h = C("h")
k = D("k")
d = E("d")
a = F("a")
n = G("n")
j = H("j")
g = C("g")

b.z = k
b.s = a
b.p = g
m.z = n
m.x = b
h.p = a
h.z = b
h.s = g
h.x = k
k.y = a
d.w = b
d.p = k
d.q = k
d.t = n
d.o = h
d.y = h
a.r = j
a.q = k
a.z = k
a.s = m
a.y = n
n.s = j
n.o = g
n.q = g
n.u = k
j.p = b
j.q = a
j.y = g
j.w = d
j.v = m
g.p = a
g.z = b
g.s = h
g.x = k
assert d.o.p.s.z.q.txt == "g"