class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: C = None
        self.s: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: I = None
        self.t: A = None
        self.z: J = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.s: H = None
        self.q: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: I = None
        self.t: G = None
        self.z: G = None
        self.o: G = None
        self.y: I = None
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: C = None
        self.s: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: I = None
        self.t: A = None
        self.z: J = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.s: H = None
        self.q: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: I = None
        self.t: G = None
        self.z: G = None
        self.o: G = None
        self.y: I = None
        self.p: E = None
        self.txt = txt

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

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