Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);
	static final int
		TOP = 0, SOUTH = 1, EAST = 2,
		WEST = 3, NORTH = 4, BOTTOM = 5;

	public static void main(String[] args){
		int[] d = new int[6];
		for(int i = 0; i < 6; i++){
			d[i] = scan.nextInt();
		}

		String dirs = scan.next();
		int len = dirs.length();
		for(int i = 0; i < len; i++){
			char ch = dirs.charAt(i);
			switch(ch){
				case 'E' :
					rollEast();
					break;
				case 'W' :
					rollWest();
					break;
				case 'S' :
					rollSouth();
					break;
				case 'N' :
					rollNorth();
					break;
				default :
					break;
			}
		}
		System.out.println(d[TOP]);
	}

	public static void rollEast(){
		int work = d[TOP];
		d[TOP] = d[WEST];
		d[WEST] = d[BOTTOM];
		d[BOTTOM] = d[EAST];
		d[EAST] = work;
	}

	public static void rollWest(){
		int work = d[TOP];
		d[TOP] = d[EAST];
		d[EAST] = d[BOTTOM];
		d[BOTTOM] = d[WEST];
		d[WEST] = work;
	}

	public static void rollSouth(){
		int work = d[TOP];
		d[TOP] = d[NORTH];
		d[NORTH] = d[BOTTOM];
		d[BOTTOM] = d[SOUTH];
		d[SOUTH] = work;
	}

	public static void rollNorth(){
		int work = d[TOP];
		d[TOP] = d[SOUTH];
		d[SOUTH] = d[BOTTOM];
		d[BOTTOM] = d[NORTH];
		d[NORTH] = work;
	}
}

Compiler output:
Main.java:40: error: cannot find symbol
		int work = d[TOP];
		           ^
  symbol:   variable d
  location: class Main
Main.java:41: error: cannot find symbol
		d[TOP] = d[WEST];
		^
  symbol:   variable d
  location: class Main
Main.java:41: error: cannot find symbol
		d[TOP] = d[WEST];
		         ^
  symbol:   variable d
  location: class Main
Main.java:42: error: cannot find symbol
		d[WEST] = d[BOTTOM];
		^
  symbol:   variable d
  location: class Main
Main.java:42: error: cannot find symbol
		d[WEST] = d[BOTTOM];
		          ^
  symbol:   variable d
  location: class Main
Main.java:43: error: cannot find symbol
		d[BOTTOM] = d[EAST];
		^
  symbol:   variable d
  location: class Main
Main.java:43: error: cannot find symbol
		d[BOTTOM] = d[EAST];
		            ^
  symbol:   variable d
  location: class Main
Main.java:44: error: cannot find symbol
		d[EAST] = work;
		^
  symbol:   variable d
  location: class Main
Main.java:48: error: cannot find symbol
		int work = d[TOP];
		           ^
  symbol:   variable d
  location: class Main
Main.java:49: error: cannot find symbol
		d[TOP] = d[EAST];
		^
  symbol:   variable d
  location: class Main
Main.java:49: error: cannot find symbol
		d[TOP] = d[EAST];
		         ^
  symbol:   variable d
  location: class Main
Main.java:50: error: cannot find symbol
		d[EAST] = d[BOTTOM];
		^
  symbol:   variable d
  location: class Main
Main.java:50: error: cannot find symbol
		d[EAST] = d[BOTTOM];
		          ^
  symbol:   variable d
  location: class Main
Main.java:51: error: cannot find symbol
		d[BOTTOM] = d[WEST];
		^
  symbol:   variable d
  location: class Main
Main.java:51: error: cannot find symbol
		d[BOTTOM] = d[WEST];
		            ^
  symbol:   variable d
  location: class Main
Main.java:52: error: cannot find symbol
		d[WEST] = work;
		^
  symbol:   variable d
  location: class Main
Main.java:56: error: cannot find symbol
		int work = d[TOP];
		           ^
  symbol:   variable d
  location: class Main
Main.java:57: error: cannot find symbol
		d[TOP] = d[NORTH];
		^
  symbol:   variable d
  location: class Main
Main.java:57: error: cannot find symbol
		d[TOP] = d[NORTH];
		         ^
  symbol:   variable d
  location: class Main
Main.java:58: error: cannot find symbol
		d[NORTH] = d[BOTTOM];
		^
  symbol:   variable d
  location: class Main
Main.java:58: error: cannot find symbol
		d[NORTH] = d[BOTTOM];
		           ^
  symbol:   variable d
  location: class Main
Main.java:59: error: cannot find symbol
		d[BOTTOM] = d[SOUTH];
		^
  symbol:   variable d
  location: class Main
Main.java:59: error: cannot find symbol
		d[BOTTOM] = d[SOUTH];
		            ^
  symbol:   variable d
  location: class Main
Main.java:60: error: cannot find symbol
		d[SOUTH] = work;
		^
  symbol:   variable d
  location: class Main
Main.java:64: error: cannot find symbol
		int work = d[TOP];
		           ^
  symbol:   variable d
  location: class Main
Main.java:65: error: cannot find symbol
		d[TOP] = d[SOUTH];
		^
  symbol:   variable d
  location: class Main
Main.java:65: error: cannot find symbol
		d[TOP] = d[SOUTH];
		         ^
  symbol:   variable d
  location: class Main
Main.java:66: error: cannot find symbol
		d[SOUTH] = d[BOTTOM];
		^
  symbol:   variable d
  location: class Main
Main.java:66: error: cannot find symbol
		d[SOUTH] = d[BOTTOM];
		           ^
  symbol:   variable d
  location: class Main
Main.java:67: error: cannot find symbol
		d[BOTTOM] = d[NORTH];
		^
  symbol:   variable d
  location: class Main
Main.java:67: error: cannot find symbol
		d[BOTTOM] = d[NORTH];
		            ^
  symbol:   variable d
  location: class Main
Main.java:68: error: cannot find symbol
		d[NORTH] = work;
		^
  symbol:   variable d
  location: class Main
32 errors