class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: A = None
        self.z: A = None
        self.r: A = None
        self.q: A = None
        self.txt = txt

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

n = A("n")
i = B("i")
e = C("e")
h = D("h")
g = E("g")
c = F("c")
k = G("k")
d = G("d")
j = F("j")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: A = None
        self.z: A = None
        self.r: A = None
        self.q: A = None
        self.txt = txt

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

n = A("n")
i = B("i")
e = C("e")
h = D("h")
g = E("g")
c = F("c")
k = G("k")
d = G("d")
j = F("j")

n.z = j
i.z = g
i.u = n
e.u = h
e.o = i
e.s = c
e.x = n
e.y = k
h.o = i
h.w = k
h.p = k
h.s = k
h.y = k
g.s = e
g.p = k
g.w = i
g.q = j
c.p = n
c.s = n
c.z = n
c.r = n
c.q = n
k.z = j
k.q = n
k.t = i
k.w = g
d.z = c
d.q = n
d.t = i
d.w = g
j.p = n
j.s = n
j.z = n
j.r = n
j.q = n
assert k.q.z.p.z.s.z.txt == "j"