class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: G = None
        self.t: D = None
        self.s: D = None
        self.y: C = None
        self.q: D = None
        self.u: E = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: B = None
        self.v: F = None
        self.q: C = None
        self.x: G = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: B = None
        self.s: A = None
        self.u: F = None
        self.w: E = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: H = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: D = None
        self.v: F = None
        self.s: D = None
        self.w: F = None
        self.txt = txt

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

j = A("j")
k = B("k")
l = C("l")
i = D("i")
m = E("m")
h = F("h")
a = G("a")
d = H("d")
n = B("n")
e = B("e")

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: B = None
        self.v: F = None
        self.q: C = None
        self.x: G = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: B = None
        self.s: A = None
        self.u: F = None
        self.w: E = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: H = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: D = None
        self.v: F = None
        self.s: D = None
        self.w: F = None
        self.txt = txt

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

j = A("j")
k = B("k")
l = C("l")
i = D("i")
m = E("m")
h = F("h")
a = G("a")
d = H("d")
n = B("n")
e = B("e")

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