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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: F = None
        self.o: C = None
        self.y: B = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: C = None
        self.r: B = None
        self.u: B = None
        self.w: F = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: B = None
        self.v: D = None
        self.p: D = None
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: F = None
        self.o: C = None
        self.y: B = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: C = None
        self.r: B = None
        self.u: B = None
        self.w: F = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: B = None
        self.v: D = None
        self.p: D = None
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

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

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