class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: G = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: F = None
        self.p: I = None
        self.s: F = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: H = None
        self.w: I = None
        self.t: D = None
        self.y: I = None
        self.p: H = None
        self.s: A = None
        self.o: C = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: F = None
        self.p: I = None
        self.s: F = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: H = None
        self.w: I = None
        self.t: D = None
        self.y: I = None
        self.p: H = None
        self.s: A = None
        self.o: C = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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