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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: C = None
        self.v: G = None
        self.u: I = None
        self.r: I = None
        self.x: B = None
        self.t: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: C = None
        self.v: G = None
        self.u: I = None
        self.r: I = None
        self.x: B = None
        self.t: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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