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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: G = None
        self.v: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: G = None
        self.p: A = None
        self.u: A = None
        self.y: G = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: E = None
        self.u: C = None
        self.w: F = None
        self.r: F = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: G = None
        self.v: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: G = None
        self.p: A = None
        self.u: A = None
        self.y: G = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: E = None
        self.u: C = None
        self.w: F = None
        self.r: F = None
        self.x: B = None
        self.txt = txt

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

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