class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.t: I = None
        self.q: I = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.t: I = None
        self.q: I = None
        self.txt = txt

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

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

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

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

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

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

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

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

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