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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: E = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: E = None
        self.x: A = None
        self.txt = txt

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

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

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

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

g.y = c
g.s = b
k.s = c
k.v = e
k.x = i
l.w = b
c.s = k
c.r = k
c.u = i
c.o = i
e.w = b
m.w = e
i.y = h
i.s = b
b.w = e
d.y = h
d.s = b
h.s = k
h.r = k
h.u = g
h.o = i
assert g.s.w.w.w.w.w.w.txt == "b"