class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: F = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: D = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: D = None
        self.z: F = None
        self.txt = txt

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

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

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

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