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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: A = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: A = None
        self.y: A = None
        self.r: D = None
        self.t: D = None
        self.o: B = None
        self.txt = txt

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

k = A("k")
f = B("f")
i = C("i")
h = D("h")
m = E("m")
n = F("n")
a = G("a")
e = C("e")
g = D("g")

k.v = n
k.z = e
f.t = m
f.o = h
f.p = h
f.x = n
f.w = a
i.p = f
i.w = a
h.y = e
h.x = e
h.o = k
h.z = n
m.t = a
m.q = i
m.u = h
n.x = k
n.q = k
n.y = k
n.r = g
n.t = h
n.o = f
a.v = k
a.q = h
a.u = h
a.x = n
e.p = f
e.w = a
g.y = e
g.o = k
g.z = n
g.x = i
assert k.z.w.v.v.x.v.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: A = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: A = None
        self.y: A = None
        self.r: D = None
        self.t: D = None
        self.o: B = None
        self.txt = txt

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

k = A("k")
f = B("f")
i = C("i")
h = D("h")
m = E("m")
n = F("n")
a = G("a")
e = C("e")
g = D("g")

k.v = n
k.z = e
f.t = m
f.o = h
f.p = h
f.x = n
f.w = a
i.p = f
i.w = a
h.y = e
h.x = e
h.o = k
h.z = n
m.t = a
m.q = i
m.u = h
n.x = k
n.q = k
n.y = k
n.r = g
n.t = h
n.o = f
a.v = k
a.q = h
a.u = h
a.x = n
e.p = f
e.w = a
g.y = e
g.o = k
g.z = n
g.x = i
assert k.z.w.v.v.x.v.q.z.txt == "e"