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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: G = None
        self.z: G = None
        self.y: A = None
        self.v: E = None
        self.r: J = None
        self.t: J = None
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: F = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: G = None
        self.z: G = None
        self.y: A = None
        self.v: E = None
        self.r: J = None
        self.t: J = None
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: F = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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