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

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

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.t: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.o: F = None
        self.t: C = None
        self.z: H = None
        self.s: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: F = None
        self.r: D = None
        self.o: A = None
        self.y: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: G = None
        self.s: I = None
        self.y: F = None
        self.t: E = None
        self.txt = txt

f = A("f")
d = B("d")
b = C("b")
h = D("h")
c = E("c")
m = F("m")
j = G("j")
l = H("l")
i = I("i")
k = J("k")

f.s = b
f.x = j
f.v = j
f.t = j
f.o = h
f.p = h
f.q = c
f.z = c
f.u = i
d.y = i
d.x = i
d.r = h
b.w = k
b.t = k
h.u = b
c.u = i
c.o = m
c.t = b
c.z = l
c.s = j
m.q = j
j.v = h
j.y = l
j.x = c
j.w = k
j.u = b
l.t = c
l.z = m
l.r = h
l.o = f
l.y = i
i.w = f
i.x = b
k.x = c
k.t = c
k.r = j
k.s = i
k.y = m
assert k.t.s.w.y.q.x.z.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: G = None
        self.o: D = None
        self.q: E = None
        self.v: G = None
        self.u: I = None
        self.p: D = None
        self.z: E = None
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.t: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.o: F = None
        self.t: C = None
        self.z: H = None
        self.s: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: F = None
        self.r: D = None
        self.o: A = None
        self.y: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: G = None
        self.s: I = None
        self.y: F = None
        self.t: E = None
        self.txt = txt

f = A("f")
d = B("d")
b = C("b")
h = D("h")
c = E("c")
m = F("m")
j = G("j")
l = H("l")
i = I("i")
k = J("k")

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