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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: I = None
        self.u: B = None
        self.z: H = None
        self.s: F = None
        self.v: F = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.w: A = None
        self.p: E = None
        self.r: I = None
        self.s: H = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.q: I = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: D = None
        self.v: E = None
        self.z: E = None
        self.q: A = None
        self.p: A = None
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: I = None
        self.u: B = None
        self.z: H = None
        self.s: F = None
        self.v: F = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.w: A = None
        self.p: E = None
        self.r: I = None
        self.s: H = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.q: I = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: D = None
        self.v: E = None
        self.z: E = None
        self.q: A = None
        self.p: A = None
        self.w: F = None
        self.txt = txt

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

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