class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: H = None
        self.t: I = None
        self.w: F = None
        self.s: D = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.q: B = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: J = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: J = None
        self.o: J = None
        self.s: D = None
        self.x: C = None
        self.z: F = None
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: H = None
        self.t: I = None
        self.w: F = None
        self.s: D = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.q: B = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: J = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: J = None
        self.o: J = None
        self.s: D = None
        self.x: C = None
        self.z: F = None
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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