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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: I = None
        self.u: F = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: E = None
        self.s: F = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: H = None
        self.s: G = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: B = None
        self.r: C = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.x: H = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: I = None
        self.y: G = None
        self.w: D = None
        self.z: C = None
        self.r: D = None
        self.x: I = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: I = None
        self.u: F = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: E = None
        self.s: F = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: H = None
        self.s: G = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: B = None
        self.r: C = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.x: H = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: I = None
        self.y: G = None
        self.w: D = None
        self.z: C = None
        self.r: D = None
        self.x: I = None
        self.q: E = None
        self.txt = txt

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

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

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