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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: B = None
        self.t: A = None
        self.y: C = None
        self.w: C = None
        self.txt = txt

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

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

i = A("i")
a = B("a")
e = C("e")
c = D("c")
k = E("k")
d = F("d")
n = G("n")

i.q = k
i.v = n
a.w = k
a.v = e
e.p = i
e.z = d
c.o = n
c.u = n
c.r = n
c.w = a
c.y = k
c.x = d
k.v = n
k.z = a
k.t = i
k.y = e
k.w = e
d.p = a
n.v = k
assert a.w.v.v.v.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: B = None
        self.t: A = None
        self.y: C = None
        self.w: C = None
        self.txt = txt

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

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

i = A("i")
a = B("a")
e = C("e")
c = D("c")
k = E("k")
d = F("d")
n = G("n")

i.q = k
i.v = n
a.w = k
a.v = e
e.p = i
e.z = d
c.o = n
c.u = n
c.r = n
c.w = a
c.y = k
c.x = d
k.v = n
k.z = a
k.t = i
k.y = e
k.w = e
d.p = a
n.v = k
assert a.w.v.v.v.v.w.txt == "e"