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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: B = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: F = None
        self.t: D = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: B = None
        self.p: A = None
        self.x: H = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: B = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: F = None
        self.t: D = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: B = None
        self.p: A = None
        self.x: H = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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