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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: B = None
        self.w: F = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: A = None
        self.v: B = None
        self.o: C = None
        self.s: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: B = None
        self.w: F = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: A = None
        self.v: B = None
        self.o: C = None
        self.s: D = None
        self.t: C = None
        self.txt = txt

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

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

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