class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: G = None
        self.u: G = None
        self.q: J = None
        self.z: G = None
        self.t: H = None
        self.o: G = None
        self.v: E = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: H = None
        self.z: I = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: C = None
        self.t: H = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: F = None
        self.p: D = None
        self.z: J = None
        self.o: B = None
        self.t: A = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.r: D = None
        self.u: I = None
        self.s: G = None
        self.z: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: G = None
        self.w: C = None
        self.y: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: H = None
        self.z: I = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: C = None
        self.t: H = None
        self.x: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: F = None
        self.p: D = None
        self.z: J = None
        self.o: B = None
        self.t: A = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.r: D = None
        self.u: I = None
        self.s: G = None
        self.z: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: G = None
        self.w: C = None
        self.y: C = None
        self.txt = txt

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

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