
def triangle?(a, b, c)
  a <= b + c && b <= c + a && c <= a + b
end

def valid?(a, b, c)
  triangle?(a, b, c) || triangle?(a + 1, b, c)
end

def calc(rear, front, west, east, north, south, best)
  path = ''
  loop do
    #return best if best && best < path
    x = best ? best[path.size] : 'Z'

    a = rear + front
    b = west + east
    c = north + south

    return path if a + b + c == 0

    if east > 0 && valid?(b - 1, c, a)
      return best if x < 'E'
      best = nil if x > 'E'
      rear, front, west, east = east - 1, west, rear, front
      path << 'E'
      next
    end
    if north > 0 && valid?(c - 1, a, b)
      return best if x < 'N'
      best = nil if x > 'N'
      rear, front, north, south = north - 1, south, front, rear
      path << 'N'
      next
    end
    if south > 0 && valid?(c - 1, a, b)
      return best if x < 'S'
      best = nil if x > 'S'
      rear, front, north, south = south - 1, north, rear, front
      path << 'S'
      next
    end
    if west > 0 && valid?(b - 1, c, a)
      return best if x < 'W'
      best = nil if x > 'W'
      rear, front, west, east = west - 1, east, front, rear
      path << 'W'
      next
    end

    throw 'error'
  end
end

def find(target)
  best = nil
  target.permutation(6).uniq.each do |rear, front, west, east, north, south|
    a = rear + front
    b = west + east
    c = north + south
    if valid?(a, b, c)
      best = calc(rear, front, west, east, north, south, best)
    end
  end
  best
end

loop do
  target = STDIN.gets.split.map!(&:to_i)
  break if target.max == 0
  p, q = STDIN.gets.split.map!(&:to_i)
  result = find(target)
  puts result ? result[p-1...q] : 'impossible'
end