class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: D = None
        self.v: F = None
        self.s: H = None
        self.r: C = None
        self.q: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: H = None
        self.p: D = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: H = None
        self.p: D = None
        self.r: H = None
        self.txt = txt

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

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

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