class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: G = None
        self.y: F = None
        self.w: D = None
        self.v: F = None
        self.o: G = None
        self.q: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: J = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: B = None
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: C = None
        self.u: C = None
        self.w: H = None
        self.v: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: F = None
        self.o: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: J = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: B = None
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: C = None
        self.u: C = None
        self.w: H = None
        self.v: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: F = None
        self.o: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.txt = txt

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

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