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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: H = None
        self.u: E = None
        self.r: H = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: F = None
        self.y: C = None
        self.z: J = None
        self.u: I = None
        self.r: J = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: B = None
        self.q: D = None
        self.w: B = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: F = None
        self.y: D = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: H = None
        self.u: E = None
        self.r: H = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: F = None
        self.y: C = None
        self.z: J = None
        self.u: I = None
        self.r: J = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: B = None
        self.q: D = None
        self.w: B = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: F = None
        self.y: D = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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