class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: G = None
        self.s: J = None
        self.o: E = None
        self.p: B = None
        self.z: H = None
        self.r: I = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: J = None
        self.p: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.t: D = None
        self.r: F = None
        self.y: F = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.o: D = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: B = None
        self.x: C = None
        self.p: C = None
        self.w: B = None
        self.s: I = None
        self.u: C = None
        self.t: C = None
        self.q: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: J = None
        self.p: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.t: D = None
        self.r: F = None
        self.y: F = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.o: D = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: B = None
        self.x: C = None
        self.p: C = None
        self.w: B = None
        self.s: I = None
        self.u: C = None
        self.t: C = None
        self.q: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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