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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: I = None
        self.q: B = None
        self.p: D = None
        self.s: H = None
        self.t: G = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: F = None
        self.v: F = None
        self.y: I = None
        self.t: F = None
        self.x: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: I = None
        self.q: B = None
        self.p: D = None
        self.s: H = None
        self.t: G = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: F = None
        self.v: F = None
        self.y: I = None
        self.t: F = None
        self.x: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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