import java.awt.List;
import java.awt.geom.Arc2D.Double;
import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.StringTokenizer;

import javax.management.Query;

public class odin_nk {

	BufferedReader in;
	StringTokenizer str;
	PrintWriter out;

	String next() throws IOException {
		String help;
		while ((str == null) || (!str.hasMoreTokens())) {
			help = in.readLine();
			if (help == null) {
				return null;
			}
			str = new StringTokenizer(help);
		}
		return str.nextToken();
	}

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

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

	double a;
	double b;
	double x;

	public void solve() throws IOException {
		in = new BufferedReader(new FileReader("odin.in"));
		out = new PrintWriter("odin.out");
		String s = in.readLine();
		char[] stack = new char[s.length()];
		int t = -1;
		for (int i = 0; i< s.length(); i++){
			if (s.charAt(i) == '('){
				stack[++t] = s.charAt(i);
				if (t == 0){
					out.print('{');
					continue;
				}
				if (t == 1){
					out.print('[');
					continue;
				}
			}
			if (s.charAt(i)== ')'){
				t--;
				if (t == -1){
					out.print('}');
					continue;
				}
				if (t == 0){
					out.print(']');
					continue;
				}
			}
			out.print(s.charAt(i));
		}
		out.close();
	}

	static void myAssert(boolean b, String string) {
		if (!b) {
			throw new AssertionError(string);
		}
	}

	public static void main(String[] args) throws IOException {
		new odin_nk().solve();
	}
}