class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: D = None
        self.s: B = None
        self.u: G = None
        self.w: G = None
        self.v: D = None
        self.x: I = None
        self.o: E = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: F = None
        self.s: D = None
        self.w: G = None
        self.u: F = None
        self.x: H = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.p: I = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.v: A = None
        self.u: I = None
        self.x: B = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: D = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: C = None
        self.r: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: F = None
        self.s: D = None
        self.w: G = None
        self.u: F = None
        self.x: H = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.p: I = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.v: A = None
        self.u: I = None
        self.x: B = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: D = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: C = None
        self.r: G = None
        self.txt = txt

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

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

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