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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: A = None
        self.x: E = None
        self.z: A = None
        self.q: G = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: G = None
        self.s: G = None
        self.r: H = None
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: I = None
        self.v: E = None
        self.x: I = None
        self.q: D = None
        self.u: J = None
        self.o: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: C = None
        self.y: B = None
        self.u: I = None
        self.t: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: A = None
        self.x: E = None
        self.z: A = None
        self.q: G = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: G = None
        self.s: G = None
        self.r: H = None
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: I = None
        self.v: E = None
        self.x: I = None
        self.q: D = None
        self.u: J = None
        self.o: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: C = None
        self.y: B = None
        self.u: I = None
        self.t: G = None
        self.txt = txt

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

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