class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: B = None
        self.o: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: C = None
        self.p: H = None
        self.o: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: G = None
        self.v: A = None
        self.q: C = None
        self.w: C = None
        self.u: C = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: G = None
        self.z: G = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: B = None
        self.o: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: C = None
        self.p: H = None
        self.o: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: G = None
        self.v: A = None
        self.q: C = None
        self.w: C = None
        self.u: C = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: G = None
        self.z: G = None
        self.v: D = None
        self.txt = txt

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

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

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