class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: E = None
        self.z: G = None
        self.v: J = None
        self.w: F = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: D = None
        self.r: H = None
        self.w: G = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: E = None
        self.q: A = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: H = None
        self.q: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.q: E = None
        self.p: G = None
        self.z: J = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: J = None
        self.v: F = None
        self.x: A = None
        self.r: H = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: D = None
        self.r: H = None
        self.w: G = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: E = None
        self.q: A = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: H = None
        self.q: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.q: E = None
        self.p: G = None
        self.z: J = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: J = None
        self.v: F = None
        self.x: A = None
        self.r: H = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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