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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

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