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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: C = None
        self.o: E = None
        self.s: C = None
        self.txt = txt

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

a.r = b
a.y = i
a.o = c
e.y = f
e.w = n
e.p = n
e.o = n
m.y = i
n.t = g
n.v = m
i.r = e
g.v = c
k.r = b
k.y = m
k.s = m
k.o = i
f.y = e
f.w = n
f.p = n
f.o = n
b.r = k
b.y = m
b.s = m
b.o = i
c.r = k
c.y = i
c.o = a
assert m.y.r.y.w.v.y.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: E = None
        self.o: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: C = None
        self.o: E = None
        self.s: C = None
        self.txt = txt

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

a.r = b
a.y = i
a.o = c
e.y = f
e.w = n
e.p = n
e.o = n
m.y = i
n.t = g
n.v = m
i.r = e
g.v = c
k.r = b
k.y = m
k.s = m
k.o = i
f.y = e
f.w = n
f.p = n
f.o = n
b.r = k
b.y = m
b.s = m
b.o = i
c.r = k
c.y = i
c.o = a
assert m.y.r.y.w.v.y.r.p.txt == "n"