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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.p: D = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: A = None
        self.t: C = None
        self.w: C = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.p: D = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: A = None
        self.t: C = None
        self.w: C = None
        self.v: G = None
        self.txt = txt

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

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

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

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