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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: G = None
        self.v: G = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: B = None
        self.s: H = None
        self.y: D = None
        self.z: A = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: E = None
        self.x: A = None
        self.u: E = None
        self.s: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: G = None
        self.v: G = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: B = None
        self.s: H = None
        self.y: D = None
        self.z: A = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: E = None
        self.x: A = None
        self.u: E = None
        self.s: F = None
        self.txt = txt

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

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