/* package whatever; // don't place package name! */
import java.util.* ;
import java.util.stream.* ;
import java.lang.* ;
import java.io.* ;
import java.time.format.* ;
import java.time.* ;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
static LocalDateTime dateTime = LocalDateTime.now ( ) ;
static Stream
< String
> repeatedRuns
( String c,
int start,
int end
) { return IntStream
.rangeClosed ( start, end)
.mapToObj ( len ->
Collections .
nCopies ( len, c
) .
stream ( ) .
collect ( Collectors.
joining ( "" ) ) ) ;
}
static void printDateTime
( String pattern
) { DateTimeFormatter dtf = DateTimeFormatter.ofPattern ( pattern) ;
System .
out .
println ( pattern
+ ", " + dtf.
format ( dateTime
) ) ; }
public static void main
( String [ ] args
) { Stream< String> patterns = repeatedRuns( "E" , 1 , 4 )
.flatMap ( e -> repeatedRuns( "M" , 1 , 4 ) .map ( m -> e + " " + m) )
.map ( em -> em + " d" ) ;
patterns.forEach ( Ideone:: printDateTime) ;
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS51dGlsLnN0cmVhbS4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnRpbWUuZm9ybWF0Lio7CmltcG9ydCBqYXZhLnRpbWUuKjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJCiAgICBzdGF0aWMgTG9jYWxEYXRlVGltZSBkYXRlVGltZSA9IExvY2FsRGF0ZVRpbWUubm93KCk7CgkKICAgIHN0YXRpYyBTdHJlYW08U3RyaW5nPiByZXBlYXRlZFJ1bnMoU3RyaW5nIGMsIGludCBzdGFydCwgaW50IGVuZCkgewogICAgICAgIHJldHVybiBJbnRTdHJlYW0KICAgICAgICAgICAgLnJhbmdlQ2xvc2VkKHN0YXJ0LCBlbmQpCiAgICAgICAgICAgIC5tYXBUb09iaihsZW4gLT4gCiAgICAgICAgICAgICAgICBDb2xsZWN0aW9ucy5uQ29waWVzKGxlbiwgYykuc3RyZWFtKCkuY29sbGVjdChDb2xsZWN0b3JzLmpvaW5pbmcoIiIpKQogICAgICAgICAgICApOwogICAgfQoJCiAgICBzdGF0aWMgdm9pZCBwcmludERhdGVUaW1lKFN0cmluZyBwYXR0ZXJuKSB7CiAgICAgICAgRGF0ZVRpbWVGb3JtYXR0ZXIgZHRmID0gRGF0ZVRpbWVGb3JtYXR0ZXIub2ZQYXR0ZXJuKHBhdHRlcm4pOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihwYXR0ZXJuICsgIiwgIiArIGR0Zi5mb3JtYXQoZGF0ZVRpbWUpKTsKICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgU3RyZWFtPFN0cmluZz4gcGF0dGVybnMgPSByZXBlYXRlZFJ1bnMoIkUiLCAxLCA0KQogICAgICAgICAgICAgICAgLmZsYXRNYXAoZSAtPiByZXBlYXRlZFJ1bnMoIk0iLCAxLCA0KS5tYXAobSAtPiBlICsgIiAiICsgbSkpCiAgICAgICAgICAgICAgICAubWFwKGVtIC0+IGVtICsgIiBkIik7CgogICAgICAgIHBhdHRlcm5zLmZvckVhY2goSWRlb25lOjpwcmludERhdGVUaW1lKTsKICAgIH0KICAgIAogICAgfQ==
stdout
E M d, Sat 7 1
E MM d, Sat 07 1
E MMM d, Sat Jul 1
E MMMM d, Sat July 1
EE M d, Sat 7 1
EE MM d, Sat 07 1
EE MMM d, Sat Jul 1
EE MMMM d, Sat July 1
EEE M d, Sat 7 1
EEE MM d, Sat 07 1
EEE MMM d, Sat Jul 1
EEE MMMM d, Sat July 1
EEEE M d, Saturday 7 1
EEEE MM d, Saturday 07 1
EEEE MMM d, Saturday Jul 1
EEEE MMMM d, Saturday July 1