class A:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: C = None
        self.y: A = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: C = None
        self.y: A = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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