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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: I = None
        self.p: J = None
        self.w: I = None
        self.s: J = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.r: H = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: H = None
        self.v: H = None
        self.s: G = None
        self.y: C = None
        self.txt = txt

m = A("m")
f = B("f")
n = C("n")
g = D("g")
j = E("j")
h = F("h")
b = G("b")
i = H("i")
d = I("d")
k = J("k")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: I = None
        self.p: J = None
        self.w: I = None
        self.s: J = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.r: H = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: H = None
        self.v: H = None
        self.s: G = None
        self.y: C = None
        self.txt = txt

m = A("m")
f = B("f")
n = C("n")
g = D("g")
j = E("j")
h = F("h")
b = G("b")
i = H("i")
d = I("d")
k = J("k")

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