class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: E = None
        self.r: H = None
        self.z: H = None
        self.v: J = None
        self.w: H = None
        self.y: H = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: G = None
        self.v: H = None
        self.x: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: H = None
        self.o: J = None
        self.r: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: G = None
        self.u: A = None
        self.r: J = None
        self.z: A = None
        self.s: J = None
        self.t: A = None
        self.o: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: F = None
        self.s: A = None
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: G = None
        self.v: H = None
        self.x: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: H = None
        self.o: J = None
        self.r: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: G = None
        self.u: A = None
        self.r: J = None
        self.z: A = None
        self.s: J = None
        self.t: A = None
        self.o: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: F = None
        self.s: A = None
        self.y: B = None
        self.txt = txt

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

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