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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: H = None
        self.z: B = None
        self.u: E = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: G = None
        self.z: A = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: H = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: A = None
        self.z: B = None
        self.t: I = None
        self.u: H = None
        self.o: F = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: F = None
        self.r: H = None
        self.t: G = None
        self.x: A = None
        self.y: G = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: H = None
        self.z: B = None
        self.u: E = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: G = None
        self.z: A = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: H = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: A = None
        self.z: B = None
        self.t: I = None
        self.u: H = None
        self.o: F = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: F = None
        self.r: H = None
        self.t: G = None
        self.x: A = None
        self.y: G = None
        self.q: C = None
        self.txt = txt

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

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