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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: D = None
        self.s: D = None
        self.u: I = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: I = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: H = None
        self.u: A = None
        self.s: A = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: G = None
        self.r: B = None
        self.v: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: F = None
        self.o: D = None
        self.q: G = None
        self.p: F = None
        self.r: F = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: E = None
        self.x: G = None
        self.u: H = None
        self.t: A = None
        self.s: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: D = None
        self.s: D = None
        self.u: I = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: I = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: H = None
        self.u: A = None
        self.s: A = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: G = None
        self.r: B = None
        self.v: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: F = None
        self.o: D = None
        self.q: G = None
        self.p: F = None
        self.r: F = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: E = None
        self.x: G = None
        self.u: H = None
        self.t: A = None
        self.s: D = None
        self.txt = txt

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

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