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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.p: I = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: H = None
        self.v: C = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.r: G = None
        self.w: J = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.p: I = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: H = None
        self.v: C = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.r: G = None
        self.w: J = None
        self.txt = txt

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

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

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

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