class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: F = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: I = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: I = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

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

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

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