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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.q: I = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.v: G = None
        self.z: H = None
        self.w: H = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: C = None
        self.y: I = None
        self.r: B = None
        self.z: J = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: F = None
        self.t: E = None
        self.z: G = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: H = None
        self.v: F = None
        self.o: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: D = None
        self.v: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.q: I = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.v: G = None
        self.z: H = None
        self.w: H = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: C = None
        self.y: I = None
        self.r: B = None
        self.z: J = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: F = None
        self.t: E = None
        self.z: G = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: H = None
        self.v: F = None
        self.o: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: D = None
        self.v: G = None
        self.txt = txt

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

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