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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: C = None
        self.v: B = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: A = None
        self.s: G = None
        self.o: C = None
        self.t: G = None
        self.p: C = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: E = None
        self.z: D = None
        self.t: G = None
        self.x: A = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: C = None
        self.v: B = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: A = None
        self.s: G = None
        self.o: C = None
        self.t: G = None
        self.p: C = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: E = None
        self.z: D = None
        self.t: G = None
        self.x: A = None
        self.v: G = None
        self.txt = txt

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

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