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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: E = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: G = None
        self.w: H = None
        self.y: H = None
        self.o: A = None
        self.t: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.t: G = None
        self.q: B = None
        self.v: B = None
        self.z: D = None
        self.r: A = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: H = None
        self.s: H = None
        self.w: A = None
        self.p: B = None
        self.v: A = None
        self.q: D = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.t: E = None
        self.y: G = None
        self.u: A = None
        self.v: D = None
        self.o: C = None
        self.txt = txt

a = A("a")
m = B("m")
k = C("k")
h = D("h")
j = E("j")
c = F("c")
i = G("i")
b = H("b")
d = A("d")

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: E = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: G = None
        self.w: H = None
        self.y: H = None
        self.o: A = None
        self.t: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.t: G = None
        self.q: B = None
        self.v: B = None
        self.z: D = None
        self.r: A = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: H = None
        self.s: H = None
        self.w: A = None
        self.p: B = None
        self.v: A = None
        self.q: D = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.t: E = None
        self.y: G = None
        self.u: A = None
        self.v: D = None
        self.o: C = None
        self.txt = txt

a = A("a")
m = B("m")
k = C("k")
h = D("h")
j = E("j")
c = F("c")
i = G("i")
b = H("b")
d = A("d")

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