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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: E = None
        self.v: F = None
        self.o: A = None
        self.u: A = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: F = None
        self.v: G = None
        self.p: A = None
        self.r: E = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: A = None
        self.s: F = None
        self.o: A = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: E = None
        self.v: F = None
        self.o: A = None
        self.u: A = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: F = None
        self.v: G = None
        self.p: A = None
        self.r: E = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: A = None
        self.s: F = None
        self.o: A = None
        self.q: E = None
        self.txt = txt

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

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