fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Scanner scan = new Scanner(System.in);
  13. scan.forEachRemaining(a -> {
  14. a.chars().forEach(ch -> {
  15. sb.append(sb.length() % 4 == 3 ? "-" : "");
  16. sb.append(Character.isDigit(ch) ? (char)ch:"");
  17. });
  18. System.out.println(sb);
  19. });
  20. scan.close();
  21. }
  22. }
Success #stdin #stdout 0.25s 321408KB
stdin
1
12
123
1234
12345
123TOP45KEK6
1234567
12-34-56-78
123456789FUCK YOU
9 - 33 2176--856
23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984r23897r3984gr29834g9824g894g58f48957egsugs89d7gy89e7t89375yt987459f859845982589f24gf986g9582g589fg298g948f58495f2896f98289f2g984r3984rsdfsdf2
stdout
1
12
123
123-4
123-45
123-456
123-456-7
123-456-78
123-456-789-

9

33
217-685-6
238-973-984-298-349-824-894-584-895-789-789-789-375-987-459-859-845-982-589-249-869-582-589-298-948-584-952-896-982-892-984-398-423-897-398-429-834-982-489-458-489-578-978-978-937-598-745-985-984-598-258-924-986-958-258-929-894-858-495-289-698-289-298-439-842-389-739-842-983-498-248-945-848-957-897-897-893-759-874-598-598-459-825-892-498-695-825-892-989-485-849-528-969-828-929-843-984-238-973-984-298-349-824-894-584-895-789-789-789-375-987-459-859-845-982-589-249-869-582-589-298-948-584-952-896-982-892-984-398-423-897-398-429-834-982-489-458-489-578-978-978-937-598-745-985-984-598-258-924-986-958-258-929-894-858-495-289-698-289-298-439-842-389-739-842-983-498-248-945-848-957-897-897-893-759-874-598-598-459-825-892-498-695-825-892-989-485-849-528-969-828-929-843-984-238-973-984-298-349-824-894-584-895-789-789-789-375-987-459-859-845-982-589-249-869-582-589-298-948-584-952-896-982-892-984-398-423-897-398-429-834-982-489-458-489-578-978-978-937-598-745-985-984-598-258-924-986-958-258-929-894-858-495-289-698-289-298-439-842-389-739-842-983-498-248-945-848-957-897-897-893-759-874-598-598-459-825-892-498-695-825-892-989-485-849-528-969-828-929-843-984-238-973-984-298-349-824-894-584-895-789-789-789-375-987-459-859-845-982-589-249-869-582-589-298-948-584-952-896-982-892-984-398-423-897-398-429-834-982-489-458-489-578-978-978-937-598-745-985-984-598-258-924-986-958-258-929-894-858-495-289-698-289-298-439-842-389-739-842-983-498-248-945-848-957-897-897-893-759-874-598-598-459-825-892-498-695-825-892-989-485-849-528-969-828-929-843-984-238-973-984-298-349-824-894-584-895-789-789-789-375-987-459-859-845-982-589-249-869-582-589-298-948-584-952-896-982-892-984-398-423-897-398-429-834-982-489-458-489-578-978-978-937-598-745-985-984-598-258-924-986-958-258-929-894-858-495-289-698-289-298-439-842-389-739-842-983-498-248-945-848-957-897-897-893-759-874-598-598-459-825-892-498-695-825-892-989-485-849-528-969-828-929-843-984-238-973-984-298-349-824-894-584-895-789-789-789-375-987-459-859-845-982-589-249-869-582-589-298-948-584-952-896-982-892-984-398-423-897-398-429-834-982-489-458-489-578-978-978-937-598-745-985-984-598-258-924-986-958-258-929-894-858-495-289-698-289-298-439-842-389-739-842-983-498-248-945-848-957-897-897-893-759-874-598-598-459-825-892-498-695-825-892-989-485-849-528-969-828-929-843-984-238-973-984-298-349-824-894-584-895-789-789-789-375-987-459-859-845-982-589-249-869-582-589-298-948-584-952-896-982-892-984-398-423-897-398-429-834-982-489-458-489-578-978-978-937-598-745-985-984-598-258-924-986-958-258-929-894-858-495-289-698-289-298-439-842-389-739-842-983-498-248-945-848-957-897-897-893-759-874-598-598-459-825-892-498-695-825-892-989-485-849-528-969-828-929-843-984-238-973-984-298-349-824-894-584-895-789-789-789-375-987-459-859-845-982-589-249-869-582-589-298-948-584-952-896-982-892-984-398-423-897-398-429-834-982-489-458-489-578-978-978-937-598-745-985-984-598-258-924-986-958-258-929-894-858-495-289-698-289-298-439-842-389-739-842-983-498-248-945-848-957-897-897-893-759-874-598-598-459-825-892-498-695-825-892-989-485-849-528-969-828-929-843-984-2