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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

e.w = k
e.o = d
e.v = m
m.s = n
m.z = h
m.q = j
j.v = n
j.y = k
j.r = k
j.p = k
j.z = k
j.t = d
j.w = e
h.y = m
h.v = m
d.x = h
d.y = e
d.t = k
n.z = m
n.y = h
n.x = d
k.x = m
k.p = e
assert n.x.x.v.txt == "m"