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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: G = None
        self.z: G = None
        self.v: A = None
        self.r: J = None
        self.q: D = None
        self.w: I = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: J = None
        self.p: F = None
        self.s: B = None
        self.x: J = None
        self.o: E = None
        self.r: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: E = None
        self.p: C = None
        self.w: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: E = None
        self.x: E = None
        self.v: D = None
        self.txt = txt

a = A("a")
h = B("h")
f = C("f")
b = D("b")
e = E("e")
k = F("k")
j = G("j")
d = H("d")
c = I("c")
m = J("m")

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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: G = None
        self.z: G = None
        self.v: A = None
        self.r: J = None
        self.q: D = None
        self.w: I = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: J = None
        self.p: F = None
        self.s: B = None
        self.x: J = None
        self.o: E = None
        self.r: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: E = None
        self.p: C = None
        self.w: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: E = None
        self.x: E = None
        self.v: D = None
        self.txt = txt

a = A("a")
h = B("h")
f = C("f")
b = D("b")
e = E("e")
k = F("k")
j = G("j")
d = H("d")
c = I("c")
m = J("m")

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