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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: G = None
        self.v: D = None
        self.r: H = None
        self.q: F = None
        self.o: D = None
        self.w: D = None
        self.p: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: B = None
        self.q: E = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: G = None
        self.v: D = None
        self.r: H = None
        self.q: F = None
        self.o: D = None
        self.w: D = None
        self.p: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: B = None
        self.q: E = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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