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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: C = None
        self.z: E = None
        self.w: G = None
        self.o: F = None
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: C = None
        self.z: E = None
        self.w: G = None
        self.o: F = None
        self.q: B = None
        self.txt = txt

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

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