class A:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: B = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: C = None
        self.s: C = None
        self.q: E = None
        self.t: I = None
        self.v: C = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: F = None
        self.r: D = None
        self.y: G = None
        self.w: H = None
        self.x: G = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: E = None
        self.v: B = None
        self.q: G = None
        self.o: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: C = None
        self.x: F = None
        self.o: A = None
        self.u: I = None
        self.s: H = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: J = None
        self.t: A = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: I = None
        self.v: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: A = None
        self.o: G = None
        self.p: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: A = None
        self.q: F = None
        self.o: E = None
        self.s: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: C = None
        self.s: C = None
        self.q: E = None
        self.t: I = None
        self.v: C = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: F = None
        self.r: D = None
        self.y: G = None
        self.w: H = None
        self.x: G = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: E = None
        self.v: B = None
        self.q: G = None
        self.o: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: C = None
        self.x: F = None
        self.o: A = None
        self.u: I = None
        self.s: H = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: J = None
        self.t: A = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: I = None
        self.v: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: A = None
        self.o: G = None
        self.p: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: A = None
        self.q: F = None
        self.o: E = None
        self.s: F = None
        self.txt = txt

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

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