class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: A = None
        self.w: I = None
        self.u: C = None
        self.o: I = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: H = None
        self.z: D = None
        self.p: H = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: C = None
        self.z: B = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: F = None
        self.s: F = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: B = None
        self.o: G = None
        self.w: E = None
        self.x: E = None
        self.p: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: A = None
        self.w: I = None
        self.u: C = None
        self.o: I = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: H = None
        self.z: D = None
        self.p: H = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: C = None
        self.z: B = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: F = None
        self.s: F = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: B = None
        self.o: G = None
        self.w: E = None
        self.x: E = None
        self.p: G = None
        self.txt = txt

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

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