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

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

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

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

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

l = A("l")
n = B("n")
i = C("i")
g = D("g")
b = E("b")
j = A("j")
a = C("a")
h = C("h")

l.s = b
n.t = j
i.z = g
i.p = g
i.r = h
i.s = b
g.x = b
g.y = b
g.p = h
b.s = g
b.w = j
j.s = b
a.z = g
a.p = g
a.r = i
a.s = b
h.z = g
h.p = g
h.r = i
h.s = b
assert a.z.p.s.w.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

l = A("l")
n = B("n")
i = C("i")
g = D("g")
b = E("b")
j = A("j")
a = C("a")
h = C("h")

l.s = b
n.t = j
i.z = g
i.p = g
i.r = h
i.s = b
g.x = b
g.y = b
g.p = h
b.s = g
b.w = j
j.s = b
a.z = g
a.p = g
a.r = i
a.s = b
h.z = g
h.p = g
h.r = i
h.s = b
assert a.z.p.s.w.s.w.txt == "j"