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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

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

m.t = g
m.q = l
m.u = l
l.u = a
l.s = g
l.z = d
g.z = l
g.u = k
a.w = n
a.p = d
a.t = g
a.q = l
d.y = n
d.w = a
d.z = k
n.s = a
c.z = m
c.q = m
c.t = n
k.t = n
k.r = d
k.s = m
k.x = c
assert a.q.z.z.t.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: B = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: E = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

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

m.t = g
m.q = l
m.u = l
l.u = a
l.s = g
l.z = d
g.z = l
g.u = k
a.w = n
a.p = d
a.t = g
a.q = l
d.y = n
d.w = a
d.z = k
n.s = a
c.z = m
c.q = m
c.t = n
k.t = n
k.r = d
k.s = m
k.x = c
assert a.q.z.z.t.s.w.txt == "n"