class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: C = None
        self.y: G = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

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

a.v = e
a.s = e
a.t = k
a.y = n
m.y = a
m.w = h
m.s = n
k.w = a
d.r = n
d.z = k
d.w = k
d.u = m
d.s = a
h.s = m
h.u = d
h.y = d
h.z = a
e.t = k
e.y = n
n.u = k
n.p = a
n.y = m
assert h.y.r.u.w.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: C = None
        self.y: G = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

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

a.v = e
a.s = e
a.t = k
a.y = n
m.y = a
m.w = h
m.s = n
k.w = a
d.r = n
d.z = k
d.w = k
d.u = m
d.s = a
h.s = m
h.u = d
h.y = d
h.z = a
e.t = k
e.y = n
n.u = k
n.p = a
n.y = m
assert h.y.r.u.w.t.w.txt == "a"