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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: C = None
        self.v: G = None
        self.z: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: B = None
        self.x: G = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: E = None
        self.v: A = None
        self.r: A = None
        self.z: C = None
        self.t: D = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: C = None
        self.v: G = None
        self.z: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: B = None
        self.x: G = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: E = None
        self.v: A = None
        self.r: A = None
        self.z: C = None
        self.t: D = None
        self.y: A = None
        self.txt = txt

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

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