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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: D = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: E = None
        self.s: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: F = None
        self.s: H = None
        self.r: H = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: G = None
        self.r: D = None
        self.t: E = None
        self.x: A = None
        self.z: A = None
        self.txt = txt

h = A("h")
f = B("f")
j = C("j")
a = D("a")
i = E("i")
e = F("e")
g = G("g")
k = H("k")

h.z = g
f.y = g
f.q = a
f.z = h
j.x = k
j.t = i
j.s = h
a.q = j
a.v = j
i.s = g
i.y = g
i.z = a
i.v = k
e.r = g
e.y = f
g.x = a
g.t = e
g.v = e
g.s = k
g.r = k
k.u = f
k.q = g
k.r = a
k.t = i
k.x = h
k.z = h
assert f.q.v.x.q.t.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: D = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: E = None
        self.s: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: F = None
        self.s: H = None
        self.r: H = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: G = None
        self.r: D = None
        self.t: E = None
        self.x: A = None
        self.z: A = None
        self.txt = txt

h = A("h")
f = B("f")
j = C("j")
a = D("a")
i = E("i")
e = F("e")
g = G("g")
k = H("k")

h.z = g
f.y = g
f.q = a
f.z = h
j.x = k
j.t = i
j.s = h
a.q = j
a.v = j
i.s = g
i.y = g
i.z = a
i.v = k
e.r = g
e.y = f
g.x = a
g.t = e
g.v = e
g.s = k
g.r = k
k.u = f
k.q = g
k.r = a
k.t = i
k.x = h
k.z = h
assert f.q.v.x.q.t.y.z.txt == "h"