class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: E = None
        self.y: A = None
        self.u: H = None
        self.x: J = None
        self.t: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.y: C = None
        self.w: F = None
        self.s: D = None
        self.z: J = None
        self.x: J = None
        self.v: F = None
        self.p: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: E = None
        self.y: A = None
        self.u: H = None
        self.x: J = None
        self.t: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.y: C = None
        self.w: F = None
        self.s: D = None
        self.z: J = None
        self.x: J = None
        self.v: F = None
        self.p: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: F = None
        self.txt = txt

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

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