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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: B = None
        self.s: C = None
        self.o: G = None
        self.x: G = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

n = A("n")
h = B("h")
i = C("i")
j = D("j")
l = E("l")
d = F("d")
c = G("c")
f = H("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: B = None
        self.s: C = None
        self.o: G = None
        self.x: G = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

n = A("n")
h = B("h")
i = C("i")
j = D("j")
l = E("l")
d = F("d")
c = G("c")
f = H("f")

n.x = j
h.v = i
h.p = i
h.q = l
h.o = l
h.z = n
h.y = d
i.q = h
j.p = i
j.r = i
j.w = n
l.r = j
l.w = d
l.t = n
l.s = n
l.q = n
l.u = h
l.p = h
l.v = c
d.w = f
d.z = f
d.q = h
d.s = i
d.o = c
d.x = c
c.t = l
f.q = i
f.p = i
f.u = c
f.r = j
f.y = j
f.s = h
f.w = n
assert h.p.q.z.txt == "n"