class A:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: B = None
        self.q: C = None
        self.x: H = None
        self.p: I = None
        self.y: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: F = None
        self.q: D = None
        self.p: D = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: I = None
        self.v: C = None
        self.y: B = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: D = None
        self.z: F = None
        self.u: F = None
        self.t: C = None
        self.y: D = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: F = None
        self.q: D = None
        self.p: D = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: I = None
        self.v: C = None
        self.y: B = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: D = None
        self.z: F = None
        self.u: F = None
        self.t: C = None
        self.y: D = None
        self.p: H = None
        self.txt = txt

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

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