class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: H = None
        self.z: G = None
        self.x: J = None
        self.o: G = None
        self.v: F = None
        self.s: H = None
        self.r: G = None
        self.t: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: D = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: J = None
        self.r: H = None
        self.z: F = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.p: C = None
        self.q: D = None
        self.v: E = None
        self.r: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.q: C = None
        self.u: I = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: I = None
        self.y: B = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: H = None
        self.o: C = None
        self.r: A = None
        self.p: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: D = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: J = None
        self.r: H = None
        self.z: F = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.p: C = None
        self.q: D = None
        self.v: E = None
        self.r: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.q: C = None
        self.u: I = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: I = None
        self.y: B = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: H = None
        self.o: C = None
        self.r: A = None
        self.p: C = None
        self.u: F = None
        self.txt = txt

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

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

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