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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: B = None
        self.w: A = None
        self.u: D = None
        self.p: A = None
        self.x: E = None
        self.r: F = None
        self.y: D = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.s: A = None
        self.v: D = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: B = None
        self.w: A = None
        self.u: D = None
        self.p: A = None
        self.x: E = None
        self.r: F = None
        self.y: D = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.s: A = None
        self.v: D = None
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: B = None
        self.txt = txt

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

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

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