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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: D = None
        self.u: E = None
        self.p: C = None
        self.y: C = None
        self.x: A = None
        self.q: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: D = None
        self.w: E = None
        self.o: B = None
        self.y: D = None
        self.t: B = None
        self.txt = txt

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

e = A("e")
f = B("f")
m = C("m")
c = D("c")
b = E("b")
a = F("a")
n = G("n")
k = C("k")
g = B("g")

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: D = None
        self.u: E = None
        self.p: C = None
        self.y: C = None
        self.x: A = None
        self.q: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: D = None
        self.w: E = None
        self.o: B = None
        self.y: D = None
        self.t: B = None
        self.txt = txt

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

e = A("e")
f = B("f")
m = C("m")
c = D("c")
b = E("b")
a = F("a")
n = G("n")
k = C("k")
g = B("g")

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