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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: G = None
        self.u: B = None
        self.r: F = None
        self.z: E = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: C = None
        self.s: D = None
        self.t: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: G = None
        self.u: B = None
        self.r: F = None
        self.z: E = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: C = None
        self.s: D = None
        self.t: C = None
        self.v: B = None
        self.txt = txt

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

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

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

n.v = c
n.p = f
n.z = f
n.w = k
c.t = g
k.s = j
j.y = a
j.s = a
j.u = c
j.r = f
j.z = g
j.p = g
g.w = c
g.v = c
g.x = k
g.t = k
g.s = j
f.p = a
f.u = j
f.q = j
f.r = n
f.v = n
f.z = c
f.o = g
a.v = j
a.r = j
a.x = g
a.p = n
a.s = f
a.q = f
assert k.s.u.t.w.txt == "c"