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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: C = None
        self.v: E = None
        self.t: E = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: E = None
        self.q: G = None
        self.y: A = None
        self.p: A = None
        self.o: F = None
        self.x: D = None
        self.t: G = None
        self.txt = txt

m = A("m")
k = B("k")
h = C("h")
j = D("j")
a = E("a")
d = F("d")
n = G("n")
i = H("i")
b = A("b")

m.q = a
m.v = b
m.x = b
k.z = i
k.q = j
h.q = k
h.u = n
h.s = n
h.o = a
j.z = k
a.w = d
a.r = m
d.p = m
d.w = h
d.v = a
d.t = a
d.q = b
n.x = i
i.v = k
i.z = a
i.q = n
i.t = n
i.y = b
i.p = m
i.o = d
i.x = j
b.q = a
b.v = m
b.x = m
assert a.w.q.q.w.q.v.q.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: A = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: C = None
        self.v: E = None
        self.t: E = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: E = None
        self.q: G = None
        self.y: A = None
        self.p: A = None
        self.o: F = None
        self.x: D = None
        self.t: G = None
        self.txt = txt

m = A("m")
k = B("k")
h = C("h")
j = D("j")
a = E("a")
d = F("d")
n = G("n")
i = H("i")
b = A("b")

m.q = a
m.v = b
m.x = b
k.z = i
k.q = j
h.q = k
h.u = n
h.s = n
h.o = a
j.z = k
a.w = d
a.r = m
d.p = m
d.w = h
d.v = a
d.t = a
d.q = b
n.x = i
i.v = k
i.z = a
i.q = n
i.t = n
i.y = b
i.p = m
i.o = d
i.x = j
b.q = a
b.v = m
b.x = m
assert a.w.q.q.w.q.v.q.r.q.txt == "a"