class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: E = None
        self.r: G = None
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: A = None
        self.w: E = None
        self.y: D = None
        self.p: E = None
        self.u: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: D = None
        self.t: E = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: G = None
        self.r: A = None
        self.z: A = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: B = None
        self.s: A = None
        self.w: E = None
        self.r: B = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

g = A("g")
e = B("e")
d = C("d")
a = D("a")
m = E("m")
h = F("h")
i = G("i")
n = F("n")

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: A = None
        self.w: E = None
        self.y: D = None
        self.p: E = None
        self.u: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: D = None
        self.t: E = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: G = None
        self.r: A = None
        self.z: A = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: B = None
        self.s: A = None
        self.w: E = None
        self.r: B = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

g = A("g")
e = B("e")
d = C("d")
a = D("a")
m = E("m")
h = F("h")
i = G("i")
n = F("n")

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