class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: E = None
        self.q: F = None
        self.s: G = None
        self.x: H = None
        self.y: E = None
        self.u: B = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: I = None
        self.q: C = None
        self.p: C = None
        self.z: E = None
        self.r: F = None
        self.o: G = None
        self.s: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: E = None
        self.q: H = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: E = None
        self.x: F = None
        self.w: E = None
        self.s: A = None
        self.q: E = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: D = None
        self.o: C = None
        self.w: G = None
        self.z: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: I = None
        self.q: C = None
        self.p: C = None
        self.z: E = None
        self.r: F = None
        self.o: G = None
        self.s: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: E = None
        self.q: H = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: E = None
        self.x: F = None
        self.w: E = None
        self.s: A = None
        self.q: E = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: D = None
        self.o: C = None
        self.w: G = None
        self.z: I = None
        self.txt = txt

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

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

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