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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: G = None
        self.y: C = None
        self.v: A = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: G = None
        self.x: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: F = None
        self.txt = txt

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

g.p = f
g.v = f
l.s = a
l.o = d
l.y = n
l.v = g
l.q = i
n.v = f
n.u = d
n.x = d
k.q = j
k.y = l
k.w = l
k.u = g
k.x = e
f.z = g
a.v = i
d.w = n
d.z = j
i.v = a
j.v = a
e.w = n
e.z = a
assert d.z.v.v.v.v.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: G = None
        self.y: C = None
        self.v: A = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: G = None
        self.x: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: F = None
        self.txt = txt

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

g.p = f
g.v = f
l.s = a
l.o = d
l.y = n
l.v = g
l.q = i
n.v = f
n.u = d
n.x = d
k.q = j
k.y = l
k.w = l
k.u = g
k.x = e
f.z = g
a.v = i
d.w = n
d.z = j
i.v = a
j.v = a
e.w = n
e.z = a
assert d.z.v.v.v.v.v.v.v.v.v.txt == "a"