class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: G = None
        self.z: D = None
        self.w: C = None
        self.q: B = None
        self.r: G = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: F = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

a.v = g
a.o = b
a.r = b
a.z = k
a.w = n
a.q = f
a.s = f
f.z = a
n.o = b
n.q = e
n.z = a
n.r = g
k.s = n
k.o = n
k.z = b
k.p = a
k.u = a
g.u = a
g.s = n
e.z = f
b.y = a
assert n.z.q.z.z.s.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: G = None
        self.z: D = None
        self.w: C = None
        self.q: B = None
        self.r: G = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: F = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

a.v = g
a.o = b
a.r = b
a.z = k
a.w = n
a.q = f
a.s = f
f.z = a
n.o = b
n.q = e
n.z = a
n.r = g
k.s = n
k.o = n
k.z = b
k.p = a
k.u = a
g.u = a
g.s = n
e.z = f
b.y = a
assert n.z.q.z.z.s.o.y.txt == "a"