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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.w: F = None
        self.t: B = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: C = None
        self.z: C = None
        self.x: A = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: H = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.w: F = None
        self.t: B = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: C = None
        self.z: C = None
        self.x: A = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: H = None
        self.s: H = None
        self.txt = txt

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

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

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

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