class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: H = None
        self.v: F = None
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: H = None
        self.w: E = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: F = None
        self.t: B = None
        self.u: A = None
        self.z: H = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: H = None
        self.v: H = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: E = None
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: H = None
        self.w: E = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: F = None
        self.t: B = None
        self.u: A = None
        self.z: H = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: H = None
        self.v: H = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: E = None
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

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

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