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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

a.v = f
a.p = l
a.r = e
a.y = m
f.y = k
f.v = h
f.u = h
f.o = l
f.t = m
f.x = e
h.p = e
h.z = n
n.y = l
n.x = h
n.w = h
l.o = n
l.r = n
k.r = m
k.p = l
k.z = h
k.t = f
k.w = n
e.u = l
e.t = n
e.o = k
e.r = f
e.v = h
m.v = f
m.p = l
m.r = e
m.y = a
assert n.w.z.x.p.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: E = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

a.v = f
a.p = l
a.r = e
a.y = m
f.y = k
f.v = h
f.u = h
f.o = l
f.t = m
f.x = e
h.p = e
h.z = n
n.y = l
n.x = h
n.w = h
l.o = n
l.r = n
k.r = m
k.p = l
k.z = h
k.t = f
k.w = n
e.u = l
e.t = n
e.o = k
e.r = f
e.v = h
m.v = f
m.p = l
m.r = e
m.y = a
assert n.w.z.x.p.v.z.txt == "n"