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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: C = None
        self.y: F = None
        self.z: G = None
        self.r: B = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: A = None
        self.r: E = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: A = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

g = A("g")
d = B("d")
j = C("j")
b = D("b")
m = E("m")
e = F("e")
f = G("f")
l = A("l")
n = B("n")

g.v = n
g.w = n
d.z = f
d.y = g
d.s = g
d.v = n
j.u = b
j.s = f
j.x = f
j.w = f
b.t = e
b.y = e
b.x = j
b.z = f
b.r = d
b.u = n
m.v = e
m.t = e
m.y = d
m.o = d
m.u = d
e.y = b
e.s = l
e.r = m
e.t = j
f.w = g
f.u = l
f.v = e
f.t = n
l.v = d
l.w = n
n.z = f
n.y = g
n.v = d
n.s = l
assert f.t.v.z.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: C = None
        self.y: F = None
        self.z: G = None
        self.r: B = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: A = None
        self.r: E = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: A = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

g = A("g")
d = B("d")
j = C("j")
b = D("b")
m = E("m")
e = F("e")
f = G("f")
l = A("l")
n = B("n")

g.v = n
g.w = n
d.z = f
d.y = g
d.s = g
d.v = n
j.u = b
j.s = f
j.x = f
j.w = f
b.t = e
b.y = e
b.x = j
b.z = f
b.r = d
b.u = n
m.v = e
m.t = e
m.y = d
m.o = d
m.u = d
e.y = b
e.s = l
e.r = m
e.t = j
f.w = g
f.u = l
f.v = e
f.t = n
l.v = d
l.w = n
n.z = f
n.y = g
n.v = d
n.s = l
assert f.t.v.z.w.v.txt == "n"