class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: B = None
        self.u: F = None
        self.s: F = None
        self.o: F = None
        self.p: F = None
        self.t: F = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: C = None
        self.r: A = None
        self.v: B = None
        self.u: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: E = None
        self.y: E = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: F = None
        self.r: D = None
        self.x: F = None
        self.q: G = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: C = None
        self.r: A = None
        self.v: B = None
        self.u: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: E = None
        self.y: E = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: F = None
        self.r: D = None
        self.x: F = None
        self.q: G = None
        self.u: F = None
        self.txt = txt

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

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