class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: B = None
        self.o: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: I = None
        self.o: D = None
        self.w: I = None
        self.v: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: E = None
        self.u: B = None
        self.o: D = None
        self.w: B = None
        self.q: A = None
        self.p: F = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: A = None
        self.w: H = None
        self.p: H = None
        self.txt = txt

a = A("a")
g = B("g")
d = C("d")
f = D("f")
j = E("j")
b = F("b")
n = G("n")
l = H("l")
k = I("k")
e = B("e")

a.v = j
a.x = g
a.o = l
g.v = d
g.x = f
g.q = e
g.w = l
d.z = k
f.y = a
j.q = n
j.r = k
j.w = k
j.o = f
j.v = l
b.v = a
b.w = d
n.x = b
n.p = b
n.y = j
n.s = j
n.u = e
n.w = e
n.o = f
n.q = a
l.u = n
l.v = n
l.p = e
l.w = b
l.t = k
l.s = d
k.z = j
k.t = a
k.w = l
k.p = l
e.v = d
e.x = f
e.q = g
e.w = l
assert g.w.s.z.z.r.w.w.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: B = None
        self.o: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: I = None
        self.o: D = None
        self.w: I = None
        self.v: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: E = None
        self.u: B = None
        self.o: D = None
        self.w: B = None
        self.q: A = None
        self.p: F = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: A = None
        self.w: H = None
        self.p: H = None
        self.txt = txt

a = A("a")
g = B("g")
d = C("d")
f = D("f")
j = E("j")
b = F("b")
n = G("n")
l = H("l")
k = I("k")
e = B("e")

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