Algorithm


B. Phone numbers
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Phone number in Berland is a sequence of n digits. Often, to make it easier to memorize the number, it is divided into groups of two or three digits. For example, the phone number 1198733 is easier to remember as 11-987-33. Your task is to find for a given phone number any of its divisions into groups of two or three digits.

Input

The first line contains integer n (2 ≤ n ≤ 100) — amount of digits in the phone number. The second line contains n digits — the phone number to divide into groups.

Output

Output any of divisions of the given phone number into groups of two or three digits. Separate groups by single character -. If the answer is not unique, output any.

Examples
input
Copy
6
549871
output
Copy
54-98-71
input
Copy
7
1198733
output
Copy
11-987-33



 

Code Examples

#1 Code Example with C++ Programming

Code - C++ Programming

#include <iostream>
#include <string>

using namespace std;

int main() {
	int len, i;
	string s;
	cin >> len >> s;

	if (len % 2 == 0) {
		for (i = 0; i < len; i++) {
			if (i && i % 2 == 0)
				cout << '-';

			cout << s[i];
		}
	}
	else {
		for (i = 0; i < len - 3; i++) {
			if (i && i % 2 == 0)
				cout << '-';

			cout << s[i];
		}

		if(i)
			cout << '-';
		cout << s[len - 3];
		cout << s[len - 2];
		cout << s[len - 1];
	}

	cout << endl;

	return 0;
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
6
549871

Output

x
+
cmd
54-98-71
Advertisements

Demonstration


Codeforcess Solution Phone numbers B. Phone numbers C,C++, Java, Js and Python ,B. Phone numbers,Codeforcess Solution

Previous
Codeforces solution 1080-B-B. Margarite and the best present codeforces solution
Next
CodeChef solution DETSCORE - Determine the Score CodeChef solution C,C+