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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.z: D = None
        self.p: E = None
        self.q: D = None
        self.o: F = None
        self.t: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.z: D = None
        self.p: E = None
        self.q: D = None
        self.o: F = None
        self.t: D = None
        self.txt = txt

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

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