class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: I = None
        self.r: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: H = None
        self.q: H = None
        self.y: D = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: H = None
        self.s: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: C = None
        self.q: G = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: H = None
        self.q: H = None
        self.y: D = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: H = None
        self.s: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: C = None
        self.q: G = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: H = None
        self.txt = txt

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

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