class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: B = None
        self.z: H = None
        self.r: B = None
        self.q: J = None
        self.o: E = None
        self.u: C = None
        self.v: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: J = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.s: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: H = None
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: I = None
        self.r: A = None
        self.o: E = None
        self.p: I = None
        self.x: E = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: J = None
        self.p: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: J = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.s: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: H = None
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: I = None
        self.r: A = None
        self.o: E = None
        self.p: I = None
        self.x: E = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: J = None
        self.p: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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