class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: E = None
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: A = None
        self.s: G = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: C = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: A = None
        self.s: G = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: C = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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