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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: H = None
        self.z: F = None
        self.y: G = None
        self.v: A = None
        self.u: A = None
        self.t: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.v: H = None
        self.x: J = None
        self.r: G = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: D = None
        self.q: F = None
        self.o: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: H = None
        self.z: F = None
        self.y: G = None
        self.v: A = None
        self.u: A = None
        self.t: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.v: H = None
        self.x: J = None
        self.r: G = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: D = None
        self.q: F = None
        self.o: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.y: G = None
        self.txt = txt

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

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