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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: A = None
        self.z: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: C = None
        self.v: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: J = None
        self.r: D = None
        self.u: I = None
        self.t: G = None
        self.q: C = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: A = None
        self.o: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.p: D = None
        self.r: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: A = None
        self.z: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: C = None
        self.v: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: J = None
        self.r: D = None
        self.u: I = None
        self.t: G = None
        self.q: C = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: A = None
        self.o: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: G = None
        self.p: D = None
        self.r: H = None
        self.txt = txt

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

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