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

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

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: C = None
        self.z: A = None
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.p: C = None
        self.s: D = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: C = None
        self.q: H = None
        self.p: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: C = None
        self.z: A = None
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.p: C = None
        self.s: D = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: C = None
        self.q: H = None
        self.p: H = None
        self.txt = txt

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

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

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