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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: E = None
        self.r: A = None
        self.t: G = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: C = None
        self.z: E = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: F = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: E = None
        self.r: A = None
        self.t: G = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: C = None
        self.z: E = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: F = None
        self.y: A = None
        self.txt = txt

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

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

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

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