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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.t: A = None
        self.w: A = None
        self.s: B = None
        self.r: G = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: H = None
        self.y: E = None
        self.t: G = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: I = None
        self.s: H = None
        self.x: G = None
        self.o: B = None
        self.q: C = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: A = None
        self.s: D = None
        self.v: D = None
        self.p: I = None
        self.r: I = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: H = None
        self.z: E = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: H = None
        self.x: B = None
        self.o: H = None
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.t: A = None
        self.w: A = None
        self.s: B = None
        self.r: G = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: H = None
        self.y: E = None
        self.t: G = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: I = None
        self.s: H = None
        self.x: G = None
        self.o: B = None
        self.q: C = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: A = None
        self.s: D = None
        self.v: D = None
        self.p: I = None
        self.r: I = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: H = None
        self.z: E = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: H = None
        self.x: B = None
        self.o: H = None
        self.z: B = None
        self.txt = txt

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

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