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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: B = None
        self.z: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: J = None
        self.w: C = None
        self.z: H = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.u: D = None
        self.x: G = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: F = None
        self.o: J = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: E = None
        self.z: F = None
        self.p: E = None
        self.q: D = None
        self.s: B = None
        self.x: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: A = None
        self.w: G = None
        self.o: E = None
        self.t: H = None
        self.z: D = None
        self.v: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: B = None
        self.z: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: J = None
        self.w: C = None
        self.z: H = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.u: D = None
        self.x: G = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: F = None
        self.o: J = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: E = None
        self.z: F = None
        self.p: E = None
        self.q: D = None
        self.s: B = None
        self.x: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: A = None
        self.w: G = None
        self.o: E = None
        self.t: H = None
        self.z: D = None
        self.v: E = None
        self.txt = txt

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

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

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