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 java.io.*;
import java.util.*;
import java.util.List;


/**
 * Created by Katushka on 11.03.2020.
 */
public class Main {

    static void sortArray(int[] a) {
        Random random = new Random();

        for (int i = 0; i < a.length; i++) {
            int randomPos = random.nextInt(a.length);
            int t = a[i];
            a[i] = a[randomPos];
            a[randomPos] = t;
        }
        Arrays.sort(a);
    }

    static int[] readArray(int size, InputReader in, boolean subOne) {
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = in.nextInt() + (subOne ? -1 : 0);
        }
        return a;
    }

    static long[] readLongArray(int size, InputReader in) {
        long[] a = new long[size];
        for (int i = 0; i < size; i++) {
            a[i] = in.nextLong();
        }
        return a;
    }

    private static final boolean DEBUG = false;
    private static final long MOD = 1000000007;


    private static int[] getBinary(long a, int size) {
        int[] result = new int[size];
        for (int i = 0; i < size; i++) {
            result[i] = (int) ((a >> i) & 1);
        }
        return result;
    }

    private static long fastPow(long x, long y, long mod) {
        if (x == 1) {
            return 1;
        }
        if (y == 0) {
            return 1;
        }
        long p = fastPow(x, y / 2, mod) % mod;
        p = p * p % mod;
        if (y % 2 == 1) {
            p = p * x % mod;
        }
        return p;
    }

    private static long inv(long x, long mod) {
        return fastPow(x, mod - 2, mod);

    }

    private static long addMod(long x, long y, long mod) {
        long res = x + y;
        if (res >= mod) {
            return res - mod;
        }
        return res;
    }

    private static long multMod(long x, long y, long mod) {
        long res = x * y;
        if (res >= mod) {
            return res % mod;
        }
        return res;
    }

    private static long subMod(long x, long y, long mod) {
        long res = x - y;
        if (res < 0) {
            return res + mod;
        }
        return res;
    }

    private static final long P = 43;

    public static void main(String[] args) throws FileNotFoundException {
//        InputReader in = new InputReader(new FileInputStream("input.txt"));
//        PrintWriter out = new PrintWriter(new BufferedOutputStream(new FileOutputStream("seating.out")));

        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));


        String s = in.nextString();

        long start = System.currentTimeMillis();
        int n = s.length();
//        long[] pows = new long[n];
//        pows[0] = 1;
//
//        for (int i = 1; i < n; i++) {
//            pows[i] = pows[i - 1] * P;
//        }

//        long[] hs = new long[n + 1];
        char[] chars = new char[n];
        for (int i = 0; i < n; i++) {
            chars[i] = s.charAt(i);
//            hs[i + 1] = hs[i] + pows[i] * (chars[i] - 'a');
        }

        for (int k = 1; 2 * k <= n; k++) {
            int curLen = 0;
            for (int i = 0; i + k < n; i++) {
                if (chars[i] == chars[i + k]) {
                    curLen += 1;
                    if (curLen == k) {
                        for (int j = i + k + 1; j < n; j++) {
                            chars[j - k] = chars[j];
//                        hs[j - k + 1] = hs[j - k] + pows[j - k] * (chars[j - k] - 'a');
                        }
                        n -= k;
                        k = 0;
                        break;
                    }
                } else {
                    curLen = 0;
                }
            }
        }
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < n; i++) {
            str.append("" + chars[i]);
        }
        out.println(str.toString());
//        out.println(System.currentTimeMillis() - start);

        out.close();
    }

    private static boolean check(char[] chars, int i, int k, long[] hs, long[] pows) {
        return (hs[i + 2 * k] - hs[i + k]) == (hs[i + k] - hs[i]) * pows[k];
    }

    private static void outputArray(long[] ans, PrintWriter out, boolean addOne) {
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < ans.length; i++) {
            long an = ans[i] + (addOne ? 1 : 0);
            str.append(an).append('\t');
        }
        out.println(str);
        out.flush();
    }

    private static void outputArray(List<Long> ans, PrintWriter out) {
        StringBuilder str = new StringBuilder();
        for (long an : ans) {
            str.append(an).append(' ');
        }
        out.println(str);
        out.flush();
    }


    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

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

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

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

        public char nextChar() {
            return next().charAt(0);
        }

        public String nextWord() {
            return next();
        }

        private List<Integer>[] readTree(int n) {
            List<Integer>[] result = new ArrayList[n];
            for (int i = 0; i < n; i++) {
                result[i] = new ArrayList<>();
            }
            for (int i = 0; i < n - 1; i++) {
                int u = nextInt() - 1;
                int v = nextInt() - 1;
                result[u].add(v);
                result[v].add(u);
            }
            return result;
        }

    }
}