class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: C = None
        self.x: E = None
        self.z: I = None
        self.r: F = None
        self.p: I = None
        self.u: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: E = None
        self.v: F = None
        self.z: E = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: D = None
        self.u: D = None
        self.z: F = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: G = None
        self.w: I = None
        self.x: D = None
        self.t: C = None
        self.r: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: E = None
        self.v: F = None
        self.z: E = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: D = None
        self.u: D = None
        self.z: F = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: G = None
        self.w: I = None
        self.x: D = None
        self.t: C = None
        self.r: H = None
        self.txt = txt

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

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