class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: G = None
        self.z: F = None
        self.r: I = None
        self.q: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: D = None
        self.r: D = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: G = None
        self.v: G = None
        self.z: C = None
        self.p: I = None
        self.r: C = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: F = None
        self.r: D = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: C = None
        self.o: D = None
        self.r: B = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: D = None
        self.r: D = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: G = None
        self.v: G = None
        self.z: C = None
        self.p: I = None
        self.r: C = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: F = None
        self.r: D = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: C = None
        self.o: D = None
        self.r: B = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: E = None
        self.txt = txt

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

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