class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.t: G = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: G = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.w: F = None
        self.z: F = None
        self.q: A = None
        self.u: J = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: C = None
        self.y: J = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: A = None
        self.o: G = None
        self.t: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: G = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.w: F = None
        self.z: F = None
        self.q: A = None
        self.u: J = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: C = None
        self.y: J = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: A = None
        self.o: G = None
        self.t: F = None
        self.txt = txt

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

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

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