class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: E = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: H = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: F = None
        self.p: C = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: H = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: F = None
        self.p: C = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: E = None
        self.txt = txt

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

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