class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: I = None
        self.t: I = None
        self.r: A = None
        self.v: I = None
        self.q: C = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: H = None
        self.y: B = None
        self.x: B = None
        self.w: G = None
        self.z: G = None
        self.v: H = None
        self.r: D = None
        self.q: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: G = None
        self.o: H = None
        self.x: D = None
        self.u: E = None
        self.v: A = None
        self.y: B = None
        self.q: C = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: E = None
        self.y: C = None
        self.r: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: I = None
        self.t: I = None
        self.r: A = None
        self.v: I = None
        self.q: C = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: H = None
        self.y: B = None
        self.x: B = None
        self.w: G = None
        self.z: G = None
        self.v: H = None
        self.r: D = None
        self.q: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: G = None
        self.o: H = None
        self.x: D = None
        self.u: E = None
        self.v: A = None
        self.y: B = None
        self.q: C = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: E = None
        self.y: C = None
        self.r: E = None
        self.txt = txt

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

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