#!/usr/bin/perl -i.bak

use English;


######################
# DEFINE GLOBAL CONSTANTS
######################


######################
# BEGIN MAIN
######################



undef $INPUT_RECORD_SEPARATOR;
$file = <>;

#print STDERR "*****************I got: $file\n";

if ($file =~ /\\documentclass{(seminar|prosper)}/)
{
    if (!($file =~ /\\begin{slide\*?}/)) 
    {
	$file =~ s/\\begin{document}/\\begin{document}\n\\begin{slide}/i;
	$file =~ s/\\end{document}/\\end{slide}\n\\end{document}/i;
	$file =~ s/^----\n/\\end{slide}\n\\begin{slide}\n/mg;
    }

    
    
}


print $file;
