[Question]
  [
Given a string that is one of the directions on a 16-point compass rose
[![16-point compass rose](https://i.stack.imgur.com/hPCWAm.png)](https://en.wikipedia.org/wiki/Points_of_the_compass#/media/File:Compass_Rose_English_North.svg)
output the two directions that are immediately adjacent to the input direction, in clockwise order.
Specifically, you need to handle these (and only these) input/output pairs:
```
Input  Output
N      NNW NNE
NNE    N NE
NE     NNE ENE
ENE    NE E
E      ENE ESE
ESE    E SE
SE     ESE SSE
SSE    SE S
S      SSE SSW
SSW    S SW
SW     SSW WSW
WSW    SW W
W      WSW WNW
WNW    W NW
NW     WNW NNW
NNW    NW N
```
The output may be a string with some delimiter (not nothing) between the directions or a two-element list. The direction immediately counterclockwise to the input must appear first. You may use lowercase letters for the directions instead of uppercase but keep all input and output in one case or the other.
For example, for input `N` (or `n` if you're using lowercase) some valid outputs are:
```
NNW NNE
NNW-NNE
["NNW", "NNE"]
nnw-nne (if using lowercase)
```
Some invalid outputs are:
```
NNWNNE
NNE NNW
nnwNNE
NNw NNe
```
**The shortest code in bytes wins.**
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~37~~ 34 bytes
```
“¢ ¬9£Hæz¥{çb¤S®!‘ṃ€“¡&¦»
¢iµ’,‘ị¢
```
[Try it online!](https://tio.run/nexus/jelly#AUwAs///4oCcwqIgwqw5wqNIw6Z6wqV7w6diwqRTwq4h4oCY4bmD4oKs4oCcwqEmwqbCuwrComnCteKAmSzigJjhu4vCov/Dh8WS4bmY//9u "Jelly – TIO Nexus")
Takes lowercase input.
*-2 thanks to [Jonathan Allan](/u/53748).*  
*-1 since it turns out this is valid as a function :)*
Thanks to Jonathan Allan (and Dennis), now you can remove the `€`. Unfortunately, that would be non-competing here.
**Detailed algorithm explanation**:
We usually start explaining from the bottom (main) link, going down, but here I feel like it's more appropriate to explain from the top.
First, we simply load up the list `[1, 32, 7, 57, 2, 67, 17, 92, 3, 94, 19, 119, 4, 109, 9, 34]`. This looks like random numbers huh? Well, this is actually a list of base-5-compressed numbers, so we base-5-decompress it. Now it looks like `[[1], [1, 1, 2], [1, 2], [2, 1, 2], [2], [2, 3, 2], [3, 2], [3, 3, 2], [3], [3, 3, 4], [3, 4], [4, 3, 4], [4], [4, 1, 4], [1, 4], [1, 1, 4]]`. Still random-looking stuff, but this is actually an `NESW`-mapped list of the sixteen coordinates, so we're not far away from completing the list (Jelly is 1-indexed). Doing the final mapping, we get `[['N'], ['N', 'N', 'E'], ['N', 'E'], ['E', 'N', 'E'], ['E'], ['E', 'S', 'E'], ['S', 'E'], ['S', 'S', 'E'], ['S'], ['S', 'S', 'W'], ['S', 'W'], ['W', 'S', 'W'], ['W'], ['W', 'N', 'W'], ['N', 'W'], ['N', 'N', 'W']]`, which is the complete list we want (Jelly strings are in the form `[char1, char2, char3, ...]`.)
Since we've now built the coordinate list, we work with it. The main link comes into play. First, we load up the list we've built, and then take the index that the input (as command-line argument) coordinate resides in. Then, we pair its predecessor and its successor into a list, and we use them as modular indices into the same list of coordinates to take the coordinate to the left and right of the input respectively. You'd now think we're finally done, but there's in fact one more thing, the separator. This is valid as a function, since 1) You can call it using `<integer>Ŀ` 2) You're allowed to define other functions as well (like importing modules). Now, we are done. As a full program, this doesn't have a separator, but that's OK, since it works as a function.
**Link-by-link code explanation**:
```
¢iµ’,‘ị¢K Main link. Arguments: z = cmd0
¢         Run the helper link niladically (i.e. load the coordinate list).
 i        Find the index of z in the list.
  µ       Start a new monadic chain. Arguments: z = list_index.
   ’      Decrement z.
     ‘    Increment z.
    ,     Pair x and y into [x, y].
       ¢  Run the helper link niladically.
      ị   Take the elements of y at the indices in x.
“¢ ¬9£Hæz¥{çb¤S®!‘ṃ€“¡&¦» Helper link. Arguments: [1, 32, 7, 57, 2, 67, 17, 92, 3, 94, 19, 119, 4, 109, 9, 34]
“¢ ¬9£Hæz¥{çb¤S®!‘        Generate the integer list (the argument).
                    “¡&¦» Literal "newsy".
                  ṃ€      Base-length(y)-decompress every integer in x, then index into y.
```
[Answer]
# Mathematica, ~~118~~ 112 bytes
*Thanks to Martin Ender for saving 6 bytes!*
```
r=StringSplit@"N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW N NNE";<|Array[r[[#]]->r[[#+{-1,1}]]&,16,2]|>
```
Unnamed function (an association, really) that takes a string as input and returns an ordered pair of strings. Basically just hardcodes the answer.
[Answer]
# Python 2, ~~116~~ ~~115~~ 103 bytes
 *-12 bytes thanks to Neil* 
```
d='N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW'.split()
n=d.index(input())
print d[n-1],d[n-15]
```
[Try it Online!](https://tio.run/nexus/python2#@59iq@6n4OfnqgBEriCs4BrsqgBCIAwkwxWAKByEFcL9whVAyC9cXa@4ICezREOTK882RS8zLyW1QiMzr6AUKKLJVVCUmVeikBKdp2sYqwOmTGP//1cHaQMA)
[Answer]
# JavaScript ES6, ~~106~~ 102 bytes
```
p=>[(a=`N|NNE|NE|ENE|E|ESE|SE|SSE|S|SSW|SW|WSW|W|WNW|NW|NNW`.split`|`)[i=a.indexOf(p)-1&15],a[i+2&15]]
```
### Try it online!
```
const f = p=>[(a=`N|NNE|NE|ENE|E|ESE|SE|SSE|S|SSW|SW|WSW|W|WNW|NW|NNW`.split`|`)[i=a.indexOf(p)-1&15],a[i+2&15]]
console.log(f('N'))
console.log(f('NNE'))
console.log(f('ENE'))
console.log(f('E'))
console.log(f('ESE'))
console.log(f('SE'))
console.log(f('SSE'))
console.log(f('S'))
console.log(f('SSW'))
console.log(f('SW'))
console.log(f('WSW'))
console.log(f('W'))
console.log(f('WNW'))
console.log(f('NW'))
console.log(f('NNW'))
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~44~~ 43 bytes (Thanks to Adnan)
```
"ESNW4"•2ßU^]>Þ‡¾“¾&é{½‡•5BSè4¡©skD<®ès>®è)
```
[Try it online!](https://tio.run/nexus/05ab1e#@6/kGuwXbqL0qGGR0eH5oXGxdofnPWpYeGjfo4Y5h/apHV5ZfWgvkA@UNnUKPrzC5NDCQyuLs11sDq07vKLYDkRq/v8fDAA "05AB1E – TIO Nexus")
```
"ESNW4"•2ßU^]>Þ‡¾“¾&é{½‡•5BSè # Push N4NNE4NE4ENE4E4ESE4SE4SSE4S4SSW4SW4WSW4W4WNW4NW4NNW
4¡©            # Split on 4's and store.
   sk          # Index of input in direction array.
     D<®è      # Element before index of input.
         s>®è  # Element after index of input.
             ) # Wrap two element to array.
```
Exmaple output:
```
N => [NNW,NNE]
```
---
Version that pushes `N0NNE0NE0ENE0E0ESE0SE0SSE0S0SSW0SW0WSW0W0WNW0NW0NNW` instead:
```
•17¿$Mn]6VAÆ—Dªd—•5B4LJ"NSWE"‡0¡©skD<®ès>®è)
```
Is also 44-bytes, there was 0 reason for my refactor and there is 0 reason for splitting on the 4's.
---
[Answer]
# Javascript - ~~234~~ ~~154~~ ~~156~~ ~~152~~ ~~120~~ ~~106~~ 102 bytes
Only my second time doing code golf!!
Latest Revision:
Thank you to @fəˈnɛtɪk for this neat variable trick!
```
s=>[(a=`NNW N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW`.split` `)[n=a.indexOf(s)-1&15],a[n+2&15]]
```
Before That:
Okay so latest revision: Input is a string and output is a string which is in the rules, so I made it into a function, and with reductions I have gone even smaller (also function is anonymous, which now means mine has somehow meshed into the other js answer oops! He (powelles) had it first!!):
```
(s,a=`NNW N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW`.split` `,n=a.indexOf(s))=>[a[n-1&15],a[n+1&15]]
```
Can be used by:
```
f=(s,a=`NNW N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW`.split` `,n=a.indexOf(s))=>[a[n-1&15],a[n+1&15]]
alert(f(prompt()))
```
Remade (not function) with Output - 120:
```
a="NNW N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW".split(' ');n=a.indexOf(prompt());alert(a[n-1&15]+' '+a[n+1&15]);
```
* Note that I made an error originally, having it equal a.length instead of a.length-1 for the first index. Thanks @Neil for pointing out that it didn't work for NNW.
* Note 2: Thank you to @Neil and @ETHProductions for helping me shorten the code!
Originial:
```
a="NNWN  NNENE ENEE  ESESE SSES  SSWSW WSWW  WNWNW ";l=prompt("","");n=l.length<3?l.length<2?l+'  ':l+' ':l;f=a.indexOf(n);i=f-3;j=f+3;i=i<0?a.length+--i:i;j=j+3>=a.length?j-a.length:j;alert(a.substring(i,i+3)+' '+a.substring(j,j+3));
```
[Answer]
## Batch, 196 bytes
```
@set s=N
@if %1==N echo NNW
@for %%r in (NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW)do @call:c %1 %%r
@if %1==NNW echo N
@exit/b
:c
@if %1==%2 echo %s%
@if %1==%s% echo %2
@set s=%2
```
Loops through each pair of compass points, printing one when the other matches. For example, for a parameter of `ENE`, when the loop reaches `ENE`, the variable `s` contains `NE` which is printed, then when the loop advances to `E`, the variable `s` contains `ENE` and so `E` is printed. One pair then needs to be special-cased to avoid the compass points from being printed in the wrong order.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~40~~ 38 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
“NSWE”“dḍ.ƈ€ḶƘfƥ’ṃṁ
“¢)`)’ḃ3RÇṙi¥µṖṪ,Ḣ
```
**[Try it online!](https://tio.run/nexus/jelly#@/@oYY5fcLjro4a5QFbKwx29esc6HjWtebhj27EZaceWPmqY@XBn88OdjVxA6UOLNBM0QSI7mo2DDrc/3Dkz89DSQ1sf7pz2cOcqnYc7Fv0/3B75/78fAA)** (added the footer to show the output is a list of two items) ...or see [all cases](https://tio.run/nexus/jelly#@/@oYY5fcLjro4a5QFbKwx29esc6HjWtebhj27EZaceWPmqY@XBn88OdjVxA6UOLNBM0QSI7mo2DDrc/3Dkz89DSQ1sf7pz2cOcqnYc7Fv0/uudwexbQLF0VFaAh7v//R6v7qeuo@/m5gkgQ4QohQTgYREIICAlmhYNIEBEOIUHYD0RCCCAZCwA).
(I'm not quite sure why `1323DRẋ4` in place of `“¢)`)’ḃ3R` doesn't work at the moment.)
### How?
```
“NSWE”“dḍ.ƈ€ḶƘfƥ’ṃṁ - Link 1, rose list helper: shape array
“NSWE”              - "NSWE"
      “dḍ.ƈ€ḶƘfƥ’   - base 250 number: 1554210846733274963415
                 ṃ  - base decompress: "NNNENEENEEESESESSESSSWSWWSWWWNWNWNNW"
                  ṁ - mould like shape array
“¢)`)’ḃ3RÇṙi¥µṖṪ,Ḣ - Main link: direction string
“¢)`)’             - base 250 number: 33899292
      ḃ3           - to base 3: [1,3,2,3,1,3,2,3,1,3,2,3,1,3,2,3]
        R          - range (vectorises) [[1],[1,2,3],[1,2],[1,2,3],[1],[1,2,3],[1,2],[1,2,3],[1],[1,2,3],[1,2],[1,2,3],[1],[1,2,3],[1,2],[1,2,3]]
         Ç         - call the last link (1) as a monad: ["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"]
            ¥      - last two links as a dyad
          ṙ        -     rotate the list by:
           i       -         index of the direction string in the list
             µ     - monadic chain separation (call the rotated list x)
              Ṗ    - pop (x[:-1]) (removes the direction string)
               Ṫ   - tail that (i.e. x[-2])
                 Ḣ - head x (i.e. x[0])
                ,  - pair
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~100~~ 99 bytes
```
s=words"N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW"++s
(a:b:c:r)#x|x==b=(a,c)|1<3=r#x
(s#)
```
[Try it online!](https://tio.run/nexus/haskell#Jc0xC4MwEIbh3V9xxCWhUijdpDdm7C0ON5QO0YI4aCUp1MH/bvM18L0Pt92R@PuOr2SERDzleUS@84ShrFKeIlJRwkTN6ZQqG9q@Hdro6m3fmHu2oRncfrldOdZbNbJNtTvmMC3ENIf1TnaN0/I5j44eRkxj8l8IfBF1sFD8XwqBFpHAQvZ5/AA "Haskell – TIO Nexus") Calling `(s#) "N"` returns `("NNW","NNE")`.
`s` is an infinite repetition of the list of directions, thus we don't have to add an extra `N` and `NNE` like some of the other answers to correctly handle the edges of the list.
Thanks to @nimi for saving one byte!
[Answer]
# [SOGL](https://github.com/dzaima/SOGL), 33 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
≠┐πΜ]ρ½d⁹V¹-┐*╔╤¹Ψæ;¶‘θ,W:AHwOaIw
```
The first part `≠┐πΜ]ρ½d⁹V¹-┐*╔╤¹Ψæ;¶‘` is a compressed string that is
```
N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW
```
compressed with a custom dictionary with  `ENSW`
The rest of the program:
```
...‘θ,W:AHwOaIw  example input: NNW
...‘             push the compressed string        ["N NNE NE ... NNW"]
    θ            split on spaces                   [["N","NNE",...,"NNW"]]
     ,W          get the index of input            [["N","NNE",...,"NNW"], 16]
       :A        save the index on variable A      [["N","NNE",...,"NNW"], 16]
         H       decrease [the index]              [["N","NNE",...,"NNW"], 15]
          wO     output that'th item of the array  [["N","NNE",...,"NNW"]]
            a    load variable A                   [["N","NNE",...,"NNW"], 16]
             I   increase [the index]              [["N","NNE",...,"NNW"], 17]
              w  get that item in the array        [["N","NNE",...,"NNW"], "N"]
```
[Answer]
# PHP, 122 bytes
```
preg_match("/([^ ]+ )$argv[1] ([^ ]+)/",'N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW N NNE',$m);
echo $m[1].$m[2];
```
[Answer]
# Ruby - 94 Bytes
A riff on [Blue Okiris's answer](https://codegolf.stackexchange.com/a/116548), just to take advantage of some nice Ruby shorthand (the `%w[]` syntax and `p` specifically):
```
->(s,d=%w[N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW],n=d.index(s)){p d[n-1],d[n-15]}
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 66 52 bytes
*Saved 14 bytes thanks to @ETHproductions*
```
V=`ã@JaÀTeaÀÄsÁÁss°s°ws°°wn°n°nnw`qa [J1]£VgX+VaU
```
[Try it online!](https://tio.run/nexus/japt#@x9mm3B4sYPXoabEww0hqUDicEvx4UbRw41ixcWHNgBRORADybxDG0AorzyhMFEh2ssw9tDisPQI7bDE0P//lfLKlQA)
### Explanation:
```
V=(`...`qa) [J1]£Vg(X+VaU)
V=(       )                // Set V to:
   `...`                   //   "nanneaneaeneaeaeseaseasseasasswaswawswawawnwanwannw" (de-)compressed
        qa                 //    Split on "a", creating [n...nnw]
            [J1]           // [-1,1]
                £          // Iterate through ^, X becomes the iterative item
                 Vg(     ) //   V.Item at index:
                    X+VaU  //     X + V.indexOf(input)
```
[Answer]
# CJam, 41
```
"NeSWN"2ew{_1<\_La*\$f+~}%:eu_ra#(m<2%2<p
```
[Try it online](http://cjam.aditsu.net/#code=%22NeSWN%222ew%7B_1%3C%5C_La*%5C%24f%2B~%7D%25%3Aeu_ra%23(m%3C2%252%3Cp&input=N)
[Answer]
# PHP, 115 Bytes
```
for($r=explode(_,($w=N_NNE_NE_ENE_E_ESE_SE_SSE_).strtr($w,SWNE,NESW).$w);$r[++$i]!=$argn;);echo$r[$i-1]._.$r[$i+1];
```
-2 Bytes using the deprecated function `split` instead of `explode`
## PHP, 128 Bytes
```
for($i=2;$i--;print$i?end($e)._:$e[2])$e=explode(_,strstr(($w=N_NNE_NE_ENE_E_ESE_SE_SSE_).strtr($w,SWNE,NESW).$w,_.$argn._,$i));
```
## PHP, 134 Bytes
```
echo($r=explode(_,N_NNE_NE_ENE_E_ESE_SE_SSE_S_SSW_SW_WSW_W_WNW_NW_NNW))[($k=array_search($argn,$r))-1<0?15:$k-1]._.$r[$k+1>15?0:$k+1];
```
[Answer]
# PHP, 110 109 bytes
Saved 1 byte thanks to [Jörg Hülsermann](https://codegolf.stackexchange.com/users/59107/j%c3%b6rg-h%c3%bclsermann).
```
echo@preg_filter("/.*?(\w+) $argn( \w+).*/",'$1$2',($s='N NNE NE ENE E ESE SE SSE ').strtr($s,NESW,SWNE).$s);
```
[Answer]
# **Python 3 - ~~112~~ 107 bytes**
I based this off of my Javascript answer:
Remade:
```
lambda i,s="N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW".split():[s[s.index(i)-1],s[s.index(i)-15]]
```
Use as say
```
f = lambda i,s="N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW".split():[s[s.index(i)-1],s[s.index(i)-15]]
print(f(input()));
```
Original:
```
lambda i,s="N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW".split():[s[s.index(i)-1&15],s[s.index(i)+1&15]]
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 43 bytes
```
';evl(Z?&fWElf`gvhM'F' NESW'ZaYbtjY=fFTEq+)
```
[Try it online!](https://tio.run/nexus/matl#@69unVqWoxFlr5YW7pqTlpBeluGr7qau4OcaHK4elRiZVJIVaZvmFuJaqK35/78fAA "MATL – TIO Nexus")
### Explanation
```
';evl(Z?&fWElf`gvhM' % Push this string
F                    % Push false
' NESW'              % Push this string
Za                   % Base conversion. This decompresses the first string from alphabet
                     % given by all printable ASCII except single quote to the alphabet
                     % ' NESW'. The result is the following string, which is pushed:
                     % 'N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW'
Yb                   % Split at spaces. Gives a cell array of strings
t                    % Duplicate
j                    % Input string
Y=                   % String comparison. Gives an array containing true at the index
                     % of the matching string
f                    % Find: index of the entry that equals true
FTEq                 % Push [-1 1] (obtained as [false true], times 2, minus 1)
+                    % Add, element-wise
)                    % Index modularly into the cell array of strings
                     % Implicitly display. Each cell is displayed on a different line
```
[Answer]
## c, ~~222~~ ~~216~~ 211 bytes
```
main(c,v)char**v;{char r[]="NXNNEXNEXENEXEXESEXSEXSSEXSXSSWXSWXWSWXWXWNWXNWXNNWX",*p=r,*s=r,*a[16],i=0,n;for(;*p++;)*p==88?*p=0,n=strcmp(a[i++]=s,v[1])?n:i-1,s=++p:0;printf("%s %s\n",a[n?n-1:15],a[n<15?n+1:0]);}
```
[Try it online](https://tio.run/nexus/c-gcc#FYo9C8MgFEX/ShAKfgXikBJiJZOrSwcF6yCBUIdY0ZCl9LenCufce@G9a/chwpWeaH37jPHJv2102ToBlFFKmopsGvmUptGsqU1FN41W2jSqgOIkMsWlhbfs7mgQA418@2TIcSKEo/ohpmmpVQ@iHHndE/Q2EOJEoadlDi1xDj2jRRCS5oGnHOKxQXAr3a28IqDexiX2bGaja/vBxiUSNg8O8d91XeoP)
[Answer]
# Javascript (ES6), 189 bytes
```
d="N.NNW NNE.NNE.N NE.NE.NNE ENE.ENE.NE E.E.ENE ESE.ESE.E SE.SE.ESE SSE.SSE.SE S.S.SSE SSW.SSW.S SW.SW.SSW WSW.WSW.SW W.W.WSW WNW.WNW.W NW.NW.WNW NNW.NNW.NW N".split`.`,f=>d[d.indexOf(f)+1]
```
Just takes the input, looks it up, and returns it.
[Answer]
## JavaScript (ES6), 94 bytes
Expects a string in uppercase such as `"ENE"`. Returns a comma separated string such as `"NE,E"`.
```
s=>/\D+,\D+/.exec('NNW0N0NNE0NE0ENE0E0ESE0SE0SSE0S0SSW0SW0WSW0W0WNW0NW0NNW0N'.split(0+s+0))[0]
```
### How it works
The expression `0+s+0` is coerced to a string when `split()` is called. For instance, if the input is `"ENE"`, the string will be split on `"0ENE0"`:
```
"NNW0N0NNE0NE0ENE0E0ESE0SE0SSE0S0SSW0SW0WSW0W0WNW0NW0NNW0N"
             ^^^^^
```
This leads to the following array:
```
[ "NNW0N0NNE0NE", "E0ESE0SE0SSE0S0SSW0SW0WSW0W0WNW0NW0NNW0N" ]
```
Again, this array is coerced to a string when `exec()` is called. So, the regular expression is actually applied on:
```
"NNW0N0NNE0NE,E0ESE0SE0SSE0S0SSW0SW0WSW0W0WNW0NW0NNW0N"
```
We look for consecutive non-numeric characters (`\D+`) followed by a comma, followed by consecutive non-numeric characters. This returns the array `[ "NE,E" ]`. We could arguably stop there and return just that. But the challenge is asking for either a delimited string or a two-element array. So, we extract the string with `[0]`.
### Demo
```
let f =
s=>/\D+,\D+/.exec('NNW0N0NNE0NE0ENE0E0ESE0SE0SSE0S0SSW0SW0WSW0W0WNW0NW0NNW0N'.split(0+s+0))[0]
;
["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"]
.map(
  s => console.log(s, '=>', f(s))
)
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 39 bytes:
```
.rL]z_Bms@L"ESWN"jCd5"\"❤m❤w❤^❤\❤C❤9❤ ❤
```
where `❤` represents unprintable letters.
[Try it online!](http://pyth.herokuapp.com/?code=.rL%5Dz_Bms%40L%22ESWN%22jCd5%22%5C%22%09m%04w%13%5E%03%5C%11C%029%07+%01&test_suite=1&test_suite_input=N%0ANNE%0ANE%0AENE%0AE%0AESE%0ASE%0ASSE%0AS%0ASSW%0ASW%0AWSW%0AW%0AWNW%0ANW%0ANNW&debug=0)
Hexdump:
```
0000000: 2e 72 4c 5d 51 5f 42 6d 73 40 4c 22 45 53 57 4e .rL]Q_Bms@L"ESWN
0000010: 22 6a 43 64 35 22 5c 22 09 6d 04 77 13 5e 03 5c "jCd5"\".m.w.^.\
0000020: 11 43 02 39 07 20 01                            .C.9. .
```
]