/* package whatever; // don't place package name! */

import java.util.*;
import java.util.concurrent.Callable;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws Exception
	{
		RunAndCall<RunnableAndCallable> instance = new RunAndCall<>();
		instance.invoke(new RunnableAndCallable());
	}
	
	public static class RunAndCall<T extends Runnable & Callable<Integer>> {
		
		public void invoke(T input) throws Exception {
			input.run();
			Integer result = input.call();
			System.out.println(result);
		}
	}
	
	public static class RunnableAndCallable implements Runnable, Callable<Integer> {
		
		public void run() {
			System.out.println("I can be run!");
		}
		
		public Integer call() {
			return 12;
		}
	}
}