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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: G = None
        self.x: A = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: B = None
        self.z: I = None
        self.t: I = None
        self.s: I = None
        self.y: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: D = None
        self.y: B = None
        self.r: B = None
        self.p: C = None
        self.u: I = None
        self.z: C = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: I = None
        self.z: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: G = None
        self.x: A = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: B = None
        self.z: I = None
        self.t: I = None
        self.s: I = None
        self.y: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: D = None
        self.y: B = None
        self.r: B = None
        self.p: C = None
        self.u: I = None
        self.z: C = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: I = None
        self.z: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: G = None
        self.txt = txt

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

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