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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: F = None
        self.o: B = None
        self.s: C = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: H = None
        self.q: A = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: F = None
        self.o: B = None
        self.s: C = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: H = None
        self.q: A = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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