class A:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: D = None
        self.t: E = None
        self.r: E = None
        self.z: F = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: G = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: E = None
        self.p: G = None
        self.v: F = None
        self.u: A = None
        self.w: E = None
        self.x: A = None
        self.y: H = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: H = None
        self.w: I = None
        self.q: F = None
        self.t: H = None
        self.o: H = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: F = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: H = None
        self.y: G = None
        self.w: G = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: G = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: E = None
        self.p: G = None
        self.v: F = None
        self.u: A = None
        self.w: E = None
        self.x: A = None
        self.y: H = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: H = None
        self.w: I = None
        self.q: F = None
        self.t: H = None
        self.o: H = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: F = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: H = None
        self.y: G = None
        self.w: G = None
        self.p: B = None
        self.txt = txt

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

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