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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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