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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: B = None
        self.o: D = None
        self.t: B = None
        self.s: F = None
        self.w: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: B = None
        self.o: D = None
        self.t: B = None
        self.s: F = None
        self.w: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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