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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: F = None
        self.o: F = None
        self.z: J = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.v: D = None
        self.w: B = None
        self.t: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: F = None
        self.o: F = None
        self.z: J = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.v: D = None
        self.w: B = None
        self.t: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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