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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: F = None
        self.w: C = None
        self.x: A = None
        self.z: F = None
        self.p: F = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: H = None
        self.q: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: F = None
        self.w: C = None
        self.x: A = None
        self.z: F = None
        self.p: F = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: H = None
        self.q: E = None
        self.txt = txt

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

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

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