class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: F = None
        self.u: C = None
        self.p: F = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: B = None
        self.v: F = None
        self.y: C = None
        self.x: E = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: B = None
        self.v: F = None
        self.y: C = None
        self.x: E = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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