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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: H = None
        self.t: J = None
        self.w: A = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: B = None
        self.r: J = None
        self.p: B = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: J = None
        self.p: I = None
        self.y: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: I = None
        self.o: E = None
        self.p: H = None
        self.y: H = None
        self.z: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: H = None
        self.t: J = None
        self.w: A = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: B = None
        self.r: J = None
        self.p: B = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: J = None
        self.p: I = None
        self.y: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: I = None
        self.o: E = None
        self.p: H = None
        self.y: H = None
        self.z: I = None
        self.txt = txt

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

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