class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: B = None
        self.w: H = None
        self.r: E = None
        self.z: G = None
        self.u: E = None
        self.t: F = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.y: C = None
        self.p: D = None
        self.q: A = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

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

h = A("h")
c = B("c")
j = C("j")
b = D("b")
n = E("n")
f = F("f")
l = G("l")
g = H("g")
k = D("k")
m = F("m")

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.y: C = None
        self.p: D = None
        self.q: A = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

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

h = A("h")
c = B("c")
j = C("j")
b = D("b")
n = E("n")
f = F("f")
l = G("l")
g = H("g")
k = D("k")
m = F("m")

h.q = l
h.z = l
h.p = c
h.w = g
h.r = n
h.u = n
h.t = f
h.o = k
c.r = g
c.o = g
j.v = g
j.q = h
j.u = f
b.r = l
b.s = l
b.t = l
b.w = h
b.p = h
b.z = j
b.y = m
n.y = b
n.o = j
n.p = h
n.t = c
f.u = m
f.s = c
f.y = j
f.p = b
f.q = h
f.o = g
l.r = n
l.p = f
l.v = h
g.o = l
g.s = k
k.r = l
k.s = l
k.t = l
k.w = h
k.p = h
k.z = j
k.y = m
m.u = f
m.s = c
m.y = j
m.p = k
m.q = h
m.o = g
assert h.o.z.q.txt == "h"