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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.p: F = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: D = None
        self.x: G = None
        self.q: F = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: B = None
        self.y: E = None
        self.x: D = None
        self.t: D = None
        self.txt = txt

e = A("e")
d = B("d")
h = C("h")
b = D("b")
m = E("m")
f = F("f")
k = G("k")
j = D("j")
a = A("a")

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.p: F = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: D = None
        self.x: G = None
        self.q: F = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: B = None
        self.y: E = None
        self.x: D = None
        self.t: D = None
        self.txt = txt

e = A("e")
d = B("d")
h = C("h")
b = D("b")
m = E("m")
f = F("f")
k = G("k")
j = D("j")
a = A("a")

e.w = a
d.r = k
d.p = f
d.q = j
h.v = d
h.r = m
h.p = f
h.y = e
b.r = f
b.q = f
b.s = f
b.o = j
b.x = k
m.w = e
m.z = f
m.t = f
m.o = h
f.w = m
f.s = j
f.p = d
f.v = d
f.o = a
k.q = f
k.s = d
k.y = m
k.x = b
k.t = b
j.r = f
j.q = f
j.s = f
j.o = b
j.x = k
a.w = e
assert m.w.w.w.w.w.w.w.txt == "e"