class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: H = None
        self.u: G = None
        self.s: B = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: F = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: F = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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