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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.s: G = None
        self.o: A = None
        self.x: G = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.u: A = None
        self.p: G = None
        self.v: E = None
        self.w: B = None
        self.y: I = None
        self.r: A = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.x: C = None
        self.v: B = None
        self.y: E = None
        self.w: D = None
        self.p: G = None
        self.z: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.s: G = None
        self.o: A = None
        self.x: G = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.u: A = None
        self.p: G = None
        self.v: E = None
        self.w: B = None
        self.y: I = None
        self.r: A = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.x: C = None
        self.v: B = None
        self.y: E = None
        self.w: D = None
        self.p: G = None
        self.z: G = None
        self.txt = txt

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

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

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