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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: B = None
        self.q: A = None
        self.s: A = None
        self.p: E = None
        self.z: E = None
        self.u: E = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: F = None
        self.z: E = None
        self.o: G = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.s: C = None
        self.z: C = None
        self.txt = txt

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

f = A("f")
l = B("l")
n = C("n")
a = D("a")
i = E("i")
j = F("j")
d = G("d")
c = H("c")
k = A("k")
g = H("g")

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: B = None
        self.q: A = None
        self.s: A = None
        self.p: E = None
        self.z: E = None
        self.u: E = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: F = None
        self.z: E = None
        self.o: G = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.s: C = None
        self.z: C = None
        self.txt = txt

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

f = A("f")
l = B("l")
n = C("n")
a = D("a")
i = E("i")
j = F("j")
d = G("d")
c = H("c")
k = A("k")
g = H("g")

f.p = g
f.z = a
f.s = n
l.t = g
l.z = d
l.x = n
l.r = n
l.p = a
l.y = j
l.u = i
l.w = i
n.v = j
n.t = j
n.x = l
n.q = f
n.s = f
n.p = i
n.z = i
n.u = i
a.t = n
a.p = n
a.u = j
a.z = i
a.o = d
i.y = j
j.y = a
j.u = a
j.q = f
d.q = l
d.o = f
d.s = n
d.z = n
c.p = n
c.v = g
c.w = a
c.q = l
k.p = g
k.z = a
k.s = n
g.p = n
g.v = c
g.w = a
g.q = l
assert k.z.p.s.z.txt == "a"