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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: E = None
        self.u: H = None
        self.r: E = None
        self.x: G = None
        self.y: H = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: G = None
        self.v: F = None
        self.x: E = None
        self.t: D = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: E = None
        self.u: H = None
        self.r: E = None
        self.x: G = None
        self.y: H = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: G = None
        self.v: F = None
        self.x: E = None
        self.t: D = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: A = None
        self.txt = txt

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

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

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

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