class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: H = None
        self.s: H = None
        self.v: D = None
        self.o: F = None
        self.y: I = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: H = None
        self.z: A = None
        self.o: I = None
        self.w: G = None
        self.y: H = None
        self.x: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: I = None
        self.o: A = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.o: E = None
        self.p: A = None
        self.v: C = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: D = None
        self.v: A = None
        self.w: F = None
        self.y: I = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: H = None
        self.z: A = None
        self.o: I = None
        self.w: G = None
        self.y: H = None
        self.x: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: I = None
        self.o: A = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.o: E = None
        self.p: A = None
        self.v: C = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: D = None
        self.v: A = None
        self.w: F = None
        self.y: I = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.v: C = None
        self.txt = txt

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

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