class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: E = None
        self.s: D = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: C = None
        self.x: D = None
        self.s: D = None
        self.r: G = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: C = None
        self.x: D = None
        self.s: D = None
        self.r: G = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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