class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.x: D = None
        self.r: B = None
        self.o: C = None
        self.s: H = None
        self.t: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: F = None
        self.v: B = None
        self.q: I = None
        self.s: I = None
        self.x: A = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: H = None
        self.u: G = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: B = None
        self.q: I = None
        self.u: G = None
        self.y: F = None
        self.v: F = None
        self.z: B = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: D = None
        self.s: G = None
        self.w: C = None
        self.p: F = None
        self.q: I = None
        self.v: G = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: H = None
        self.v: F = None
        self.x: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: F = None
        self.v: B = None
        self.q: I = None
        self.s: I = None
        self.x: A = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: H = None
        self.u: G = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: B = None
        self.q: I = None
        self.u: G = None
        self.y: F = None
        self.v: F = None
        self.z: B = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: D = None
        self.s: G = None
        self.w: C = None
        self.p: F = None
        self.q: I = None
        self.v: G = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: H = None
        self.v: F = None
        self.x: H = None
        self.txt = txt

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

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