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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: D = None
        self.s: H = None
        self.v: A = None
        self.q: G = None
        self.z: A = None
        self.w: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: J = None
        self.q: I = None
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: J = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: I = None
        self.w: C = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: H = None
        self.z: H = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: D = None
        self.s: H = None
        self.v: A = None
        self.q: G = None
        self.z: A = None
        self.w: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: J = None
        self.q: I = None
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: J = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: I = None
        self.w: C = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: H = None
        self.z: H = None
        self.r: B = None
        self.txt = txt

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

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