import java.util.*;
class Ideone {
public static void main
(String[] args
) { final Scanner scanner
= new Scanner
(System.
in); int start = scanner.nextInt();
int end = scanner.nextInt();
final LinkedList<Range> left = leftBounds(start, end);
final Range lastLeft = left.removeLast();
final LinkedList<Range> right = rightBounds(lastLeft.getStart(), end);
final Range firstRight = right.removeFirst();
LinkedList<Range> merged = new LinkedList<>();
merged.addAll(left);
if (!lastLeft.overlaps(firstRight)) {
merged.add(lastLeft);
merged.add(firstRight);
} else {
merged.add(Range.join(lastLeft, firstRight));
}
merged.addAll(right);
merged.stream()
.map(Range::toRegex)
.
forEach(System.
out::println
); }
private static LinkedList<Range> leftBounds(int start, int end) {
final LinkedList<Range> result = new LinkedList<>();
while (start < end) {
final Range range = Range.fromStart(start);
result.add(range);
start = range.getEnd()+1;
}
return result;
}
private static LinkedList<Range> rightBounds(int start, int end) {
final LinkedList<Range> result = new LinkedList<>();
while (start < end) {
final Range range = Range.fromEnd(end);
result.add(range);
end = range.getStart()-1;
}
return result;
}
}
class Range {
private final int start;
private final int end;
public static Range fromEnd(int end) {
final char[] chars
= String.
valueOf(end
).
toCharArray(); for (int i=chars.length-1; i>=0;i--) {
if (chars[i] == '9') {
chars[i] = '0';
} else {
chars[i] = '0';
break;
}
}
}
public static Range fromStart(int start) {
final char[] chars
= String.
valueOf(start
).
toCharArray(); for (int i=chars.length-1; i>=0;i--) {
if (chars[i]=='0') {
chars[i] = '9';
} else {
chars[i] = '9';
break;
}
}
return new Range
(start,
Integer.
parseInt(String.
valueOf(chars
))); }
public static Range join(Range a, Range b) {
return new Range(a.start, b.end);
}
private Range(int start, int end) {
this.start = start;
this.end = end;
}
public int getStart() {
return start;
}
public int getEnd() {
return end;
}
public boolean overlaps(Range r) {
return end > r.start && r.end > start;
}
@Override
return String.
format("Range{start=%d, end=%d}", start, end
); }
final StringBuilder result = new StringBuilder();
for (int pos = 0; pos < startStr.length(); pos++) {
if (startStr.charAt(pos) == endStr.charAt(pos)) {
result.append(startStr.charAt(pos));
} else {
result.append('[')
.append(startStr.charAt(pos))
.append('-')
.append(endStr.charAt(pos))
.append(']');
}
}
return result.toString();
}
}