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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: B = None
        self.q: C = None
        self.x: B = None
        self.w: B = None
        self.v: H = None
        self.z: B = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: C = None
        self.p: D = None
        self.s: C = None
        self.r: G = None
        self.w: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: B = None
        self.q: C = None
        self.x: B = None
        self.w: B = None
        self.v: H = None
        self.z: B = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: C = None
        self.p: D = None
        self.s: C = None
        self.r: G = None
        self.w: G = None
        self.txt = txt

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

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