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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: E = None
        self.t: E = None
        self.s: E = None
        self.z: H = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: B = None
        self.v: A = None
        self.t: D = None
        self.x: A = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: B = None
        self.r: H = None
        self.w: E = None
        self.s: D = None
        self.u: D = None
        self.o: A = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: E = None
        self.t: E = None
        self.s: E = None
        self.z: H = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: B = None
        self.v: A = None
        self.t: D = None
        self.x: A = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: B = None
        self.r: H = None
        self.w: E = None
        self.s: D = None
        self.u: D = None
        self.o: A = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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