import java.util.Scanner;
public class Main {
static long[][][] dp = new long[200005][3][3]; // Adjusted size for clarity
public static void main
(String[] args
) { Scanner scanner
= new Scanner
(System.
in);
long n = scanner.nextLong();
long v = scanner.nextLong();
long[] a = new long[(int) n + 1];
long[] b = new long[(int) n + 1];
for (int i = 1; i <= n; i++) {
a[i] = scanner.nextLong();
b[i] = scanner.nextLong();
}
// Initialize dp for the first index
if (a[1] % 2 == 0) {
dp[1][1][1] = 1; // Even journeys ending at a[1]
} else {
dp[1][1][2] = 1; // Odd journeys ending at a[1]
}
if (b[1] % 2 == 0) {
dp[1][2][1] = 1; // Even journeys ending at b[1]
} else {
dp[1][2][2] = 1; // Odd journeys ending at b[1]
}
// Fill the dp table
for (int j = 2; j <= n; j++) {
// For array a
if (a[j] % 2 == 0) {
dp[j][1][1] = dp[j - 1][1][1] + dp[j - 1][2][1]; // Even from a
dp[j][1][2] = dp[j - 1][1][2] + dp[j - 1][2][2]; // Odd from a
} else {
dp[j][1][1] = dp[j - 1][1][2] + dp[j - 1][2][2]; // Even from odd
dp[j][1][2] = dp[j - 1][1][1] + dp[j - 1][2][1]; // Odd from even
}
// For array b
if (b[j] % 2 == 0) {
dp[j][2][1] = dp[j - 1][1][1] + dp[j - 1][2][1]; // Even from b
dp[j][2][2] = dp[j - 1][1][2] + dp[j - 1][2][2]; // Odd from b
} else {
dp[j][2][1] = dp[j - 1][1][2] + dp[j - 1][2][2]; // Even from odd
dp[j][2][2] = dp[j - 1][1][1] + dp[j - 1][2][1]; // Odd from even
}
}
// Output the total number of journeys
long totalOddJourneys = dp[(int) n][1][2] + dp[(int) n][2][2];
long totalEvenJourneys = dp[(int) n][1][1] + dp[(int) n][2][1];
System.
out.
println("ODD Journeys: " + totalOddJourneys
); System.
out.
println("EVEN Journeys: " + totalEvenJourneys
);
scanner.close();
}
}