class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.r: B = None
        self.w: C = None
        self.t: B = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.r: B = None
        self.w: C = None
        self.t: B = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.o: A = None
        self.txt = txt

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

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

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