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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: E = None
        self.x: J = None
        self.z: A = None
        self.w: H = None
        self.y: I = None
        self.q: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: F = None
        self.u: C = None
        self.p: C = None
        self.x: J = None
        self.z: C = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: E = None
        self.x: J = None
        self.z: A = None
        self.w: H = None
        self.y: I = None
        self.q: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: F = None
        self.u: C = None
        self.p: C = None
        self.x: J = None
        self.z: C = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

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