class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.t: E = None
        self.s: F = None
        self.y: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: D = None
        self.v: B = None
        self.p: A = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: C = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

b.z = m
b.r = m
b.t = e
b.s = h
b.y = c
f.w = d
f.p = d
f.z = e
f.r = a
f.q = a
f.s = b
f.x = b
f.t = h
d.v = a
m.z = c
m.r = c
m.o = c
m.u = e
m.y = e
m.s = h
m.v = d
m.x = b
e.r = f
h.u = m
h.o = m
h.s = m
h.v = f
h.p = b
c.u = h
c.v = a
a.v = e
a.t = e
a.s = d
a.z = h
assert b.s.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.t: E = None
        self.s: F = None
        self.y: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: D = None
        self.v: B = None
        self.p: A = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: C = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

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