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

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

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.p: H = None
        self.u: D = None
        self.o: I = None
        self.z: G = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.q: C = None
        self.s: E = None
        self.y: F = None
        self.t: G = None
        self.z: J = None
        self.u: B = None
        self.p: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: I = None
        self.u: F = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: F = None
        self.w: C = None
        self.q: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.p: H = None
        self.u: D = None
        self.o: I = None
        self.z: G = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.q: C = None
        self.s: E = None
        self.y: F = None
        self.t: G = None
        self.z: J = None
        self.u: B = None
        self.p: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: I = None
        self.u: F = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: F = None
        self.w: C = None
        self.q: D = None
        self.txt = txt

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

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