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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: I = None
        self.r: D = None
        self.x: A = None
        self.p: A = None
        self.v: A = None
        self.q: B = None
        self.y: E = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: C = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

a = A("a")
f = B("f")
e = C("e")
h = D("h")
i = E("i")
g = F("g")
m = G("m")
k = H("k")
n = I("n")
l = J("l")

a.z = h
a.w = k
a.o = n
f.x = m
e.z = n
e.v = g
e.u = k
e.y = m
e.o = i
e.r = i
e.x = h
e.t = h
e.s = f
e.p = a
h.y = i
h.x = e
i.x = n
i.q = m
i.o = g
i.u = a
g.z = i
g.y = i
g.t = n
g.r = h
g.x = a
g.p = a
g.v = a
g.w = a
g.q = f
g.u = f
m.z = l
m.w = a
m.u = g
k.p = i
k.u = e
k.v = h
n.v = m
l.o = m
l.w = m
assert h.x.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: H = None
        self.o: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: I = None
        self.r: D = None
        self.x: A = None
        self.p: A = None
        self.v: A = None
        self.q: B = None
        self.y: E = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: C = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

a = A("a")
f = B("f")
e = C("e")
h = D("h")
i = E("i")
g = F("g")
m = G("m")
k = H("k")
n = I("n")
l = J("l")

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