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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: A = None
        self.s: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: A = None
        self.w: I = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: E = None
        self.v: D = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: E = None
        self.z: G = None
        self.x: G = None
        self.u: A = None
        self.t: G = None
        self.r: G = None
        self.s: E = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: A = None
        self.s: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: A = None
        self.w: I = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: E = None
        self.v: D = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: E = None
        self.z: G = None
        self.x: G = None
        self.u: A = None
        self.t: G = None
        self.r: G = None
        self.s: E = None
        self.v: B = None
        self.txt = txt

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

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