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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: C = None
        self.y: F = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.r: B = None
        self.o: D = None
        self.y: C = None
        self.q: C = None
        self.t: D = None
        self.x: D = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: B = None
        self.w: D = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: C = None
        self.y: F = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.r: B = None
        self.o: D = None
        self.y: C = None
        self.q: C = None
        self.t: D = None
        self.x: D = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: B = None
        self.w: D = None
        self.q: F = None
        self.txt = txt

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

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