import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { String s = sc.next(); if (s.equals("#")) {System.out.println(0+" "+0);} else { s = s.replace("(^^*)","L"); s = s.replace("(*^^)","R"); int L_num = 0; int R_num = 0; for (int i=0; i