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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.s: G = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.s: G = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: A = None
        self.txt = txt

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

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

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