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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.v: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: G = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.v: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: G = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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