package maratonacps2019_1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author Prof. Henrique Louro
 */
public class LatLong {

    public static void main(String[] args) throws IOException {

        String linha = "";

        BufferedReader entrada;

        entrada = new BufferedReader(new InputStreamReader(System.in));

        while ((linha = entrada.readLine()) != null) {

            if (linha.equals("0")) {
                break;
            }

            String temp[] = linha.split(";");

            String temp1[] = temp[0].split(" ");
            String temp2[] = temp[1].split(" ");

            float lat = Float.parseFloat(temp1[0].substring(0, temp1[0].length() - 1));
            float lon = Float.parseFloat(temp2[0].substring(0, temp2[0].length() - 1));

            if (temp1.length > 1) {
                lat += Float.parseFloat(temp1[1].substring(0, temp1[1].length() - 1)) / 60;
                if (temp1.length > 2) {
                    lat += Float.parseFloat(temp1[2].substring(0, temp1[2].length() - 1)) /3600;
                }
            }

            if (temp2.length > 1) {
                lon += Float.parseFloat(temp2[1].substring(0, temp2[1].length() - 1)) / 60;
                if (temp2.length > 2) {
                    lon += Float.parseFloat(temp2[2].substring(0, temp2[2].length() - 1)) / 3600;
                }
            }

            String latitude, longitude;

            if (lat < 0) {
                latitude = "Sul";
            } else if (lat == 0) {
                latitude = "Equador";
            } else {
                latitude = "Norte";
            }

            if (lon < 0) {
                longitude = "Oeste";
            } else if (lon == 0) {
                longitude = "Greenwich";
            } else {
                longitude = "Leste";
            }

            System.out.println(latitude + " " + longitude);
        }
    }
}
