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

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

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: D = None
        self.y: H = None
        self.x: B = None
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: F = None
        self.o: B = None
        self.r: F = None
        self.q: B = None
        self.p: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: E = None
        self.x: G = None
        self.o: E = None
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.o: H = None
        self.u: A = None
        self.w: C = None
        self.t: H = None
        self.s: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: D = None
        self.y: H = None
        self.x: B = None
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: F = None
        self.o: B = None
        self.r: F = None
        self.q: B = None
        self.p: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: E = None
        self.x: G = None
        self.o: E = None
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.o: H = None
        self.u: A = None
        self.w: C = None
        self.t: H = None
        self.s: A = None
        self.txt = txt

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

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