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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: F = None
        self.s: H = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: D = None
        self.x: E = None
        self.v: C = None
        self.q: H = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.w: I = None
        self.z: F = None
        self.y: G = None
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: F = None
        self.s: H = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: D = None
        self.x: E = None
        self.v: C = None
        self.q: H = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.w: I = None
        self.z: F = None
        self.y: G = None
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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