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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: E = None
        self.o: J = None
        self.r: G = None
        self.v: I = None
        self.x: H = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: J = None
        self.u: B = None
        self.w: G = None
        self.r: B = None
        self.t: J = None
        self.s: I = None
        self.p: E = None
        self.v: C = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: B = None
        self.u: D = None
        self.x: B = None
        self.o: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: E = None
        self.z: F = None
        self.v: D = None
        self.y: F = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: E = None
        self.o: J = None
        self.r: G = None
        self.v: I = None
        self.x: H = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: J = None
        self.u: B = None
        self.w: G = None
        self.r: B = None
        self.t: J = None
        self.s: I = None
        self.p: E = None
        self.v: C = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: B = None
        self.u: D = None
        self.x: B = None
        self.o: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: E = None
        self.z: F = None
        self.v: D = None
        self.y: F = None
        self.p: A = None
        self.txt = txt

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

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