class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: B = None
        self.z: D = None
        self.w: I = None
        self.p: B = None
        self.s: F = None
        self.t: B = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: A = None
        self.s: G = None
        self.o: I = None
        self.r: E = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.p: F = None
        self.t: E = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: H = None
        self.w: F = None
        self.p: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: D = None
        self.z: G = None
        self.y: I = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: I = None
        self.o: F = None
        self.y: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: A = None
        self.s: G = None
        self.o: I = None
        self.r: E = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.p: F = None
        self.t: E = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: H = None
        self.w: F = None
        self.p: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: D = None
        self.z: G = None
        self.y: I = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: I = None
        self.o: F = None
        self.y: H = None
        self.txt = txt

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

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

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

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