/*
 * Finds the 2nd last word in a string.
 */

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Main {

    public static void main(String[] args) throws FileNotFoundException, IOException {
        File f = new File(args[0]);
        BufferedReader read = new BufferedReader(new FileReader(f));

        String line;
        while ((line = read.readLine()) != null) {
            String[] parts = line.split(" ");
            
            System.out.println(parts[parts.length - 2]);
        }
    }
}