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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: C = None
        self.u: D = None
        self.x: H = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: F = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: C = None
        self.u: F = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: C = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: C = None
        self.u: D = None
        self.x: H = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: F = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: C = None
        self.u: F = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: C = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: E = None
        self.txt = txt

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

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

m.t = j
m.z = i
i.z = n
i.r = n
i.u = e
i.x = j
i.t = h
n.p = j
n.r = a
n.x = i
e.o = j
e.s = a
e.q = n
h.x = m
h.o = n
h.w = n
h.u = a
a.s = g
a.o = g
a.r = n
g.s = m
g.u = h
j.r = i
j.o = g
j.t = g
j.p = h
j.x = h
j.w = h
j.s = e
j.q = m
assert n.x.t.u.r.txt == "n"