Some time ago Lesha found an entertaining string s consisting of lowercase English letters. Lesha immediately developed an unique algorithm for this string and shared it with you. The algorithm is as follows.

Lesha chooses an arbitrary (possibly zero) number of pairs on positions (i, i + 1) in such a way that the following conditions are satisfied: 

  * for each pair (i, i + 1) the inequality 0 ≤ i < |s| - 1 holds; 
  * for each pair (i, i + 1) the equality s_i = s_{i + 1} holds; 
  * there is no index that is contained in more than one pair. 

After that Lesha removes all characters on indexes contained in these pairs and the algorithm is over. 

Lesha is interested in the lexicographically smallest strings he can obtain by applying the algorithm to the suffixes of the given string.

Input

The only line contains the string s (1 ≤ |s| ≤ 10^5) — the initial string consisting of lowercase English letters only.

Output

In |s| lines print the lengths of the answers and the answers themselves, starting with the answer for the longest suffix. The output can be large, so, when some answer is longer than 10 characters, instead print the first 5 characters, then "...", then the last 2 characters of the answer.

Examples

Input


abcdd


Output


3 abc
2 bc
1 c
0 
1 d


Input


abbcdddeaaffdfouurtytwoo


Output


18 abbcd...tw
17 bbcdd...tw
16 bcddd...tw
15 cddde...tw
14 dddea...tw
13 ddeaa...tw
12 deaad...tw
11 eaadf...tw
10 aadfortytw
9 adfortytw
8 dfortytw
9 fdfortytw
8 dfortytw
7 fortytw
6 ortytw
5 rtytw
6 urtytw
5 rtytw
4 tytw
3 ytw
2 tw
1 w
0 
1 o

Note

Consider the first example.

  * The longest suffix is the whole string "abcdd". Choosing one pair (4, 5), Lesha obtains "abc". 
  * The next longest suffix is "bcdd". Choosing one pair (3, 4), we obtain "bc". 
  * The next longest suffix is "cdd". Choosing one pair (2, 3), we obtain "c". 
  * The next longest suffix is "dd". Choosing one pair (1, 2), we obtain "" (an empty string). 
  * The last suffix is the string "d". No pair can be chosen, so the answer is "d". 



In the second example, for the longest suffix "abbcdddeaaffdfouurtytwoo" choose three pairs (11, 12), (16, 17), (23, 24) and we obtain "abbcdddeaadfortytw"
/**
 * author: derrick20
 * created: 10/4/20 4:22 PM
 */
import java.io.*;
import java.util.*;

public class MinlexesRedo implements Runnable {
    public static void main(String[] args) throws Exception {
        new Thread(null, new MinlexesRedo(), ": )", 1 << 28).start();
    }

    public void run() {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        StringBuilder str = new StringBuilder(sc.next());
        str.reverse();
        char[] s = str.toString().toCharArray();
        int N = s.length;
        boolean[] safe = new boolean[N];
        StringBuilder[] lines = new StringBuilder[N];
        Arrays.setAll(lines, i -> new StringBuilder());
        lines[0].append(1).append(" ").append(s[0]);
        ArrayList<Integer> curr = new ArrayList<>();
        curr.add(0);
        for (int i = 1; i < N; i++) {
            /*
            Key bug:
            Need to only delete if they are actually adjacent.
            If our current last char = s[i - 1], this means
            that we have either:
            Let [x] be the current end of our string

            1. Leftover chars that are here because a gap was removed [a]cca
            2. Chars that are here that do not have a gap [a]a
            (Note a gap of the same char is removed greedily, so we
            would never have the case [a]aaa. It'd always be aa[a]a

            We eliminate the first case by checking that s[i] = s[i - 1]
            and that the last char of curr is s[i - 1].
            ACTUALLY we don't eliminate that case: consider [a]ccaaa
            The strongest test would be to check that index carried at the end of our
            string = i - 1. (Just modify how we store things)

            Thus, if the current string has 'a' at the end, then it MUST
            not have had a gap removed between it and the next char, and it
            MUST be the odd parity of some chunk of 'aaa...' (potentially of size 1)

            bbbccbbba
            bbbccbbb
             */
            if (curr.size() >= 1 && s[i] == s[i - 1] && i - 1 == curr.get(curr.size() - 1) && !safe[curr.size() - 1]) {
                curr.remove(curr.size() - 1); // don't append
            } else {
                if (curr.size() >= 1 && safe[curr.size() - 1] && s[i] == s[curr.get(curr.size() - 1)]) {
                    safe[curr.size()] = true;
                }
                curr.add(i);
                if (curr.size() >= 2) {
                    if (s[curr.get(curr.size() - 1)] < s[curr.get(curr.size() - 2)]) {
                        safe[curr.size() - 1] = true;
                    }
                }
            }
            lines[i].append(curr.size()).append(" ");
            if (curr.size() <= 10) {
                StringBuilder line = new StringBuilder();
                for (int j = 0; j < curr.size(); j++) {
                    line.append(s[curr.get(j)]);
                }
                line.reverse();
                lines[i].append(line);
            } else {
                for (int k = curr.size() - 1; k >= curr.size() - 5; k--) {
                    lines[i].append(s[curr.get(k)]);
                }
                lines[i].append("...");
                lines[i].append(s[curr.get(1)]).append(s[curr.get(0)]);
            }
        }
//        str.reverse();
        for (int i = N - 1; i >= 0; i--) {
//            out.println(str.substring(N - 1 - i) + " " + lines[i]);
            out.println(lines[i]);
        }
        out.close();
    }

    static class FastScanner {
        private int BS = 1 << 16;
        private char NC = (char) 0;
        private byte[] buf = new byte[BS];
        private int bId = 0, size = 0;
        private char c = NC;
        private double cnt = 1;
        private BufferedInputStream in;

        public FastScanner() {
            in = new BufferedInputStream(System.in, BS);
        }

        public FastScanner(String s) {
            try {
                in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
            } catch (Exception e) {
                in = new BufferedInputStream(System.in, BS);
            }
        }

        private char getChar() {
            while (bId == size) {
                try {
                    size = in.read(buf);
                } catch (Exception e) {
                    return NC;
                }
                if (size == -1) return NC;
                bId = 0;
            }
            return (char) buf[bId++];
        }

        public int nextInt() {
            return (int) nextLong();
        }

        public int[] nextInts(int N) {
            int[] res = new int[N];
            for (int i = 0; i < N; i++) {
                res[i] = (int) nextLong();
            }
            return res;
        }

        public long[] nextLongs(int N) {
            long[] res = new long[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextLong();
            }
            return res;
        }

        public long nextLong() {
            cnt = 1;
            boolean neg = false;
            if (c == NC) c = getChar();
            for (; (c < '0' || c > '9'); c = getChar()) {
                if (c == '-') neg = true;
            }
            long res = 0;
            for (; c >= '0' && c <= '9'; c = getChar()) {
                res = (res << 3) + (res << 1) + c - '0';
                cnt *= 10;
            }
            return neg ? -res : res;
        }

        public double nextDouble() {
            double cur = nextLong();
            return c != '.' ? cur : cur + nextLong() / cnt;
        }

        public double[] nextDoubles(int N) {
            double[] res = new double[N];
            for (int i = 0; i < N; i++) {
                res[i] = nextDouble();
            }
            return res;
        }

        public String next() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c > 32) {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }

        public String nextLine() {
            StringBuilder res = new StringBuilder();
            while (c <= 32) c = getChar();
            while (c != '\n') {
                res.append(c);
                c = getChar();
            }
            return res.toString();
        }

        public boolean hasNext() {
            if (c > 32) return true;
            while (true) {
                c = getChar();
                if (c == NC) return false;
                else if (c > 32) return true;
            }
        }
    }
    static void ASSERT(boolean assertion, String message) {
        if (!assertion) throw new AssertionError(message);
    }
    static void ASSERT(boolean assertion) {
        if (!assertion) throw new AssertionError();
    }
}