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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: A = None
        self.v: C = None
        self.z: C = None
        self.u: B = None
        self.y: H = None
        self.x: F = None
        self.p: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: F = None
        self.w: A = None
        self.r: A = None
        self.x: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: A = None
        self.v: C = None
        self.z: C = None
        self.u: B = None
        self.y: H = None
        self.x: F = None
        self.p: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: F = None
        self.w: A = None
        self.r: A = None
        self.x: I = None
        self.txt = txt

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

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

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