class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: B = None
        self.x: F = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: D = None
        self.p: D = None
        self.z: B = None
        self.u: D = None
        self.s: A = None
        self.txt = txt

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

a.v = d
a.s = d
a.z = n
a.x = m
n.w = m
n.t = m
n.o = d
i.t = n
f.v = m
f.t = i
h.z = d
h.x = i
m.s = h
m.q = i
m.w = f
m.u = d
m.x = a
m.y = n
d.y = m
d.x = f
d.p = f
d.u = f
d.z = n
d.s = a
k.z = d
k.x = i
assert m.w.t.t.o.s.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: B = None
        self.x: F = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: D = None
        self.p: D = None
        self.z: B = None
        self.u: D = None
        self.s: A = None
        self.txt = txt

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

a.v = d
a.s = d
a.z = n
a.x = m
n.w = m
n.t = m
n.o = d
i.t = n
f.v = m
f.t = i
h.z = d
h.x = i
m.s = h
m.q = i
m.w = f
m.u = d
m.x = a
m.y = n
d.y = m
d.x = f
d.p = f
d.u = f
d.z = n
d.s = a
k.z = d
k.x = i
assert m.w.t.t.o.s.v.z.txt == "n"