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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: I = None
        self.s: F = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: I = None
        self.y: G = None
        self.s: H = None
        self.v: B = 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.w: G = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: B = None
        self.s: E = None
        self.x: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.o: B = None
        self.w: E = None
        self.t: A = None
        self.v: G = None
        self.y: D = None
        self.z: B = None
        self.s: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: I = None
        self.s: F = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: I = None
        self.y: G = None
        self.s: H = None
        self.v: B = 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.w: G = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: B = None
        self.s: E = None
        self.x: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.o: B = None
        self.w: E = None
        self.t: A = None
        self.v: G = None
        self.y: D = None
        self.z: B = None
        self.s: F = None
        self.p: D = None
        self.txt = txt

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

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