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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: G = None
        self.w: I = None
        self.v: E = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: E = None
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: G = None
        self.w: I = None
        self.v: E = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: E = None
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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