class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: I = None
        self.s: G = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: F = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.o: E = None
        self.p: H = None
        self.q: D = None
        self.s: A = None
        self.w: E = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: G = None
        self.txt = txt

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

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

a.o = c
k.w = a
k.t = h
k.s = c
k.o = c
i.p = l
i.w = b
i.x = k
b.z = j
n.z = b
n.t = j
n.y = a
j.s = l
j.u = l
j.t = i
j.r = a
c.r = b
c.u = b
c.q = b
c.o = n
c.w = n
c.p = l
c.s = a
c.v = h
l.r = k
l.w = c
h.r = i
h.w = i
h.y = g
h.z = g
h.p = b
h.v = a
h.t = l
g.r = i
g.w = i
g.y = h
g.z = h
g.p = b
g.v = a
g.t = l
assert n.t.s.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: I = None
        self.s: G = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: F = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.o: E = None
        self.p: H = None
        self.q: D = None
        self.s: A = None
        self.w: E = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: G = None
        self.txt = txt

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

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

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