class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.w: A = None
        self.t: G = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.s: E = None
        self.z: C = None
        self.w: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: A = None
        self.r: H = None
        self.t: G = None
        self.o: A = None
        self.s: I = None
        self.y: F = None
        self.u: F = None
        self.v: I = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.w: A = None
        self.t: G = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.s: E = None
        self.z: C = None
        self.w: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: A = None
        self.r: H = None
        self.t: G = None
        self.o: A = None
        self.s: I = None
        self.y: F = None
        self.u: F = None
        self.v: I = None
        self.p: C = None
        self.txt = txt

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

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