class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: A = None
        self.w: H = None
        self.s: H = None
        self.r: F = None
        self.v: H = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: C = None
        self.r: H = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: I = None
        self.q: D = None
        self.s: C = None
        self.y: B = None
        self.x: A = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.s: J = None
        self.w: J = None
        self.p: F = None
        self.t: A = None
        self.z: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: E = None
        self.v: D = None
        self.u: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: A = None
        self.w: H = None
        self.s: H = None
        self.r: F = None
        self.v: H = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: C = None
        self.r: H = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: I = None
        self.q: D = None
        self.s: C = None
        self.y: B = None
        self.x: A = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.s: J = None
        self.w: J = None
        self.p: F = None
        self.t: A = None
        self.z: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: E = None
        self.v: D = None
        self.u: H = None
        self.txt = txt

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

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