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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: E = None
        self.w: E = None
        self.s: D = None
        self.z: C = None
        self.q: A = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: A = None
        self.w: C = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.q: A = None
        self.p: C = None
        self.o: C = None
        self.w: J = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: D = None
        self.y: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: F = None
        self.v: I = None
        self.q: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: E = None
        self.w: E = None
        self.s: D = None
        self.z: C = None
        self.q: A = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: A = None
        self.w: C = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.q: A = None
        self.p: C = None
        self.o: C = None
        self.w: J = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: D = None
        self.y: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: F = None
        self.v: I = None
        self.q: B = None
        self.u: B = None
        self.txt = txt

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

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