class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: G = None
        self.o: C = None
        self.t: G = None
        self.z: A = None
        self.txt = txt

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

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

d = A("d")
a = B("a")
e = C("e")
g = D("g")
f = E("f")
n = F("n")
j = G("j")
k = D("k")
l = E("l")

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: G = None
        self.o: C = None
        self.t: G = None
        self.z: A = None
        self.txt = txt

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

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

d = A("d")
a = B("a")
e = C("e")
g = D("g")
f = E("f")
n = F("n")
j = G("j")
k = D("k")
l = E("l")

d.z = e
d.s = k
a.q = n
e.u = n
g.z = a
f.v = e
f.o = e
f.p = j
f.t = j
f.z = d
n.r = d
n.s = j
n.z = j
n.x = a
n.q = g
j.o = n
j.q = n
j.t = a
j.z = g
j.w = g
k.z = a
l.v = e
l.o = e
l.p = j
l.t = j
l.z = d
assert a.q.r.s.z.q.q.z.txt == "a"