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

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

class C:
    def __init__(self, txt: str):
        self.v: J = None
        self.p: F = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: J = None
        self.s: G = None
        self.y: F = None
        self.w: B = None
        self.z: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: J = None
        self.p: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: C = None
        self.o: C = None
        self.u: B = None
        self.r: B = None
        self.s: E = None
        self.txt = txt

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

j = A("j")
e = B("e")
g = C("g")
h = D("h")
l = E("l")
n = F("n")
b = G("b")
d = H("d")
c = I("c")
k = J("k")

j.w = e
e.w = l
e.x = n
e.o = d
g.v = k
g.p = n
g.q = d
h.p = l
l.o = k
l.x = k
l.s = b
l.y = n
l.w = e
l.z = c
n.t = b
n.q = k
n.v = k
n.r = d
b.r = c
b.y = k
d.q = b
d.y = k
d.p = k
c.x = h
c.z = g
c.o = g
c.u = e
c.r = e
c.s = l
k.p = c
k.x = h
k.q = h
k.o = g
k.t = n
k.w = l
k.u = j
k.z = d
assert c.s.x.u.w.o.q.y.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: J = None
        self.p: F = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: J = None
        self.s: G = None
        self.y: F = None
        self.w: B = None
        self.z: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: J = None
        self.p: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: C = None
        self.o: C = None
        self.u: B = None
        self.r: B = None
        self.s: E = None
        self.txt = txt

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

j = A("j")
e = B("e")
g = C("g")
h = D("h")
l = E("l")
n = F("n")
b = G("b")
d = H("d")
c = I("c")
k = J("k")

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