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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: C = None
        self.v: G = None
        self.o: B = None
        self.q: A = None
        self.p: H = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.w: A = None
        self.t: F = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: C = None
        self.v: G = None
        self.o: B = None
        self.q: A = None
        self.p: H = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: E = None
        self.w: A = None
        self.t: F = None
        self.r: B = None
        self.txt = txt

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

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

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

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