class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: B = None
        self.r: F = None
        self.y: D = None
        self.o: B = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: E = None
        self.w: C = None
        self.z: E = None
        self.u: E = None
        self.r: D = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: E = None
        self.w: C = None
        self.z: E = None
        self.u: E = None
        self.r: D = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

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