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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: I = None
        self.v: C = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: J = None
        self.u: G = None
        self.w: H = None
        self.s: J = None
        self.r: D = None
        self.v: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: I = None
        self.v: C = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: J = None
        self.u: G = None
        self.w: H = None
        self.s: J = None
        self.r: D = None
        self.v: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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