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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.q: I = None
        self.r: C = None
        self.v: A = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: B = None
        self.x: D = None
        self.r: E = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: I = None
        self.s: F = None
        self.v: A = None
        self.t: I = None
        self.q: I = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.q: I = None
        self.r: C = None
        self.v: A = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: B = None
        self.x: D = None
        self.r: E = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: I = None
        self.s: F = None
        self.v: A = None
        self.t: I = None
        self.q: I = None
        self.u: F = None
        self.txt = txt

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

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

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

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