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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: I = None
        self.o: H = None
        self.z: H = None
        self.s: G = None
        self.y: F = None
        self.p: G = None
        self.v: D = None
        self.r: I = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: I = None
        self.v: J = None
        self.q: F = None
        self.t: I = None
        self.w: J = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.u: J = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.v: F = None
        self.x: I = None
        self.t: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: I = None
        self.o: H = None
        self.z: H = None
        self.s: G = None
        self.y: F = None
        self.p: G = None
        self.v: D = None
        self.r: I = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: I = None
        self.v: J = None
        self.q: F = None
        self.t: I = None
        self.w: J = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.u: J = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.v: F = None
        self.x: I = None
        self.t: H = None
        self.txt = txt

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

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