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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: G = None
        self.t: E = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: D = None
        self.p: A = None
        self.o: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: G = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: E = None
        self.v: B = None
        self.o: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: J = None
        self.t: E = None
        self.z: D = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: A = None
        self.r: I = None
        self.y: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: G = None
        self.t: E = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: D = None
        self.p: A = None
        self.o: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: G = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: E = None
        self.v: B = None
        self.o: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: J = None
        self.t: E = None
        self.z: D = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: A = None
        self.r: I = None
        self.y: H = None
        self.txt = txt

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

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