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

import java.util.*;
import java.lang.*;
import java.io.*;
import java.text.*;
/* 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
	{
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmss");
        sdf.setLenient(false);
        try {
           Date dt2 = sdf.parse("20150229105950");
           System.out.println(dt2);
        }
        catch (Exception exc) {
        	System.out.println("NOT VALID");
        }
	}
}