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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: H = None
        self.p: E = None
        self.x: B = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: A = None
        self.p: C = None
        self.q: C = None
        self.u: B = None
        self.txt = txt

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

k = A("k")
c = B("c")
n = C("n")
b = D("b")
f = E("f")
a = F("a")
e = G("e")
h = H("h")
g = B("g")
d = H("d")

k.w = n
k.s = a
c.v = e
c.s = e
c.u = g
c.y = a
c.o = d
c.w = n
n.s = d
b.y = c
b.z = h
b.p = f
b.x = g
b.s = k
f.x = k
f.z = g
f.q = e
a.w = k
a.s = n
a.o = c
e.x = k
e.r = k
e.p = n
e.q = n
e.u = g
h.w = a
h.z = b
g.v = e
g.s = e
g.u = c
g.y = a
g.o = h
g.w = n
d.w = a
d.z = b
assert f.x.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: H = None
        self.p: E = None
        self.x: B = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: A = None
        self.p: C = None
        self.q: C = None
        self.u: B = None
        self.txt = txt

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

k = A("k")
c = B("c")
n = C("n")
b = D("b")
f = E("f")
a = F("a")
e = G("e")
h = H("h")
g = B("g")
d = H("d")

k.w = n
k.s = a
c.v = e
c.s = e
c.u = g
c.y = a
c.o = d
c.w = n
n.s = d
b.y = c
b.z = h
b.p = f
b.x = g
b.s = k
f.x = k
f.z = g
f.q = e
a.w = k
a.s = n
a.o = c
e.x = k
e.r = k
e.p = n
e.q = n
e.u = g
h.w = a
h.z = b
g.v = e
g.s = e
g.u = c
g.y = a
g.o = h
g.w = n
d.w = a
d.z = b
assert f.x.s.s.txt == "n"