Traveling on a flat Earth Coordinates in the flat-Earth world consist of latitude (x) and longitude (y), which are integers in the range 0...9999. Much like Gaussian integers, but they are always written using this notation:

411S 370E


That is, with S or N appended to the latitude, and E or W appended to the longitude, with space(s) between the two components.

Goal

Write a program (not a function) that reads two coordinates, separated by whitespace, and outputs their sum. The first coordinate is a starting point, the second one is a displacement, and the output is the resulting position.

Input/Output

Since this challenge is partially about formatting, I'll try to define the input and output formats unambiguously.

The preferred input format has 1 space between the coordinate components, no leading zeros, and a newline character between the two coordinates. The program must be able to read the preferred format.

The output can contain any amount of whitespace and leading zeros. If it's different from the preferred input format, the program must be able to read this format too.

Just to make it clear, the input cannot (will not) contain any additional formatting characters. Just spaces and newlines where needed.

Scoring

This is an experiment on a new winning condition. I'll choose the winner by accepting an answer in a few weeks. If a better answer appears afterwards, I'll change the accepted answer.

The score for the program is its byte count. The winning program is one that is shorter than 400 bytes, has the fewest byte count, but is written in the most verbose programming language. To determine the winner:


Remove programs with byte count 400 or more (they can participate but cannot win)
Consider only the shortest program for each programming language
The longest program wins


Polyglots compete against programs in all languages in which they are valid (e.g. if a program is valid in both bash and sh, it competes against programs in both languages).

Test cases

In the test cases, the first two lines are the input, and the third line is the output.

0S 0E
0S 0W
0N 0E


(the direction of zero doesn't matter, both in input and output)



0S 9999E
9999N 9999W
9999N 0E


(maximal values)



42S 314W
42N 2718W
0N 3032W


(the direction of zero doesn't matter in the output)



5555N 8888W
7777S 0E
2222S 8888W


(no negative values; change the direction if you need to change the sign)



0001N        4545W
0999N        5454W
1000N        9999W


(if the program outputs leading zeros and several spaces, it must be able to read them; it must also be able to read input that doesn't contain them)



8888N 8888W
9999N 9999W


(invalid input - any behavior is acceptable, including crash and infinite loop)
MATLAB, 327 304 296 290 282 276 267 259  255  253 bytes
I think I'm closing in on a limit now. I've managed to remove 51, 60 68 72 74 bytes from an answer I thought was well golfed. =)
Removed 8 bytes by taking the input inside the strsplit, thanks to Luis Mendo. Removed another 6 bytes by taking all the input into one cell array instead of two. Removed another 8 bytes by taking both last statements inside disp(). Removed 6 bytes by removing char and some brackets. This wasn't possible in a previous revision of the answer. Splitting the cell elements into four variables costed 15 bytes, but saved 24, thus 9 bytes saved! 8 additional bytes due to improved disp scheme. 5*~~s saves two bytes compared to (s&gt;0)*5. Thus 4 new bytes saved (for s and t). Taking the opposite of this last expression saves yet another 2 bytes, 83-5*~s is shorter than 78+5*~~s
Golfed code:
x=strsplit([input('','s'),' ',input('','s')]);[a,b,c,d]=x{:};f=@str2num;n=@num2str;i=@sign;s=f(a(1:end-1))*i(a(end)-79)+f(c(1:end-1))*i(c(end)-79);t=f(b(1:end-1))*i(b(end)-79)+f(d(1:end-1))*i(d(end)-79);disp([n(abs(s)),83-5*~s,32,n(abs(t)),87-18*~t,''])

Same code, but with line breaks:
x=strsplit([input('','s'),' ',input('','s')]);
[a,b,c,d]=x{:};
f=@str2num;
n=@num2str;
i=@sign;
s=f(a(1:end-1))*i(a(end)-79)+f(c(1:end-1))*i(c(end)-79);
t=f(b(1:end-1))*i(b(end)-79)+f(d(1:end-1))*i(d(end)-79);
disp([n(abs(s)),78+5*~~s,32,n(abs(t)),69+18*~~t,''])

Test cases:
Save the above as flat_earth.m
flat_earth
0S 0E
0S 0W
0N 0E

flat_earth
0S 9999E
9999N 9999W
9999N 0E

flat_earth
42S 314W
42N 2718W
0N 3032W

flat_earth
5555N 8888W
7777S 0E
2222S 8888W

flat_earth
0001N        4545W
0999N        5454W
1000N 9999W