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

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

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

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

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

c = A("c")
k = B("k")
l = C("l")
i = D("i")
b = E("b")
f = A("f")
h = C("h")
n = D("n")
e = E("e")
d = C("d")

c.w = f
k.w = n
l.s = e
l.r = c
l.w = h
l.x = i
l.y = n
i.v = h
i.z = e
b.w = c
b.p = h
b.x = i
b.u = d
f.w = c
h.s = e
h.r = f
h.w = d
h.x = n
h.y = n
n.v = h
n.z = e
e.w = f
e.p = h
e.u = h
e.x = n
d.s = b
d.r = f
d.w = l
d.x = i
d.y = n
assert d.w.s.w.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

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

c = A("c")
k = B("k")
l = C("l")
i = D("i")
b = E("b")
f = A("f")
h = C("h")
n = D("n")
e = E("e")
d = C("d")

c.w = f
k.w = n
l.s = e
l.r = c
l.w = h
l.x = i
l.y = n
i.v = h
i.z = e
b.w = c
b.p = h
b.x = i
b.u = d
f.w = c
h.s = e
h.r = f
h.w = d
h.x = n
h.y = n
n.v = h
n.z = e
e.w = f
e.p = h
e.u = h
e.x = n
d.s = b
d.r = f
d.w = l
d.x = i
d.y = n
assert d.w.s.w.w.w.w.w.w.txt == "c"