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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.x: B = None
        self.w: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: B = None
        self.x: G = None
        self.s: A = None
        self.v: C = None
        self.o: G = None
        self.q: D = None
        self.txt = txt

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

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

f = A("f")
k = B("k")
m = C("m")
i = D("i")
d = E("d")
e = F("e")
h = G("h")
n = H("n")
a = C("a")
g = F("g")

f.w = n
k.p = d
k.x = d
k.z = d
k.w = e
k.v = g
k.t = a
m.q = f
i.o = a
i.w = d
d.u = f
d.y = i
d.x = k
d.t = k
d.w = g
e.w = f
e.s = f
e.u = k
e.x = h
e.o = h
e.v = a
e.q = i
h.p = e
h.w = i
h.z = i
n.v = f
n.o = f
n.u = f
n.q = k
n.p = i
n.y = i
n.z = d
a.q = f
g.w = f
g.s = f
g.u = k
g.x = h
g.o = h
g.v = m
g.q = i
assert m.q.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.x: B = None
        self.w: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: B = None
        self.x: G = None
        self.s: A = None
        self.v: C = None
        self.o: G = None
        self.q: D = None
        self.txt = txt

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

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

f = A("f")
k = B("k")
m = C("m")
i = D("i")
d = E("d")
e = F("e")
h = G("h")
n = H("n")
a = C("a")
g = F("g")

f.w = n
k.p = d
k.x = d
k.z = d
k.w = e
k.v = g
k.t = a
m.q = f
i.o = a
i.w = d
d.u = f
d.y = i
d.x = k
d.t = k
d.w = g
e.w = f
e.s = f
e.u = k
e.x = h
e.o = h
e.v = a
e.q = i
h.p = e
h.w = i
h.z = i
n.v = f
n.o = f
n.u = f
n.q = k
n.p = i
n.y = i
n.z = d
a.q = f
g.w = f
g.s = f
g.u = k
g.x = h
g.o = h
g.v = m
g.q = i
assert m.q.w.q.txt == "k"