class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.o: C = None
        self.q: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.p: A = None
        self.q: E = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: G = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.v: D = None
        self.p: D = None
        self.z: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.p: A = None
        self.q: E = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: G = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.v: D = None
        self.p: D = None
        self.z: C = None
        self.w: F = None
        self.txt = txt

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

j.w = m
j.u = f
j.o = f
j.q = l
a.x = l
a.y = f
a.w = j
a.s = j
a.q = j
f.w = l
n.t = f
n.z = j
n.p = j
n.q = m
n.y = m
m.y = a
m.v = l
m.q = n
e.x = a
e.q = m
e.z = f
l.y = a
l.t = e
l.w = e
l.v = n
l.p = n
l.z = f
assert m.v.y.y.w.v.txt == "n"