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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: C = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: G = None
        self.u: E = None
        self.q: E = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: H = None
        self.w: F = None
        self.t: H = None
        self.p: A = None
        self.z: C = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: B = None
        self.r: H = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: E = None
        self.y: D = None
        self.u: D = None
        self.v: E = None
        self.s: B = None
        self.t: A = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: D = None
        self.u: G = None
        self.z: F = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: C = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: G = None
        self.u: E = None
        self.q: E = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: H = None
        self.w: F = None
        self.t: H = None
        self.p: A = None
        self.z: C = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: B = None
        self.r: H = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: E = None
        self.y: D = None
        self.u: D = None
        self.v: E = None
        self.s: B = None
        self.t: A = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: D = None
        self.u: G = None
        self.z: F = None
        self.o: A = None
        self.txt = txt

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

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