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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: A = None
        self.s: C = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: H = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: A = None
        self.s: C = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: H = None
        self.r: E = None
        self.txt = txt

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

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

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

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