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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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