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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: C = None
        self.v: G = None
        self.u: D = None
        self.s: G = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: C = None
        self.v: G = None
        self.u: D = None
        self.s: G = None
        self.p: B = None
        self.txt = txt

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

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

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

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