class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.p: E = None
        self.u: D = None
        self.z: C = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: J = None
        self.w: I = None
        self.p: I = None
        self.q: F = None
        self.r: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: F = None
        self.t: F = None
        self.o: A = None
        self.v: C = None
        self.p: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: J = None
        self.w: I = None
        self.p: I = None
        self.q: F = None
        self.r: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: F = None
        self.t: F = None
        self.o: A = None
        self.v: C = None
        self.p: C = None
        self.txt = txt

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

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

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