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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

j.w = n
j.x = n
j.r = h
j.z = i
k.s = g
a.w = k
a.y = k
i.r = j
i.q = n
n.r = g
n.y = g
l.s = a
h.w = n
h.x = n
h.r = j
h.z = i
g.w = l
g.y = m
m.s = g
c.w = n
c.x = n
c.r = h
c.z = i
assert j.r.x.y.w.s.y.s.w.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: A = None
        self.z: D = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

j.w = n
j.x = n
j.r = h
j.z = i
k.s = g
a.w = k
a.y = k
i.r = j
i.q = n
n.r = g
n.y = g
l.s = a
h.w = n
h.x = n
h.r = j
h.z = i
g.w = l
g.y = m
m.s = g
c.w = n
c.x = n
c.r = h
c.z = i
assert j.r.x.y.w.s.y.s.w.s.w.txt == "k"