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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: I = None
        self.u: C = None
        self.p: H = None
        self.v: B = None
        self.w: I = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: J = None
        self.z: E = None
        self.p: I = None
        self.x: A = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: G = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: F = None
        self.u: F = None
        self.x: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: D = None
        self.w: G = None
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: I = None
        self.u: C = None
        self.p: H = None
        self.v: B = None
        self.w: I = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: J = None
        self.z: E = None
        self.p: I = None
        self.x: A = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: G = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: F = None
        self.u: F = None
        self.x: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: D = None
        self.w: G = None
        self.q: E = None
        self.txt = txt

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

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