class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: D = None
        self.x: G = None
        self.s: E = None
        self.v: I = None
        self.w: C = None
        self.z: E = None
        self.o: C = None
        self.y: E = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: F = None
        self.z: I = None
        self.s: F = None
        self.q: B = None
        self.r: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.q: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: C = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: B = None
        self.x: H = None
        self.q: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: I = None
        self.t: J = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: G = None
        self.x: J = None
        self.q: C = None
        self.y: F = None
        self.t: J = None
        self.o: B = None
        self.s: J = None
        self.z: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: D = None
        self.o: G = None
        self.q: H = None
        self.r: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: F = None
        self.z: I = None
        self.s: F = None
        self.q: B = None
        self.r: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.q: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: C = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: B = None
        self.x: H = None
        self.q: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: I = None
        self.t: J = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: G = None
        self.x: J = None
        self.q: C = None
        self.y: F = None
        self.t: J = None
        self.o: B = None
        self.s: J = None
        self.z: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: D = None
        self.o: G = None
        self.q: H = None
        self.r: D = None
        self.txt = txt

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

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