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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.s: F = None
        self.v: I = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: A = None
        self.x: H = None
        self.q: F = None
        self.u: H = None
        self.z: D = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: G = None
        self.v: E = None
        self.o: B = None
        self.u: J = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: C = None
        self.z: A = None
        self.y: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: F = None
        self.r: A = None
        self.v: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.s: F = None
        self.v: I = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: A = None
        self.x: H = None
        self.q: F = None
        self.u: H = None
        self.z: D = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: G = None
        self.v: E = None
        self.o: B = None
        self.u: J = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: C = None
        self.z: A = None
        self.y: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: F = None
        self.r: A = None
        self.v: E = None
        self.txt = txt

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

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

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