class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: G = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: I = None
        self.w: C = None
        self.v: F = None
        self.o: G = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: D = None
        self.r: F = None
        self.u: E = None
        self.p: B = None
        self.t: I = None
        self.y: H = None
        self.w: D = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: H = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: I = None
        self.w: C = None
        self.v: F = None
        self.o: G = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: D = None
        self.r: F = None
        self.u: E = None
        self.p: B = None
        self.t: I = None
        self.y: H = None
        self.w: D = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: H = None
        self.p: C = None
        self.txt = txt

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

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