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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: A = None
        self.p: J = None
        self.v: I = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: H = None
        self.x: C = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: J = None
        self.v: B = None
        self.q: J = None
        self.o: F = None
        self.s: C = None
        self.p: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: D = None
        self.u: A = None
        self.s: A = None
        self.q: G = None
        self.r: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: A = None
        self.p: J = None
        self.v: I = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: H = None
        self.x: C = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: J = None
        self.v: B = None
        self.q: J = None
        self.o: F = None
        self.s: C = None
        self.p: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: D = None
        self.u: A = None
        self.s: A = None
        self.q: G = None
        self.r: A = None
        self.txt = txt

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

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