class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

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