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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: H = None
        self.q: E = None
        self.r: B = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: G = None
        self.w: A = None
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: H = None
        self.q: E = None
        self.r: B = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: G = None
        self.w: A = None
        self.q: E = None
        self.txt = txt

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

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