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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.w: H = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.v: C = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.w: F = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: D = None
        self.r: A = None
        self.y: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: B = None
        self.p: G = None
        self.y: F = None
        self.o: B = None
        self.w: D = None
        self.txt = txt

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

n.z = j
n.v = j
n.p = j
n.x = b
n.s = i
j.x = l
j.q = l
j.u = g
j.o = g
d.z = l
d.v = l
m.p = j
m.y = j
m.w = n
i.y = h
i.w = b
i.v = d
a.w = g
g.r = i
g.w = i
g.v = d
g.u = m
b.p = n
b.r = i
b.w = a
b.x = l
l.u = h
l.v = m
l.r = n
l.y = n
h.z = l
h.u = j
h.o = j
h.p = g
h.y = a
h.w = m
assert m.y.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: H = None
        self.v: B = None
        self.p: B = None
        self.s: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.w: H = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.v: C = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.w: F = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: D = None
        self.r: A = None
        self.y: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: B = None
        self.p: G = None
        self.y: F = None
        self.o: B = None
        self.w: D = None
        self.txt = txt

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

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