class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: D = None
        self.p: F = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: G = None
        self.p: A = None
        self.y: E = None
        self.t: A = None
        self.u: B = None
        self.q: H = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: C = None
        self.p: G = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.y: C = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.q: G = None
        self.o: H = None
        self.p: B = None
        self.x: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: D = None
        self.p: F = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: G = None
        self.p: A = None
        self.y: E = None
        self.t: A = None
        self.u: B = None
        self.q: H = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: C = None
        self.p: G = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.y: C = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.q: G = None
        self.o: H = None
        self.p: B = None
        self.x: B = None
        self.txt = txt

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

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

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