import java.util.Scanner; public class Mosquito { static int M, P, L, E, R, S, N; while (sc.hasNextInt()) { M = sc.nextInt(); P = sc.nextInt(); L = sc.nextInt(); E = sc.nextInt(); R = sc.nextInt(); S = sc.nextInt(); N = sc.nextInt(); int phase = N % 3; int steps = N / 3; if (phase == 0) { } if (phase == 1) { M = P / S; } if (phase == 2) { M = (L / R) / S; } for (int i=0; i < steps; i++) { M = ((M * E) / R) / S; } } } }