class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: E = None
        self.x: D = None
        self.t: H = None
        self.q: E = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: F = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.v: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

m = A("m")
a = B("a")
d = C("d")
b = D("b")
l = E("l")
g = F("g")
h = G("h")
c = H("c")

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: F = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.v: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

m = A("m")
a = B("a")
d = C("d")
b = D("b")
l = E("l")
g = F("g")
h = G("h")
c = H("c")

m.w = d
m.u = l
m.q = l
m.x = b
m.t = c
m.s = a
a.t = m
a.v = m
a.q = g
d.z = a
d.y = a
d.w = l
d.v = m
b.x = c
b.o = g
l.q = g
l.t = h
g.p = a
g.y = a
g.s = m
g.w = l
g.x = h
h.q = l
c.v = g
c.z = a
c.o = b
c.r = b
c.s = b
c.p = m
assert a.q.w.t.txt == "h"