import java.lang.*;
import java.io.*;
import java.util.regex.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String path = "/Systems/lenovo/";
    Pattern p = Pattern.compile("(?:\\/[^\\/]+)");
    Matcher m = p.matcher(path);

    if(m.find()) {
        System.out.println(m.group(0));
    }
    p = Pattern.compile("(?:\\/[^\\/]+){1}(?=\\/$)");
    m = p.matcher(path);
    if(m.find()) {
        System.out.println(m.group(0));
    }
        
	}
}