class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: B = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: E = None
        self.p: B = None
        self.z: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: C = None
        self.q: F = None
        self.u: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: E = None
        self.p: B = None
        self.z: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: C = None
        self.q: F = None
        self.u: B = None
        self.txt = txt

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

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