Problem: A substring of a string is a contiguous subsequence of that string. So, string bca is substring of string abcabc, but string cc is not.

A repeating block is a string formed by concatenating some string with itself. So, string abcabc is a repeating block, but strings abcabd, ababab are not.

You've got a sequence of Latin characters (string). At each step you find the shortest substring that is a repeating block, if there exists more than one you must choose the leftmost. As the substring is of form XX (X — some string) you replace this substring with X, in other words you delete one of the X substrings in the substring. You repeat this process until there remains no repeating block in the string. 

How would the final string looks like? Look at the sample explanation to understand the statement more precise.

Input

In the first line of input you're given a string of small Latin characters with length between 1 to 50000, inclusive.

Output

Print the final string after applying changes.

Examples

Input

abccabc


Output

abc


Input

aaaabaaab


Output

ab


Input

birdbirdbirdistheword


Output

birdistheword

Note

At the first sample the string transforms as follows: abccabc →  abcabc →  abc.

At the second sample the string transforms as follows: aaaabaaab →  aaabaaab →  aabaaab →  abaaab →  abaab →  abab →  ab.

Solution (in JAVA):

Solution:
import javax.swing.*;
import java.io.*;
import java.util.*;

public class CodeForces {
    static boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    int[] power, hash;
    int curlen;
    char[] str;

    int gethash(int start, int len) {
        return hash[start + len] - hash[start] * power[len];
    }

    int getLeft(int p1, int p2) {
        int left = 0;
        int right = p1;
        while (left < right) {
            int m = (left + right) >> 1;
            if (gethash(p1 - m, m) == gethash(p2 - m, m))
                left = m + 1;
            else
                right = m;
        }
        return left;
    }

    int getRight(int p1, int p2) {
        int left = 0;
        int right = Math.min(p2 - p1, curlen - p2);
        while (left < right) {
            int m = (left + right) >> 1;
            if (gethash(p1, m) == gethash(p2, m))
                left = m + 1;
            else
                right = m;
        }
        return left;
    }

    boolean checkLen(int len) {
        for (int i = 0; i + len < curlen; i += len) {
            if (getLeft(i, i + len) + getRight(i, i + len) >= len)
                return true;
        }
        return false;
    }

    void runCase(int caseNum) throws IOException {
        str = next().toCharArray();
        curlen = str.length;
        power = new int[curlen];
        power[0] = 1;
        for (int i = 1; i < curlen; ++i) {
            power[i] = power[i - 1] * 173;
        }
        hash = new int[curlen + 1];
        for (int i = 1; i <= curlen; ++i)
            hash[i] = hash[i - 1] * 173 + str[i - 1];
        for (int seg = 1; seg <= (curlen >> 1); ++seg) {
            if (!checkLen(seg))
                continue;
            int pos = 0;
            int i = 0;
            for (i = seg; i + seg <= curlen; ++i) {
                boolean match = false;
                if (gethash(pos, seg) == gethash(i, seg)) {
                    match = true;
                    for (int j = 0; j < seg; ++j) {
                        if (str[pos + j] != str[i + j]) {
                            match = false;
                            break;
                        }
                    }
                }
                if (match) {
                    i += seg - 1;
                } else {
                    str[pos + seg] = str[i];
                    ++pos;
                    hash[pos + seg] = hash[pos + seg - 1] * 173 + str[i];
                }
            }
            if (pos + seg != i) {
                for (; i < curlen; ++i) {
                    str[pos + seg] = str[i];
                    ++pos;
                    hash[pos + seg] = hash[pos + seg - 1] * 173 + str[i];
                }
                curlen = pos + seg;
            }
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < curlen; ++i)
            sb.append(str[i]);
        System.out.println(sb.toString());
    }

    public static void main(String[] args) throws IOException {
        if (ONLINE_JUDGE){
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }else{
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
        new CodeForces().runIt();
        out.flush();
        out.close();
        return;
    }

    static BufferedReader in;
    private StringTokenizer st;
    static PrintWriter out;

    String next() throws IOException {
        while (!st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line, " ");
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }


    void runIt() throws IOException {
        st = new StringTokenizer("");

//        int N = nextInt();
//        for (int i = 0; i < N; i++) {
//            runCase(i + 1);
//        }
        runCase(0);

        out.flush();
    }

}