class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: E = None
        self.r: H = None
        self.z: D = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: C = None
        self.o: I = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.w: H = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: A = None
        self.u: F = None
        self.o: H = None
        self.z: B = None
        self.r: B = None
        self.v: C = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: J = None
        self.u: H = None
        self.z: H = None
        self.x: H = None
        self.p: D = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.s: D = None
        self.z: G = None
        self.v: G = None
        self.w: C = None
        self.o: E = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: A = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: G = None
        self.s: D = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: B = None
        self.v: F = None
        self.z: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: D = None
        self.r: G = None
        self.u: C = None
        self.s: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: C = None
        self.o: I = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.w: H = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: A = None
        self.u: F = None
        self.o: H = None
        self.z: B = None
        self.r: B = None
        self.v: C = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: J = None
        self.u: H = None
        self.z: H = None
        self.x: H = None
        self.p: D = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.s: D = None
        self.z: G = None
        self.v: G = None
        self.w: C = None
        self.o: E = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: A = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: G = None
        self.s: D = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: B = None
        self.v: F = None
        self.z: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: D = None
        self.r: G = None
        self.u: C = None
        self.s: C = None
        self.txt = txt

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

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