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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: I = None
        self.o: H = None
        self.s: F = None
        self.w: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: I = None
        self.y: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: F = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: I = None
        self.o: H = None
        self.s: F = None
        self.w: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: I = None
        self.y: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: F = None
        self.t: B = None
        self.txt = txt

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

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