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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.q: C = None
        self.z: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: A = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: A = None
        self.x: C = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.q: C = None
        self.z: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: A = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: A = None
        self.x: C = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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