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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: B = None
        self.p: C = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: B = None
        self.p: C = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: G = None
        self.txt = txt

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

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

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