class A:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: D = None
        self.x: H = None
        self.v: C = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: J = None
        self.z: H = None
        self.w: J = None
        self.p: F = None
        self.v: J = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.u: B = None
        self.w: J = None
        self.t: J = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: A = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.t: E = None
        self.q: D = None
        self.u: E = None
        self.p: E = None
        self.r: G = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: H = None
        self.u: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

b.q = i
b.o = a
b.z = a
b.x = l
b.v = m
k.u = i
k.w = i
k.v = i
k.z = l
k.p = g
k.x = n
m.o = b
m.s = b
m.u = k
m.w = i
m.t = i
a.r = b
a.q = k
f.y = m
f.w = a
g.q = a
n.r = k
n.v = b
n.s = f
n.o = f
l.z = f
l.t = f
l.u = f
l.p = f
l.x = g
l.q = a
l.r = n
l.o = d
d.v = f
d.r = l
d.u = g
i.v = a
assert m.o.o.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: D = None
        self.x: H = None
        self.v: C = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: J = None
        self.z: H = None
        self.w: J = None
        self.p: F = None
        self.v: J = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.u: B = None
        self.w: J = None
        self.t: J = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: A = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.t: E = None
        self.q: D = None
        self.u: E = None
        self.p: E = None
        self.r: G = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: H = None
        self.u: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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