class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: H = None
        self.u: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: F = None
        self.y: F = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: H = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: B = None
        self.z: H = None
        self.r: D = None
        self.x: C = None
        self.u: H = None
        self.t: G = 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.s: C = None
        self.w: F = None
        self.o: C = None
        self.y: E = None
        self.r: C = None
        self.p: C = None
        self.t: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: F = None
        self.y: F = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: H = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: B = None
        self.z: H = None
        self.r: D = None
        self.x: C = None
        self.u: H = None
        self.t: G = 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.s: C = None
        self.w: F = None
        self.o: C = None
        self.y: E = None
        self.r: C = None
        self.p: C = None
        self.t: B = None
        self.z: A = None
        self.txt = txt

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

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

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