class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: D = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: G = None
        self.r: A = None
        self.p: G = None
        self.s: H = None
        self.o: A = None
        self.y: C = None
        self.z: B = None
        self.x: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: G = None
        self.r: A = None
        self.p: G = None
        self.s: H = None
        self.o: A = None
        self.y: C = None
        self.z: B = None
        self.x: F = None
        self.txt = txt

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

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