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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: J = None
        self.v: B = None
        self.o: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: F = None
        self.p: F = None
        self.y: C = None
        self.w: C = None
        self.t: H = None
        self.o: F = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: J = None
        self.u: E = None
        self.v: A = None
        self.z: A = None
        self.y: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: G = None
        self.w: J = None
        self.txt = txt

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

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

e.v = i
e.o = k
e.t = k
e.s = a
e.x = g
e.z = c
e.u = b
e.q = b
e.w = m
g.z = k
c.w = h
c.p = i
c.o = i
c.v = g
h.u = k
h.t = k
h.z = k
h.r = b
h.p = b
h.o = b
h.y = c
h.w = c
f.o = b
f.v = b
f.y = k
b.t = m
b.x = i
b.u = f
b.v = e
b.z = e
b.y = h
a.p = b
a.w = e
a.r = c
a.x = m
k.p = h
k.s = i
k.q = g
m.u = g
m.x = a
m.w = i
i.q = g
assert b.t.u.z.p.w.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: H = None
        self.s: G = None
        self.t: H = None
        self.x: B = None
        self.z: C = None
        self.u: F = None
        self.w: I = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: J = None
        self.v: B = None
        self.o: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: F = None
        self.p: F = None
        self.y: C = None
        self.w: C = None
        self.t: H = None
        self.o: F = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: J = None
        self.u: E = None
        self.v: A = None
        self.z: A = None
        self.y: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: G = None
        self.w: J = None
        self.txt = txt

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

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

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