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

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

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: C = None
        self.y: D = None
        self.o: E = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

a = A("a")
l = B("l")
i = C("i")
f = D("f")
n = E("n")
e = F("e")
h = G("h")
m = H("m")
b = I("b")
c = A("c")

a.q = h
l.o = h
l.v = m
i.q = b
f.r = c
n.p = a
n.t = b
e.q = l
e.r = l
e.p = l
e.w = l
e.s = m
e.z = i
h.q = n
h.o = n
h.s = i
h.w = i
h.y = f
m.o = h
m.r = f
m.q = i
b.p = n
c.q = h
assert a.q.s.q.p.t.p.p.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: C = None
        self.y: D = None
        self.o: E = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

a = A("a")
l = B("l")
i = C("i")
f = D("f")
n = E("n")
e = F("e")
h = G("h")
m = H("m")
b = I("b")
c = A("c")

a.q = h
l.o = h
l.v = m
i.q = b
f.r = c
n.p = a
n.t = b
e.q = l
e.r = l
e.p = l
e.w = l
e.s = m
e.z = i
h.q = n
h.o = n
h.s = i
h.w = i
h.y = f
m.o = h
m.r = f
m.q = i
b.p = n
c.q = h
assert a.q.s.q.p.t.p.p.q.o.txt == "n"