class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: G = None
        self.u: G = None
        self.z: F = None
        self.o: E = None
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: E = None
        self.w: E = None
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: H = None
        self.s: G = None
        self.q: C = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: D = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: E = None
        self.w: E = None
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: H = None
        self.s: G = None
        self.q: C = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: D = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

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

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

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