class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: F = None
        self.p: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: I = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: G = None
        self.o: C = None
        self.s: I = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: D = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: B = None
        self.z: H = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.x: F = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: I = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: G = None
        self.o: C = None
        self.s: I = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: D = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: B = None
        self.z: H = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.x: F = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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