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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: C = None
        self.y: D = None
        self.w: E = None
        self.t: G = None
        self.z: D = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: H = None
        self.u: F = None
        self.o: A = None
        self.v: D = None
        self.w: H = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: G = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: E = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.x: H = None
        self.o: A = None
        self.w: E = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: C = None
        self.u: A = None
        self.w: G = None
        self.s: G = None
        self.v: D = None
        self.r: G = None
        self.txt = txt

b = A("b")
j = B("j")
f = C("f")
k = D("k")
e = E("e")
m = F("m")
g = G("g")
d = H("d")

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: C = None
        self.y: D = None
        self.w: E = None
        self.t: G = None
        self.z: D = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: H = None
        self.u: F = None
        self.o: A = None
        self.v: D = None
        self.w: H = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: G = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: E = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.x: H = None
        self.o: A = None
        self.w: E = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: C = None
        self.u: A = None
        self.w: G = None
        self.s: G = None
        self.v: D = None
        self.r: G = None
        self.txt = txt

b = A("b")
j = B("j")
f = C("f")
k = D("k")
e = E("e")
m = F("m")
g = G("g")
d = H("d")

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