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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.q: A = None
        self.p: C = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: G = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: B = None
        self.s: G = None
        self.o: D = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: F = None
        self.y: D = None
        self.o: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.q: A = None
        self.p: C = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: G = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: B = None
        self.s: G = None
        self.o: D = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: F = None
        self.y: D = None
        self.o: B = None
        self.w: E = None
        self.txt = txt

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

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