String can be called correct if it consists of characters "0" and "1" and there are no redundant leading zeroes. Here are some examples: "0", "10", "1001".You are given a correct string s.You can perform two different operations on this string:   swap any pair of adjacent characters (for example, "101"  "110");  replace "11" with "1" (for example, "110"  "10"). Let val(s) be such a number that s is its binary representation.Correct string a is less than some other correct string b iff val(a) < val(b).Your task is to find the minimum correct string that you can obtain from the given one using the operations described above. You can use these operations any number of times in any order (or even use no operations at all).

The first line contains integer number n (1 ≤ n ≤ 100) — the length of string s. The second line contains the string s consisting of characters "0" and "1". It is guaranteed that the string s is correct.

Print one string — the minimum correct string that you can obtain from the given one.

NoteIn the first example you can obtain the answer by the following sequence of operations: "1001"  "1010"  "1100"  "100".In the second example you can't obtain smaller answer no matter what operations you use.

import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String s=sc.next();
		String ss="1";
		int t=0;
		for(int i=0;i<n;i++) {
			if(s.charAt(i)=='0') {
				ss+=0;
				t++;
			}
		}
		if(t==n)
			ss="0";
		System.out.print(ss);
	}
}

import java.io.BufferedReader;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.ArrayList;
import java.util.Scanner;
//ArrayList<Integer> list = new ArrayList<Integer>();
import java.util.Collections;
public class LOL {

		public static void main( String[] args) throws IOException {
	Scanner sc=new Scanner(System.in);
	int n=sc.nextInt();
	String s=sc.nextLine();
	if(s.contains("1")==false) {
		System.out.println(s);
	}
	else {
	String m="1";
	for(int i=0; i<s.length() ; i++) {
		if(s.charAt(i)=='0') {
			m=m+s.charAt(i);
		}
	}
	System.out.println(m);
	}
		}
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}

		public long[] nextLongArr(int n) throws IOException {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextLong();
			return arr;
		}

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}

import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        byte n = in.nextByte();
        String s = in.next();
        char a[] = s.toCharArray();
        Arrays.sort(a);
        s = new String(a);
        if (s.indexOf('1') != -1)
        s = s.substring(0, s.indexOf('1')+1);
        for (int i = s.length()-1; i >= 0; i--) System.out.print(s.charAt(i));
    }
}

import java.io.BufferedReader;
import java.util.Scanner;

public class Codeforces {
    public static void main(String args[]){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        String s1 = s.next();
        if(s1.equals("0")){
            System.out.println(0);
            return;
        }
        int zcnt = 0;
        for(int i=0;i<n;i++){
            if(s1.charAt(i)=='0'){
                zcnt++;
            }
        }
        System.out.print("1");
        for(int i=0;i<zcnt;i++){
            System.out.print("0");
        }
    }
}

import java.util.ArrayList;
import java.util.Scanner;

public class MinBinaryNumber {

	public static void main(String[] args)
	{
		Scanner jk = new Scanner(System.in);
		int r = jk.nextInt();
		jk.nextLine();
		String x = jk.nextLine();
		String[] io = x.split("");
		ArrayList<Integer> ins = new ArrayList<Integer>();
		for (int i=0; i<io.length; i++)
		{
			ins.add(Integer.parseInt(io[i]));
		}
		int sec = 1;
		int fin = io.length;
		while (sec<fin)
		{
			//System.out.println(sec);
			if (ins.get(sec)==1)
			{
				ins.remove(sec);
				fin--;
			}
			else
			{
				sec++;
			}
		}
		String ans = "";
		for (int i=0; i<ins.size(); i++)
		{
			ans+=ins.get(i);
		}
		System.out.println(ans);
	}
}

import java.util.*;
public class HelloWorld{

     public static void main(String []args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
      //  String str=new String[n];
     String   str=sc.next();
        String str1="1";
        String str2="0";
        int count=0;
        for(int i=0;i<n;i++)
        {
            if(str.charAt(i)=='1')
            {
                count++;
            }
        }
        if(count!=0)
        {
        int c=n-count;

        for(int i=0;i<c;i++)
        {
            str1=str1+str2;

        }
        System.out.print(str1);}

        if(count==0)
        {
            System.out.print(str);
        }
        }
}

//package codeforces;

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int len = sc.nextInt();
		String str = sc.next();
		if (len < 2) {
			System.out.println(str);
		} else {
			String[] str_char = str.split("");
			StringBuffer sb = new StringBuffer("1");
			for (int i = 0; i < str_char.length; i++) {
				if(str_char[i].equals("0")){
					sb.append("0");
				}
			}
			System.out.println(sb);
		}

	}

}

import java.util.*;

public class MinBinary {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		input.nextLine();
		String s = input.nextLine();
		int count1 = 0;
		int count0 = 0;
		for (int i = 0; i<n; i++) {
			if (s.charAt(i)=='0') count0++;
			else count1++;
		}
		if (count1 == 0) {
			System.out.println(0);
		}
		else if (count0 == 0) {
				System.out.println("1");
		}
		else {
			System.out.print("1");
			for(int i = 0; i<count0; i++) {
				System.out.print(0);
			}
		}
	}
}

import java.io.*;
import java.util.*;

public class Solution
{
    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

    public static void main(String[] args) throws IOException
    {
        Scanner ob=new Scanner(System.in);
        //Reader ob=new Reader();
        int n = ob.nextInt();
        String s=ob.next();
        if(n==1)
        {
            System.out.println(s);
        }
        else
        {
            int cnt=0;
            System.out.print("1");
            for(int i=0;i<n;i++)
            {
                if(s.charAt(i)=='0')
                    System.out.print("0");
            }
        }
    }
}

import java.util.Scanner;

public class MinimumBinaryNumber {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextInt();
		String s = sc.next();
		System.out.print((s.charAt(0) == '1' ? "1" : "") + s.replace("1", ""));
		sc.close();
	}
}

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Arrays;
import java.math.BigInteger;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
     public static void main (String[] args) throws java.lang.Exception
     {
     	Scanner in =new Scanner(System.in);
		int n,j,t=1,i;
		//substring( //toCharArray();
		//Arrays.sort();
		String s1="",st="";
		int p,h,r,m,l,k;
		long x,y,z;
	     for(i=0;i<t;i++)
		{
		     p=0;h=0;
		     n=in.nextInt();
		     s1=in.next();
		     char c[]=s1.toCharArray();
		     if(n==1 && c[0]=='0')
		        s1="0";
		     else
		     {
    		     for(j=0;j<n;j++)
    		     {
    		          if(c[j]=='0')
    		               p++;
    		     }
    		     s1="1";
		     }
		     for(j=1;j<p+1;j++)
		          s1+="0";
		     System.out.println(s1);
		}
     }
}

import java.util.Scanner;

public class MinimumBinaryNumber {
    private String input;
    private int n;
    private Scanner scanner;

    public MinimumBinaryNumber(){
        scanner=new Scanner(System.in);
        int numberOfZeros=0;
        n=scanner.nextInt();
        input=scanner.next();
        if(input.equals("0")) {
            System.out.println("0");
            return;
        }
        for(int i=0; i<n; i++){
            if(input.charAt(i)=='0')
                numberOfZeros++;
        }
        String zeroz="";
        for(int i=0; i<numberOfZeros; i++)
            zeroz+='0';
        System.out.println('1'+zeroz);
    }

    public static void main(String [] args){
        new MinimumBinaryNumber();
    }
}

import java.util.*;
public class MyClass {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        String a = scan.next(),s = scan.next();
        int k=0,p=0;
        for(char i : s.toCharArray()){if(i=='0')k++;else p++;}
        if(p>0)System.out.print(1);
        for(;k>0;k--)System.out.print(0);
    }
}

import java.io.*;
import java.util.*;

public class Main {

    class Answer {
        int N;
        String str;

        public String solve() {
			StringBuilder zeros = new StringBuilder();
			for (int i = 0; i < str.length(); i++) {
				if ( str.charAt(i) == '0' ) {
					zeros.append("0");
				}
			}
			return (str.length() == zeros.length() ? "0" : "1" + zeros.toString());
        }

        public void main(FastScanner in, PrintWriter out) {
            N = in.nextInt();
            str = in.next();
            out.println( solve() );
        }
    }

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Main problem = new Main();
        Answer ans = problem.new Answer();
        ans.main(in, out);

        out.close();
        in.close();
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(InputStream in) { br = new BufferedReader(new InputStreamReader(in)); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try { st = new StringTokenizer(br.readLine()); }
                catch (IOException e) { e.printStackTrace(); }
            }
            return st.nextToken();
        }
        public String nextLine() {
            String str = "";
            try { str = br.readLine();
            } catch (IOException e) { e.printStackTrace(); }
            return str;
        }
        public void close() throws IOException { br.close(); }
    }
}

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.*;

public class A {

	public static void main(String args[]) {
		JS in = new JS();
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		String s = in.next();
		int one = 0;
		int zero = 0;
		for(int i = 0; i < s.length(); i++) {
			if(s.charAt(i) == '0') zero++;
			else one++;
		}
		if(one == 0) {
			System.out.println("0");
			return;
		}
		else{
			System.out.print("1");
			for(int i =0 ; i < zero; i++) System.out.print("0");
		}

		out.close();
	}

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

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

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			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 long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

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

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

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

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}

}

import java.io.*;
import java.util.*;

public class A764 {
    public static void main(String [] args) {
        InputStream inputReader = System.in;
        OutputStream outputReader = System.out;
        InputReader in = new InputReader(inputReader);
        PrintWriter out = new PrintWriter(outputReader);
        Algorithm solver = new Algorithm();
        solver.solve(in, out);
        out.close();
    }
}

class Algorithm {
    void solve(InputReader ir, PrintWriter pw) {

        int n = ir.nextInt(), total = 0;
        String line = ir.next(), result = "1";

        for (int i = 0; i < n; i++) if (line.charAt(i) == '0') total++;

        for (int i = 0; i < total; i++) result = result + '0';

        pw.print(n > 1 ? result : line);

    }

    private static void Qsort(int[] array, int low, int high) {

        int i = low;
        int j = high;
        int x = array[low + (high - low) / 2];

        do {
            while (array[i] < x) ++i;
            while (array[j] > x) --j;
            if (i <= j) {
                int tmp = array[i];
                array[i] = array[j];
                array[j] = tmp;
                i++;
                j--;
            }
        } while (i <= j);

        if (low < j) Qsort(array, low, j);
        if (i < high) Qsort(array, i, high);

    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    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();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }
    double nextDouble() {
        return Double.parseDouble(next());
    }
    long nextLong() {
        return Long.parseLong(next());
    }

}

import java.util.Arrays;
import java.util.Scanner;

public class Binary {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in =new Scanner (System.in);
		int n=in.nextInt();
		String s=in.next();
		char[] arr= s.toCharArray();
		Arrays.sort(arr);
		StringBuilder ans=new StringBuilder();
		for(int i=0;i<n;i++) {
			ans.append('0'==arr[i]?"0":"");
		}
		System.out.println((s.contains("1")?"1":"")+ans.toString());
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author The Viet Nguyen
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            char[] s = in.readCharArray(n);
            if (n == 1 && s[0] == '0') out.print(0);
            else {
                out.print(1);
                for (int i = 0; i < countZero(s); ++i) out.print(0);
            }
        }

        int countZero(char[] s) {
            int ans = 0;
            for (int i = 0; i < s.length; ++i) if (s[i] == '0') ++ans;
            return ans;
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object object) {
            writer.print(object);
        }

        public void close() {
            writer.close();
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public char[] readCharArray(int size) {
            char[] array = new char[size];
            for (int i = 0; i < size; i++) {
                array[i] = readCharacter();
            }
            return array;
        }

        public char readCharacter() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            return (char) c;
        }

        public int readInt() {
            return (int) readLong();
        }

        public long readLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public interface SpaceCharFilter {
            boolean isSpaceChar(int ch);

        }

    }
}

import java.util.Scanner;
public class ASeaBattle {

	public static void main(String[] args) {
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		  String s=sc.next();
         int p=0,q=0;
         for(int i=0;i<n;i++) {
        	 if(s.charAt(i)=='0') {
        		 p++;
        	 }
        	 else {
        		 q++;
        	 }

         }
         if(q>0) {

         System.out.print(1);
         for(int i=0;i<p;i++) {
        	 System.out.print(0);
         }
		 System.out.println();
         }
         else {
        	 System.out.println(0);
         }
                sc.close();

	}

}

import java.util.*;
import java.io.*;
import java.math.*;
public class hi{

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int nb = 0;
        boolean ok = false;
        for(int i=0;i<n;i++){
            if(s.charAt(i)=='0') nb++;
            if(s.charAt(i)=='1') ok = true;
        }
        if(ok) System.out.print("1");
        for(int i=0;i<nb;i++) System.out.print("0");
        System.out.println("");

    }

}

import java.util.Scanner;

public class meannn {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        String st=sc.next();int count=0;
        if(st.equals("0"))System.out.println("0");
        else
        {
        for(int i=0;i<a;i++)
        {
            if(st.charAt(i)=='0')count++;
        }
        System.out.print("1");
        for(int i=0;i<count;i++)
        {
            System.out.print("0");
        }
    }
}}

import java.util.*;
public class Minbin {
	public static void main(String[] args)
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		String s=in.next();
		char[] ch= new char[n];
		int[] a=new int[n];
		int count1=0,count2=0;
		for(int i=0;i<n;i++)
		{
			ch[i]=s.charAt(i);
			a[i]=Character.getNumericValue(ch[i]);
			if(a[i]==0)
			{
				count1++;
			}
			if(a[i]==1)
			{
				count2++;
			}
		}
		for(int i=0;i<n;i++)
		{
			if(a[i]==0)
			{
				count1--;
			}
			if(a[i]==1)
			{
				break;
			}
		}
		if(count2!=0)
		{
			System.out.print("1");
		for(int i=0;i<count1;i++)
		{
			System.out.print("0");
		}
	}
		else if (count2==0)
		{
			System.out.print("0");
		}

	}
}

import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String s=sc.next();
		String ss="1";
		int t=0;
		for(int i=0;i<n;i++) {
			if(s.charAt(i)=='0') {
				ss+=0;
				t++;
			}
		}
		if(t==n)
			ss="0";
		System.out.print(ss);
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Created by prituladima on 5/23/18.
 */
public class MinimumBinaryNumber {

    private void solve() throws IOException {
        int n = nextInt();
        String s = nextToken();
        if (s.matches("^1[0]*")) {
            System.out.println(s);
            return;
        }
        while (true) {
            if (s.contains("01")) s = s.replace("01", "10");
            if (s.contains("11")) s = s.replace("11", "1");
            if (!s.contains("01") && !s.contains("11")) break;
        }
        System.out.println(s);
    }

    public static void main(String[] args) {
        new MinimumBinaryNumber().run();
    }

    StringTokenizer tokenizer;
    BufferedReader reader;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

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

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

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

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    int[] nextArr(int size) throws NumberFormatException, IOException {
        int[] arr = new int[size];
        for (int i = 0; i < size; i++)
            arr[i] = nextInt();
        return arr;
    }

    long[] nextArrL(int size) throws NumberFormatException, IOException {
        long[] arr = new long[size];
        for (int i = 0; i < size; i++)
            arr[i] = nextLong();
        return arr;
    }

    double[] nextArrD(int size) throws NumberFormatException, IOException {
        double[] arr = new double[size];
        for (int i = 0; i < size; i++)
            arr[i] = nextDouble();
        return arr;
    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class A976 {

	public static void main(String[] args) {
		sc sc= new sc();
		int a = sc.nextInt();
		String s = sc.next();
		int z= countZ(s);
		if(s.equals("0"))
			System.out.println("0");
		else
		if (z==0)
			System.out.println("1");
		else {
			System.out.print("1");
			for (int i = 0; i < z; i++) {
				System.out.print("0");
			}
		}

	}
	public static int countZ (String s) {
		int x =0;
		for (int i = 0; i < s.length(); i++) {
			if(s.charAt(i)=='0')
				x++;
		}
		return x;
	}

}class sc {
	BufferedReader br;
	StringTokenizer st;

	public sc() {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	String next() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

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

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

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

	String nextLine() {
		String str = "";
		try {
			str = br.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return str;
	}
}

import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;

public class tr0 {
	static PrintWriter out;
	static StringBuilder sb;
	static int mod = 1000000007;
	static long inf = (long) 1e16;
	static ArrayList<Integer>[] ad;
	static int n, m, k;
	static long[][] memo;
	static int[] a;
	static HashSet<Integer> h;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n=sc.nextInt();
		String s=sc.nextLine();
		int o=0;
		for(int i=0;i<n;i++)
			if(s.charAt(i)=='1')
				o++;
		int z=n-o;
		if(o>0)
		out.print(1);
		while(z-->0)
			out.print(0);
		out.close();
	}

	public static BigInteger sqrt(BigInteger x) {
		BigInteger lo = BigInteger.ZERO;
		BigInteger hi = x;
		BigInteger ans = BigInteger.ONE;
		int i=0;
		while (lo.compareTo(hi) <= 0) {
			BigInteger mid = lo.add(hi);
			i++;
			if(i>100)
				return ans;
			mid = mid.shiftRight(1);
			BigInteger k = mid;
			mid = mid.multiply(mid);
			if (mid.compareTo(x) <= 0) {
				ans = k;
				lo = k.add(BigInteger.valueOf(1));
			} else {
                  hi=k.subtract(BigInteger.valueOf(1));
			}
		}
		return ans;
	}

	static void seive(int N) {
		si = new int[N];
		primes = new ArrayList<>();
		si[1] = 1;
		for (int i = 2; i < N; i++) {
			if (si[i] == 0) {
				si[i] = i;
				h.add(i);
				primes.add(i);
			}
			for (int j = 0; j < primes.size() && primes.get(j) <= si[i] && (i * primes.get(j)) < N; j++)
				si[primes.get(j) * i] = primes.get(j);
		}
	}

	static int[] si;
	static ArrayList<Integer> primes;

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

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

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

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

		public int[] nextArrInt(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextArrLong(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}

import java.io.BufferedReader;
import java.util.Scanner;

import java.util.Scanner;

public class Codeforces {
    public static void main(String args[]){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        String str = s.next();
        int zcnt = 0;
        if(str.equals("0")){
            System.out.println(0);
            return;
        }
        for(int i=0;i<n;i++){
            if(str.charAt(i)=='0') zcnt++;
        }
        System.out.print(1);
        while (zcnt-->0){
            System.out.print(0);
        }
    }
}

import java.io.BufferedReader;
import java.util.Scanner;

public class Codeforces {
    public static void main(String args[]){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        String s1 = s.next();
        if(s1.equals("0")){
            System.out.println(0);
            return;
        }
        int zcnt = 0;
        for(int i=0;i<n;i++){
            if(s1.charAt(i)=='0'){
                zcnt++;
            }
        }
        System.out.print("1");
        for(int i=0;i<zcnt;i++){
            System.out.print("0");
        }
    }
}

import java.util.Scanner;

public class MinimumBinaryNumber {
    private String input;
    private int n;
    private Scanner scanner;

    public MinimumBinaryNumber(){
        scanner=new Scanner(System.in);
        int numberOfZeros=0;
        n=scanner.nextInt();
        input=scanner.next();
        if(input.equals("0")) {
            System.out.println("0");
            return;
        }
        for(int i=0; i<n; i++){
            if(input.charAt(i)=='0')
                numberOfZeros++;
        }
        String zeroz="";
        for(int i=0; i<numberOfZeros; i++)
            zeroz+='0';
        System.out.println('1'+zeroz);
    }

    public static void main(String [] args){
        new MinimumBinaryNumber();
    }
}

import java.util.*;

public class q1 {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String s = sc.next();
    String[] out = s.split("");
    for(int i=0; i<n-1; i++) {
       if(!out[i].equals(out[i+1])) {
         String tmp = out[i];
         out[i] = out[i+1];
         out[i+1] = tmp;
       } else if(out[i].equals(out[i+1]) && out[i].equals("1")){
         out[i] = "-1";
       }
    }
    for( int i=n-1;i>=0;i-- ) {
      if( out[n-1].equals("0") && n!=1 ) {
        out[n-1] = "-1";
      }
       if(out[i] != "-1") {
        System.out.print(out[i]);
      }
    }
  }
}

import java.io.*;
import java.util.*;

public class Main {

    static StringBuilder data = new StringBuilder();
    final static FastReader in = new FastReader();

    public static void main(String[] args) {
       int n=in.nextInt();
       String s=in.nextLine();
   int c=0;
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i)=='0'){
                data.append(0);
            }else if(c==0){
                data.append(1);
                c++;
            }

        }
        System.out.println(data);
    }

    static void fileOut(String s) {
        File out = new File("output.txt");
        try {
            FileWriter fw = new FileWriter(out);
            fw.write(s);
            fw.flush();
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        public FastReader(String path) {
            try {
                br = new BufferedReader(new
                        InputStreamReader(new FileInputStream(path)));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        float nextFloat() {
            return Float.parseFloat(next());
        }

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String S = sc.next();
    sc.close();

    String[] s = S.split("");

    int[] v = new int[2];

    for (int i = 0; i < n; i++) {
      int l = Integer.valueOf(s[i]);
      v[l]++;
    }

    if (S.equals("0")) {
      System.out.println("0");
    } else {
      System.out.print("1");
      for (int i = 0; i < v[0]; i++) {
        System.out.print("0");
      }
      System.out.println("");
    }

  }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ProblemAMinimumBinaryNumber solver = new ProblemAMinimumBinaryNumber();
        solver.solve(1, in, out);
        out.close();
    }

    static class ProblemAMinimumBinaryNumber {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            String s = in.next();
            if (n == 1) {
                out.println(s);
                return;
            }
            int ones = 0;
            for (char c : s.toCharArray()) if (c == '1') ++ones;
            int zeros = n - ones;
            out.print(1);
            for (int i = 0; i < zeros; ++i) {
                out.print(0);
            }
            out.println();
        }

    }

    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 int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.util.*;
public class A {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        String s = in.next();
        char[] c = s.toCharArray();
        if (c[0] == '0') {
            System.out.println("0");
            return;
        }

        int c0 = 0;
        for (char ch : c) {
            if (ch == '0') c0++;
        }

        StringBuilder sb = new StringBuilder();
        sb.append("1");
        for (int i = 0; i < c0; i++)  sb.append("0");
        System.out.println(sb.toString());
    }
}

import java.util.*;
import java.io.*;
import java.math.*;
public class hi{

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int nb = 0;
        boolean ok = false;
        for(int i=0;i<n;i++){
            if(s.charAt(i)=='0') nb++;
            if(s.charAt(i)=='1') ok = true;
        }
        if(ok) System.out.print("1");
        for(int i=0;i<nb;i++) System.out.print("0");
        System.out.println("");

    }

}

import java.util.Scanner;

/**
 *
 * @author paras
 */
public class binarystring {
    public static void main(String[] args) {
        Scanner ob=new Scanner(System.in);
        int n=ob.nextInt();
    char a[]=ob.next().toCharArray();
   StringBuilder anb=new StringBuilder();
  anb.append(a[0]);
   for(int i=1;i<a.length;i++)
   {
       if(a[i]=='0')
       {
           anb.append('0');
       }
   }
        System.out.println(anb.toString());
    }

}

import java.io.*;

public class minimumBinaryNumber {
    public static void main(String[]args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int lenghtNumber = Integer.parseInt(br.readLine());
        char binaryNumber[] = br.readLine().toCharArray();

        if(lenghtNumber == binaryNumber.length) {
            for (int i = 0; i < binaryNumber.length; i++) {
                if(i==0) {
                    System.out.print(binaryNumber[i]);
                } else if(binaryNumber[i] == '0'){
                    System.out.print(binaryNumber[i]);
                }
            }
        }

    }
}

//package geometry;
import java.io.*;
import java.util.*;
import java.util.Map.Entry;

import java.text.*;
import java.math.*;
import java.util.regex.*;

import java.awt.Point;
/**
 *
 * @author prabhat // use stringbuilder,TreeSet, priorityQueue
 */
   public class  point4{
   public  static long[] BIT;
   public  static long[] tree;
   public  static long[] sum;
   public  static int mod=1000000007;
   public  static int[][] dp;
   public  static boolean[][] isPalin;
   public  static int max1=1000010;
   public  static int[][] g;
   public  static LinkedList<Pair> l[];
   public  static int n,m,q,k,t,a[],b[],arr[],cnt[],chosen[],pos[],val[],blocksize,count;
   public  static long V[],low,high,min=Long.MAX_VALUE,cap[],has[],ans,max,pre[];
   public  static ArrayList<Integer> adj[],al;
   public  static TreeSet<Integer> ts;
   public  static   char s[];
   public  static int depth,mini,maxi;
   public  static boolean visit[][],isPrime[],used[];
   public  static int[][] dist;
   public  static ArrayList<Integer>prime;
   public  static int[] x={0,1};
   public  static int[] y={-1,0};
   public  static ArrayList<Integer> divisor[]=new ArrayList[1500005];
   public  static  int[][] subtree,parent,mat;
   public  static  TreeMap<Integer,Integer> tm;
   public  static LongPoint[] p;
   public  static int[][] grid,memo;
   public  static ArrayList<Pair> list;
   public  static TrieNode root;
   public  static  LinkedHashMap<String,Integer> map;
   public  static ArrayList<String> al1;
   public static int upper=(int)(1e7);
   public  static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   public  static void main(String[] args) throws Exception
   {
   	   InputReader in = new InputReader(System.in);
	   PrintWriter pw=new PrintWriter(System.out);
	  n=in.ii();
	  s=in.is().toCharArray();
	  int z=0;
	  for(char c:s)if(c=='0')z++;
	  int o=n-z;
	  String s="";
	  for(int i=0;i<z;i++)s+='0';
	 if(o>0) s='1'+s;
	 else s="0";
	  pw.println(s);
	 /* n=in.ii();
	  long ans=0;
	  Point[] p=new Point[n];
	  for(int i=0;i<n;i++)
	   {
		  p[i]=new Point(in.ii(),in.ii());
	   }
	   for(int i=0;i<n;i++)
	   {
		   if(orient(p[i],p[(i+1)%n],p[(i+2)%n])<0)ans++;
	   }
	   pw.println(ans);*/
	   pw.close();
}
static void Seive()
{
	isPrime=new boolean[upper+1];
	Arrays.fill(isPrime,false);

	for(int i=2;i<=(upper);i++)
	{
		if(!isPrime[i])
		{
			for(int j=1;j*i<=upper;j++)
			{
				isPrime[j*i]=true;
				pre[i]+=cnt[j*i];
			}
		}
	}
}
static int orient(Point a,Point b,Point c)
{
	//return (int)(c.x-a.x)*(int)(b.y-a.y)-(int)(c.y-a.y)*(int)(b.x-a.x);
	Point p1=c.minus(a);
	Point p2=b.minus(a);
	return (int)(p1.cross(p2));
}
public static class Polygon {

	static final double EPS = 1e-15;
	public int n;
	public Point p[];

	Polygon(int n, Point x[]) {
		this.n = n;
		p = Arrays.copyOf(x, n);
	}

	long area(){ //returns 2 * area
		long ans = 0;
		for(int i = 1; i + 1 < n; i++)
			ans += p[i].minus(p[0]).cross(p[i + 1].minus(p[0]));
		return ans;
	}

	boolean PointInPolygon(Point q) {
		boolean c = false;
		for (int i = 0; i < n; i++){
			int j = (i+1)%n;
			if ((p[i].y <= q.y && q.y < p[j].y ||
					p[j].y <= q.y && q.y < p[i].y) &&
					q.x < p[i].x + (p[j].x - p[i].x) * (q.y - p[i].y) / (p[j].y - p[i].y))
			c = !c;
		 }
		return c;
	}

		// determine if point is on the boundary of a polygon
	boolean PointOnPolygon(Point q) {
		 for (int i = 0; i < n; i++)
		 if (ProjectPointSegment(p[i], p[(i+1)%n], q).dist(q) < EPS)
			 return true;
		 return false;
	}

	// project point c onto line segment through a and b
	Point ProjectPointSegment(Point a, Point b, Point c) {
	  double r = b.minus(a).dot(b.minus(a));
	  if (Math.abs(r) < EPS) return a;
	  r = c.minus(a).dot(b.minus(a))/r;
	  if (r < 0) return a;
	  if (r > 1) return b;
	  return a.plus(b.minus(a).mul(r));
	}
}

public static class Point {
	public double x, y;

	public Point(double x, double y) {
		this.x = x;
		this.y = y;
	}

	public Point minus(Point b) {
		return new Point(x - b.x, y - b.y);
	}

	public Point plus(Point a){
		return new Point(x + a.x, y + a.y);
	}

	public double cross(Point b) {
		return (double)x * b.y - (double)y * b.x;
	}

	public double dot(Point b) {
		return (double)x * b.x + (double)y * b.y;
	}

	public Point mul(double r){
		return new Point(x * r, y * r);
	}

	public double dist(Point p){
		return Math.sqrt(fastHypt( x - p.x , y - p.y));
	}

	public double fastHypt(double x, double y){
		return x * x + y * y;
	}
}
static class Query implements Comparable<Query>{
	int index,k;
	int L;
	int R;
	public Query(){}
	public Query(int a,int b,int index)
	{
	  this.L=a;
	  this.R=b;
	  this.index=index;
	}
   public int compareTo(Query o)
   {
	  if(L/blocksize!=o.L/blocksize)return L/blocksize-o.L/blocksize;
	  else return R-o.R;
   }

 }

static double dist(Point p1,Point p2)
{
	return Math.sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
}

static class coder {
	int indx;
	String name;
	coder(int indx,String name)
	{
		this.indx=indx;
		this.name=name;
	}
}
static class TrieNode
{
	int value;  // Only used in leaf nodes
	int freq;
	TrieNode[] arr =  new TrieNode[2];
	public TrieNode() {
		value = 0;
		freq=0;
		arr[0] = null;
		arr[1] = null;
	}
}
static void insert(int pre_xor,int add)
{
	TrieNode temp = root;

	// Start from the msb, insert all bits of
	// pre_xor into Trie
	for (int i=31; i>=0; i--)
	{
		// Find current bit in given prefix
		int val = (pre_xor & (1<<i)) >=1 ? 1 : 0;

		// Create a new node if needed
		if (temp.arr[val] == null)
			temp.arr[val] = new TrieNode();

		temp = temp.arr[val];
		temp.freq+=add;
	}

	// Store value at leaf node
	//temp.value = pre_xor;
}

static long query(int pre_xor)
{
	TrieNode temp = root;
	long ans=0;
	for (int i=31; i>=0; i--)
	{
		// Find current bit in given prefix
		int val = (pre_xor & (1<<i)) >= 1 ? 1 : 0;

		if(temp.arr[1-val]!=null&&temp.arr[1-val].freq>0)
		{
			ans|=1l<<i;
			temp=temp.arr[1-val];
		}
        else if(temp.arr[val]!=null&&temp.arr[val].freq>0)
            temp=temp.arr[val];
		else break;
	}
	return ans;
}
static void update(int indx,long val)
   {
	   while(indx<max1)
	   {
		   BIT[indx]+=val;
		   indx+=(indx&(-indx));
	   }

   }
static long query1(int indx)
   {
	   long sum=0;
	   while(indx>0)
	   {
		  sum+=BIT[indx];
		   indx-=(indx&(-indx));
	   }
	   return sum;
	}

static int gcd(int a, int b)
{
	int res=0;
	while(a!=0)
	{
		res=a;
		a=b%a;
		b=res;
	}
	return b;
}
static slope getSlope(Point p, Point q)
	{
		int dx = (int)(q.x - p.x), dy = (int)(q.y - p.y);
		int g = gcd(dx, dy);
		return new slope(dy / g, dx / g);
	}

static class slope implements Comparable<slope>
{
	int x,y;
	public slope(int y,int x)
	{
		this.x=x;
		this.y=y;
	}
	public int compareTo(slope s)
	{
		if(s.y!=y)return y-s.y;
	return x-s.x;
	}
}

static class Ball implements Comparable
	{
		int r;
		int occ;
		public Ball(int r,int occ)
		{
			this.r = r;
			this.occ = occ;
		}
		@Override
		public int compareTo(Object o) {
			Ball b = (Ball) o;
			return b.occ-this.occ;
		}
	}

static class E implements Comparable<E>{
	int x,y;
	char c;
	E(int  x,int y,char c)
	{
		this.x=x;
		this.y=y;
		this.c=c;
	}
	public int compareTo(E o)
	{
		if(x!=o.x)return o.x-x;
		else return y-o.y;

	}
}

static ArrayList<String> dfs(String s,String[] sarr,HashMap<String, ArrayList<String>> map)
{
   if(map.containsKey(s))return map.get(s);
   ArrayList<String> res=new ArrayList<>();
   if(s.length()==0)
   {
	   res.add("");
	   return res;
   }

   for(String word:sarr)
   {
	   if(s.startsWith(word))
	   {
		   ArrayList<String > sub=dfs(s.substring(word.length()),sarr,map);
		   for(String s2:sub)
		   {
			   res.add(word+ (s2.isEmpty() ? "" : " ")+s2);
		   }
	   }
   }
   map.put(s,res);
   return res;
}
static class SegmentTree{

  int n;
  int max_bound;

  public SegmentTree(int n)
  {

	  this.n=n;
	  tree=new long[4*n+1];
	  build(1,0,n-1);
  }
void build(int c,int s,int e)
{
   if(s==e)
   {
	   tree[c]=arr[s];
	   return ;
   }

   int mid=(s+e)>>1;
   build(2*c,s,mid);
   build(2*c+1,mid+1,e);
   tree[c]=(tree[2*c]&tree[2*c+1]);
}
void put(int c,int s, int e,int l,int r,int  v) {
	if(l>e||r<s||s>e)return ;
	if (s == e)
	{
		tree[c] = arr[s]^v;
		return;
	}
	int mid = (s + e) >> 1;
	if (l>mid) put(2*c+1,m+1, e , l,r, v);
	else if(r<=mid)put(2*c,s,m,l,r , v);
	else{

	}

}
long query(int c,int s,int e,int l,int r)
{
   if(e<l||s>r)return 0L;

   if(s>=l&&e<=r)
   {
	return tree[c];
   }

	int mid=(s+e)>>1;
	long ans=(1l<<30)-1;
	if(l>mid)return query(2*c+1,mid+1,e,l,r);
	else if(r<=mid)return query(2*c,s,mid,l,r);
	else{
		return query(2*c,s,mid,l,r)&query(2*c+1,mid+1,e,l,r);
	}

 }
}

   public static ListNode removeNthFromEnd(ListNode a, int b) {

    int cnt=0;
	ListNode ra1=a;
	ListNode ra2=a;
	while(ra1!=null){ra1=ra1.next; cnt++;}

	if(b>cnt)return a.next;
	else if(b==1&&cnt==1)return null;
	else{
		int y=cnt-b+1;
		int u=0;
		ListNode prev=null;
		while(a!=null)
		{
			u++;
		   if(u==y)
		   {
			   if(a.next==null)prev.next=null;
			   else
			   {
				   if(prev==null)return ra2.next;
				   prev.next=a.next;
				   a.next=null;
			   }
			   break;
		   }
		   prev=a;
		   a=a.next;
		}
	}
	return ra2;
}
   static ListNode rev(ListNode a)
   {
       ListNode prev=null;
       ListNode cur=a;
       ListNode next=null;
       while(cur!=null)
       {
           next=cur.next;
           cur.next=prev;
           prev=cur;
           cur=next;
       }
       return prev;
   }

  static class ListNode {
	     public int val;
	     public ListNode next;
	     ListNode(int x) { val = x; next = null; }
	 }

   public static String add(String s1,String s2)
   {
	   int n=s1.length()-1;
	   int m=s2.length()-1;
	   int rem=0;
	   int carry=0;
	   int i=n;
	   int j=m;
	   String ans="";
	   while(i>=0&&j>=0)
	   {
		 int c1=(int)(s1.charAt(i)-'0');
		 int c2=(int)(s2.charAt(j)-'0');
		 int sum=c1+c2;
		 sum+=carry;
		 rem=sum%10;
		 carry=sum/10;
         ans=rem+ans;
		  i--; j--;

	   }
	   while(i>=0)
	   {
		int c1=(int)(s1.charAt(i)-'0');

		int sum=c1;
		sum+=carry;
		rem=sum%10;
		carry=sum/10;
		ans=rem+ans;
		i--;
	   }
	   while(j>=0)
	   {

		int c2=(int)(s2.charAt(j)-'0');
		int sum=c2;
		sum+=carry;
		rem=sum%10;
		carry=sum/10;
		ans=rem+ans;
		j--;
	   }

	   if(carry>0)ans=carry+ans;
	   return ans;
   }
   public static String[] multiply(String A, String B) {
	int lb=B.length();
	char[] a=A.toCharArray();
	char[] b=B.toCharArray();
	String[] s=new String[lb];
	int cnt=0;
	int y=0;
	String s1="";
q=0;
	for(int i=b.length-1;i>=0;i--)
	{
		int rem=0;
		int carry=0;

		for(int j=a.length-1;j>=0;j--)
		{
			int mul=(int)(b[i]-'0')*(int)(a[j]-'0');
			mul+=carry;
			rem=mul%10;
			carry=mul/10;
			s1=rem+s1;
		}
		s1=carry+s1;
		s[y++]=s1;
		q=Math.max(q,s1.length());
		s1="";
		for(int i1=0;i1<y;i1++)s1+='0';

	}
	return s;
}
   public static long nCr(long total, long choose)
   {
	   if(total < choose)
		   return 0;
	   if(choose == 0 || choose == total)
		   return 1;
	   return nCr(total-1,choose-1)+nCr(total-1,choose);
   }

   static int get(long s)
   {
	  int ans=0;
	  for(int i=0;i<n;i++)
	  {
		  if(p[i].x<=s&&s<=p[i].y)ans++;
	  }
	  return ans;
   }
   static class LongPoint {
	public long x;
	public long y;

	public LongPoint(long x, long y) {
		this.x = x;
		this.y = y;
	}

	public LongPoint subtract(LongPoint o) {
		return new LongPoint(x - o.x, y - o.y);
	}

	public long cross(LongPoint o) {
		return x * o.y - y * o.x;
	}

}
    static int CountPs(String s,int n)
       {
    	boolean b=false;
    	     char[] S=s.toCharArray();
	       int[][] dp=new int[n][n];
	       boolean[][] p=new boolean[n][n];
	       for(int i=0;i<n;i++)p[i][i]=true;

	       for(int i=0;i<n-1;i++)
	       {
	    	   if(S[i]==S[i+1])
	    	   {
	    		p[i][i+1]=true;
	    		dp[i][i+1]=0;
	    		b=true;
	    	   }
	       }

	       for(int gap=2;gap<n;gap++)
	       {
	    	   for(int i=0;i<n-gap;i++)
	    	   {
	    		   int j=gap+i;
	    		   if(S[i]==S[j]&&p[i+1][j-1]){p[i][j]=true;}

	    		  if(p[i][j])
	    			   dp[i][j]=dp[i][j-1]+dp[i+1][j]+1-dp[i+1][j-1];

	    		   else if(!p[i][j]) dp[i][j]=dp[i][j-1]+dp[i+1][j]-dp[i+1][j-1];

	    		   //if(dp[i][j]>=1)
                             //  return true;
	    	   }
	       }

	   // return b;
    return dp[0][n-1];

    }

  static long divCeil(long a,long b)
  {
      return (a+b-1)/b;
  }
  static long root(int pow, long x) {
        long candidate = (long)Math.exp(Math.log(x)/pow);
        candidate = Math.max(1, candidate);
        while (pow(candidate, pow) <= x) {
            candidate++;
        }
        return candidate-1;
    }

    static long pow(long x, int pow)
    {
        long result = 1;
        long p = x;
        while (pow > 0) {
            if ((pow&1) == 1) {
                if (result > Long.MAX_VALUE/p) return Long.MAX_VALUE;
                result *= p;
            }
            pow >>>= 1;
            if (pow > 0 && p >= 4294967296L) return Long.MAX_VALUE;
            p *= p;
        }
        return result;
    }

  static boolean valid(int i,int j)
  {
	  if(i>=0&&i<n&&j>=0&&j<m)return true;
	  return false;
  }
  private static class DSU{
		int[] parent;
		int[] rank;
		int cnt;
		public DSU(int n){
			parent=new int[n];
			rank=new int[n];
			for(int i=0;i<n;i++){
				parent[i]=i;
				rank[i]=1;
			}
			cnt=n;
		}
		int find(int i){
	        while(parent[i] !=i){
	        	parent[i]=parent[parent[i]];
	        	i=parent[i];
	        }
	        return i;
	    }
		int Union(int x, int y){
	        int xset = find(x);
	        int yset = find(y);
	        if(xset!=yset)
	        	cnt--;
	        if(rank[xset]<rank[yset]){
	        	parent[xset] = yset;
		        rank[yset]+=rank[xset];
		        rank[xset]=0;
		        return yset;
	        }else{
	        	parent[yset]=xset;
	        	rank[xset]+=rank[yset];
	        	rank[yset]=0;
	        	return xset;
	        }
	    }
	}
  public static int[][] packU(int n, int[] from, int[] to, int max) {

	    int[][] g = new int[n][];
	    int[] p = new int[n];
	    for (int i = 0; i < max; i++) p[from[i]]++;
	    for (int i = 0; i < max; i++) p[to[i]]++;
	    for (int i = 0; i < n; i++) g[i] = new int[p[i]];
	    for (int i = 0; i < max; i++) {
	        g[from[i]][--p[from[i]]] = to[i];
	        g[to[i]][--p[to[i]]] = from[i];
	    }
	    return g;
	}
	public static int[][] parents3(int[][] g, int root) {
	    int n = g.length;
	    int[] par = new int[n];
	    Arrays.fill(par, -1);

	    int[] depth = new int[n];
	    depth[0] = 0;

	    int[] q = new int[n];
	    q[0] = root;
	    for (int p = 0, r = 1; p < r; p++) {
	        int cur = q[p];
	        for (int nex : g[cur]) {
	            if (par[cur] != nex) {
	                q[r++] = nex;
	                par[nex] = cur;
	                depth[nex] = depth[cur] + 1;
	            }
	        }
	    }
	    return new int[][]{par, q, depth};
	}
	public static int lower_bound(int[] nums, int target) {
        int low = 0, high = nums.length - 1;
        while (low < high) {
            int mid = low + (high - low) / 2;
            if (nums[mid] < target)
                low = mid + 1;
            else
                high = mid;
        }
        return nums[low] == target ? low : -1;
    }

    public static int upper_bound(int[] nums, int target) {
        int low = 0, high = nums.length - 1;
        while (low < high) {
            int mid = low + (high + 1 - low) / 2;
            if (nums[mid] > target)
                high = mid - 1;
            else
                low = mid;
        }
        return nums[low] == target ? low : -1;
    }
  public static boolean palin(String s)
	{
	   int i=0;
	   int j=s.length()-1;
	   while(i<j)
	   {
		   if(s.charAt(i)==s.charAt(j))
		   {
			   i++;
			   j--;
		   }
		   else return false;
	   }
	   return true;
	}

static int lcm(int a,int b)
{
	return (a*b)/(gcd(a,b));
}

public static long pow(long n,long p,long m)
{
	 long  result = 1;
	  if(p==0)
	    return 1;

	while(p!=0)
	{
	    if(p%2==1)
	        result *= n;
	    if(result>=m)
	    result%=m;
	    p >>=1;
	    n*=n;
	    if(n>=m)
	    n%=m;
	}
	return result;
}

    /**
     *
     * @param n
     * @param p
     * @return
     */
    public static long pow(long n,long p)
     {
	long  result = 1;
	  if(p==0)
	    return 1;
	if (p==1)
	    return n;
	while(p!=0)
	{
	    if(p%2==1)
	        result *= n;
	    p >>=1;
	    n*=n;
	}
	return result;

     }

static class Edge implements Comparator<Edge> {
	private int u;
	private int v;
	private long w;
	public Edge() {
	}
	public Edge(int u, int v, long w) {
		this.u=u;
		this.v=v;
		this.w=w;
	}
	public int getU() {
		return u;
	}
	public void setU(int u) {
		this.u = u;
	}
	public int getV() {
		return v;
	}
	public void setV(int v) {
		this.v = v;
	}
	public long getW() {
		return w;
	}
	public void setW(int w) {
		this.w = w;
	      }
	public long compareTo(Edge e)
	  {
		return (this.getW() - e.getW());
	}

        @Override
        public int compare(Edge o1, Edge o2) {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }

}

static class Pair implements Comparable<Pair>
{
	int x,y;
	Pair (int a,int b)
	{
		this.x=a;
		this.y=b;
	}

	public int compareTo(Pair o) {
		// TODO Auto-generated method stub
		if(this.x!=o.x)
		return -Integer.compare(this.x,o.x);
		else
			return -Integer.compare(this.y, o.y);
		//return 0;
	}
	public boolean equals(Object o) {
       if (o instanceof Pair) {
           Pair p = (Pair)o;
           return p.x == x && p.y == y;
       }
       return false;
   }
   public int hashCode() {
       return new Integer(x).hashCode() * 31 + new Integer(y).hashCode();
   }
}

static  class InputReader
{
   private InputStream stream;
   private byte[] buf = new byte[1024];

   private SpaceCharFilter filter;
    byte inbuffer[] = new byte[1024];
   int lenbuffer = 0, ptrbuffer = 0;
    final int M = (int) 1e9 + 7;
   int md=(int)(1e7+1);
    int[] SMP=new int[md];
   final double eps = 1e-6;
   final double pi = Math.PI;

	PrintWriter out;
   String check = "";
 InputStream   obj = check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
   public InputReader(InputStream stream)
   {
       this.stream = stream;
   }

    int readByte() {
	        if (lenbuffer == -1) throw new InputMismatchException();
	        if (ptrbuffer >= lenbuffer) {
	            ptrbuffer = 0;
	            try {
	                lenbuffer = obj.read(inbuffer);
	            } catch (IOException e) {
	                throw new InputMismatchException();
	            }
	        }
	        if (lenbuffer <= 0) return -1;
	        return inbuffer[ptrbuffer++];
   }

   public  int read()
   {
       int c = read();
       while (isSpaceChar(c))
           c = read();
       int sgn = 1;
       if (c == '-')
       {
           sgn = -1;
           c = read();
       }
       int res = 0;
       do
       {
           if (c < '0' || c > '9')
               throw new InputMismatchException();
           res *= 10;
           res += c - '0';
           c = read();
       } while (!isSpaceChar(c));
       return res * sgn;
   }

   String is() {
	        int b = skip();
	        StringBuilder sb = new StringBuilder();
	        while (!(isSpaceChar(b))) // when nextLine, (isSpaceChar(b) && b!=' ')
	        {
	            sb.appendCodePoint(b);
	            b = readByte();
	        }
	        return sb.toString();
   }
   public   int ii() {
	        int num = 0, b;
	        boolean minus = false;
	        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	        if (b == '-') {
	            minus = true;
	            b = readByte();
	        }
	        while (true) {
	            if (b >= '0' && b <= '9') {
	                num = num * 10 + (b - '0');
	            } else {
	                return minus ? -num : num;
	            }
	            b = readByte();
	        }
   }
 public   long il() {
	        long num = 0;
	        int b;
	        boolean minus = false;
	        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	        if (b == '-') {
	            minus = true;
	            b = readByte();
	        }
	        while (true) {
	            if (b >= '0' && b <= '9') {
	                num = num * 10 + (b - '0');
	            } else {
	                return minus ? -num : num;
	            }
	            b = readByte();
	        }
   }

	    boolean isSpaceChar(int c) {
	        return (!(c >= 33 && c <= 126));
	       }

	      int skip()
	        {
	        int b;
	        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
	        return b;
	        }

	    float nf() {
	        return Float.parseFloat(is());
	    }

	    double id() {
	        return Double.parseDouble(is());
	    }

	    char ic() {
	        return (char) skip();
	    }

	    int[] iia(int n) {
	        int a[] = new int[n];
	        for (int i = 0; i<n; i++) a[i] = ii();
	        return a;
	    }

	    long[] ila(int n) {
	        long a[] = new long[n];
	        for (int i = 0; i <n; i++) a[i] = il();
	        return a;
	    }

	    String[] isa(int n) {
	        String a[] = new String[n];
	        for (int i = 0; i < n; i++) a[i] = is();
	        return a;
	    }

		 long mul(long a, long b) { return a * b % M; }

			long div(long a, long b)
				 {
					return mul(a, pow(b, M - 2));

		           }

	    double[][] idm(int n, int m) {
	        double a[][] = new double[n][m];
	        for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = id();
	        return a;
	        }

	    int[][] iim(int n, int m) {
	        int a[][] = new int[n][m];
	        for (int i = 0; i < n; i++) for (int j = 0; j <m; j++) a[i][j] = ii();
	        return a;
          }

   public String readLine() {
       int c = read();
       while (isSpaceChar(c))
           c = read();
       StringBuilder res = new StringBuilder();
       do {
           res.appendCodePoint(c);
           c = read();
       } while (!isEndOfLine(c));
       return res.toString();
   }

   public interface SpaceCharFilter
   {
       public boolean isSpaceChar(int ch);
   }
   public boolean isEndOfLine(int c) {
       return c == '\n' || c == '\r' || c == -1;
   }
}

}

import java.util.*;
public class A976 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		scan.nextInt();
		String s = scan.next();
		System.out.print((s.charAt(0) == '1' ? "1" : "") + s.replace("1", ""));
	}
}

import java.util.ArrayList;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.util.Scanner;
import java.util.LinkedList;

public class UVA_PROBLEMS {

	public static void main(String[] args) throws Exception{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter printer = new PrintWriter(System.out);
		int n = Integer.parseInt(reader.readLine());
		String[] a = reader.readLine().split("");
		int[] str = new int[n];
		int[] strCopia = new int[n];
		for(int i = 0; i<n; i++) {
			str[i] = Integer.parseInt(a[i]);
		}

		int unos = 0, ceros = 0;
		for(int i = 0; i< n; i++) {
			if(str[i] == 1)   unos++;
			else if(str[i] == 0) ceros++;
		}
		int b = unos;
		for(int j = 0; j <n; j++) {
			if(unos>0) {
				strCopia[j] = 1;
				unos--;
			}else {
				strCopia[j] = 0;
			}
		}
		if(b != 0) {
			int[] respuesta = new int[ceros+1];
			respuesta[0] = 1;
			for(int i = 1; i<=ceros; i++) {
				respuesta[i] = 0;
			}
			for(int i = 0; i<respuesta.length; i++) {
				printer.print(respuesta[i]);
			}
		}else {
			int[] respuesta1 = new int[ceros];
			respuesta1[0] = 0;
			printer.print(respuesta1[0]);
		}
		printer.flush();
	}
}

import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.geom.*;
public class SuperEasy{
    public static void main(String[] args) {
      MyScanner sc=new MyScanner();
      int n=sc.ni();
      char arr[]=(sc.next()).toCharArray();
      if(arr.length==1 && arr[0]=='1'){System.out.println(1);System.exit(0);}
      if(arr.length==1 && arr[0]=='0'){System.out.println(0);System.exit(0);}
      int cnt=0;
      for(Character c:arr)
        if(c=='0') cnt++;
       System.out.print(1);
      for(int i=0;i<cnt;i++) System.out.print(0);
  }
    private static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }

      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

      int ni() {
          return Integer.parseInt(next());
      }
      float nf() {
        return Float.parseFloat(next());
      }
      long nl() {
          return Long.parseLong(next());
      }

      double nd() {
          return Double.parseDouble(next());
      }

      String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      }
   }
}

import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        String str = sc.next();
        int mas[] = new int[a];
        int ch = 0;

        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i) == '0'){
                mas[i] = 0;
            }else{
                mas[i] = 1;
            }
        }
       // System.out.println(str);
       /* for (int i = 0; i < a; i++) {
            System.out.print(mas[i] + " ");
        }
        */
        for (int i = a - 1; i > 0; i--) {
            if(mas[i] == 1 && mas[i - 1] == 0){
                mas[i - 1] = 1;
                mas[i] = 0;
            }else if(mas[i] == 1 && mas[i - 1] == 1){
                mas[i] = 0;
                ch++;
            }
        }

        for (int i = 0; i < a - ch; i++) {
            System.out.print(mas[i]);
        }

    }
}

import java.io.*;
import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        String s=sc.next();
        int zeroes=0;
        for(int i=0;i<s.length();i++)
        {
            if(s.charAt(i)=='0')
                zeroes++;
        }
        if(zeroes==n)
            System.out.println("0");
        else
        {
            System.out.print("1"+"");
            while(zeroes-- >0)
                System.out.print("0"+"");
        }
    }
}

import java.util.*;import java.io.*;import java.math.*;

public class Main
{

    public static void process()throws IOException
    {
        StringBuilder res = new StringBuilder();
        int n=ni();
        char arr[]=(" "+nln()).toCharArray();

        if(n==1 && arr[1]=='0'){
            pn(0);
            return;
        }

        res.append("1");
        for(int i=1;i<=n;i++)
            if(arr[i]=='0')
                res.append("0");

        pn(res);
    }

    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new AnotherReader();
        boolean oj = true;

        oj = System.getProperty("ONLINE_JUDGE") != null;
        if(!oj) sc=new AnotherReader(100);

        long s = System.currentTimeMillis();
        int t=1;
        //t=ni();
        while(t-->0)
            process();
        out.flush();
        if(!oj)
            System.out.println(System.currentTimeMillis()-s+"ms");
        System.out.close();
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;
    static long mod=(long)1e9+7l;

    static void r_sort(int arr[],int n){
        Random r = new Random();
        for (int i = n-1; i > 0; i--){
            int j = r.nextInt(i+1);

            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        Arrays.sort(arr);
    }

    static long mpow(long x, long n) {
        if(n == 0)
            return 1;
        if(n % 2 == 0) {
            long root = mpow(x, n / 2);
            return root * root % mod;
        }else {
            return x * mpow(x, n - 1) % mod;
        }
    }

    static long mcomb(long a, long b) {
        if(b > a - b)
            return mcomb(a, a - b);
        long m = 1;
        long d = 1;
        long i;
        for(i = 0; i < b; i++) {
            m *= (a - i);
            m %= mod;
            d *= (i + 1);
            d %= mod;
        }
        long ans = m * mpow(d, mod - 2) % mod;
        return ans;
    }
/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}

import java.lang.*;
import java.util.*;
import java.io.*;
public class test
{
  Scanner sc=new Scanner(System.in);
  PrintWriter pr=new PrintWriter(System.out,true);
  public static void main(String... args)
  {
       test c=new test();
       c.prop();
  }
  public void prop()
  {
    int n,count=0;
    n=sc.nextInt();
    StringBuffer sb=new StringBuffer("");
    String s=sc.next() ;
         for (int i=0;i<n ;++i) {
              if(s.charAt(i)=='1')
                ++count ;
            }
            if(count>=1)
              sb.append("1");
        for (int i=1;i<=n-count ;++i ) {
           sb.append("0");
        }
         pr.println(sb);

  }
}

import java.util.*;

public class MinBinary {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		input.nextLine();
		String s = input.nextLine();
		int count1 = 0;
		int count0 = 0;
		for (int i = 0; i<n; i++) {
			if (s.charAt(i)=='0') count0++;
			else count1++;
		}
		if (count1 == 0) {
			System.out.println(0);
		}
		else if (count0 == 0) {
				System.out.println("1");
		}
		else {
			System.out.print("1");
			for(int i = 0; i<count0; i++) {
				System.out.print(0);
			}
		}
	}
}

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public Main(){
		Scanner sc  = new Scanner(System.in);

		int n = sc.nextInt();
		String numb = sc.next();
                int zeros = 0;
                for(int i = 0; i < numb.length() ; i++){
                    char now = numb.charAt(i);
                    if(now == '0'){
                        zeros ++;
                    }
                }

               if(!numb.equals("0")){
                   System.out.print("1");
               }

                for(int i =0; i < zeros; i++){
                   System.out.print("0");
                }
	}

     	public static void main (String[] args) throws java.lang.Exception
	{
	   new Main();
	}

}

import java.io.IOException;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.io.PrintWriter;

import java.util.StringTokenizer;

public class Main {

    static Scanner s = new Scanner();
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        boolean b = false;
        int n = s.nextInt(), m = 0;
        char[] c = s.next().toCharArray();
        for(int i = 0; i < n; i++)
            if(c[i] == '0')
                m++;
            else
                b = true;
        if(b)
            out.print(1);
        for(int i = 0; i < m; i++)
            out.print(0);
        out.close();
    }

    static class Scanner {
        BufferedReader in;
        StringTokenizer s;

        public Scanner() {
            in = new BufferedReader(new InputStreamReader(System.in));
            s = new StringTokenizer("");
        }

        public String next() throws IOException {
            if(!s.hasMoreTokens())
                s = new StringTokenizer(in.readLine());
            return s.nextToken();
        }

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.StringTokenizer;

public class CodeForces {

    public static void main(String[] args) throws IOException {
        in.init(System.in);
        StringBuilder out = new StringBuilder();
        int n = in.nextInt();
        char s[] = in.nextLine().toCharArray();
        HashMap<Character, Integer> map = new HashMap<>();
        map.put('0', 0);
        map.put('1', 0);
        for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i]) + 1);
        }
        int ones = map.get('1');
        int zeros = map.get('0');
        if (ones == 0) {
            out.append("0");
        } else {
            out.append("1");
            for (int i = 0; i < zeros; i++) {
                out.append("0");
            }
        }
        System.out.print(out);
    }

}

class in {

    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer(" ");
    }

    static String nextLine() throws IOException {
        return reader.readLine();
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static boolean hasNext() {
        return tokenizer.hasMoreTokens();
    }

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

    static int nextShort() throws IOException {
        return Short.parseShort(next());
    }

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

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

import java.util.*;
public class HelloWorld{

     public static void main(String []args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int ones=0;

        for(int i=0;i<n;i++){
            if(s.charAt(i)=='1'){
                ones++;
            }
        }
        if(ones!=0){
            int zero=n-ones;
            String res = "1";
            for(int i=0;i<zero;i++){
                res+="0";
            }
            System.out.println(res);
        }
        else{
            System.out.println(0);
        }

     }
}

import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);

        int n = in.nextInt();
        String s = in.next();
        int num = 0;
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '0') num++;
        }
        StringBuilder sb = new StringBuilder();
        if(num!=s.length()) sb.append("1");
        while (num-->0) {
            sb.append("0");
        }
        out.println(sb);
        out.flush();
    }

    private static int [] mergeTwoArrays(int [] a, int [] b) {
        int [] res = new int[a.length + b.length];
        int i = 0;
        int j = 0;
        int index = 0;
        while (i<a.length && j<b.length) {
            if(a[i]<b[j]) {
                res[index++] = a[i++];
            }
            else {
                res[index++] = b[j++];
            }
        }
        System.out.println(i + " " + j);
        if(j == b.length - 1) {
            while (i<a.length) {
                res[index++] = a[i++];
            }
        }
        else {
            while (j<b.length) {
                res[index++] = b[j++];
            }
        }
        return res;
    }
}
class Point {
    private int value;
    private int index;
    public int getValue() {
        return value;
    }
    public int getIndex() {
        return index;
    }
    public Point(int value,int index) {
        this.value = value;
        this.index = index;
    }

}

class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

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

    public Integer nextInt() {
        return Integer.valueOf(next());
    }
    public Long nextLong() {return  Long.valueOf(next());}

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
}

import java.util.*;

public class codeforce {
    public static  void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String a = sc.next();
        String b = a.contains("1")?"1":"";
        for (int i = 0; i < a.length(); i++) {
            if(a.charAt(i)=='0'){
                b+='0';
            }
        }
        System.out.println(b);
    }
}

import java.util.*;
public class A976 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = scan.nextInt();
		String s = scan.next();
		boolean one = false;
		for(int i = 0; i < n; i++){
			if(s.charAt(i) == '0')
				sb.append("0");
			else if(!one){
				sb.append("1");
				one = true;
			}
		}
		System.out.println(sb.toString());
	}
}

import java.util.Scanner;

public class Driver {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		String str = input.next();
		int counter0 = 0, counter1 = 0;
		for (int i = 0; i < str.length(); i++) {
			if (str.charAt(i) == '0') {
				counter0++;
			} else {
				counter1++;
			}
		}
		if(counter1==0) {
			System.out.println("0");
			return;
		}
		String out = "1";
		for (int i = 0; i < counter0; i++) {
			out += "0";

		}
	System.out.println(out);
	}
}

import java.util.*;

public class P976A{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();
		String s = sc.nextLine();

		boolean check = false;
		int counter = 0;
		for(int i=0; i<n; i++){
			if(s.charAt(i)=='1'){
				check = true;
			}
			if(s.charAt(i)=='0'){
				counter++;
			}
		}

		String ans = "";
		if(check){
			ans = "1";
			for(int i=0; i<counter; i++){
				ans = ans+"0";
			}
		}
		else{
			ans = "0";
		}

		System.out.println(ans);
	}
}

import java.util.*;
public class Main2{

	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int n;
		n = scan.nextInt();
		String b_string = scan.next();
		int count_ones = 0;
		int count_zeros = 0;

		for( int i=0; i<n; i++)
		{
			int no = Integer.parseInt(b_string.substring(i, i+1));
			if(no==1)
			{
				count_ones++;
			}
			else
			{
				count_zeros++;
			}
		}

		if(count_zeros==1 && count_ones==0)
		{
			System.out.println(b_string);
			return;
		}
		// if(count_ones==1 && count_zeros==0)
		// {
		// 	System.out.println(b_string);
		// 	return;
		// }

		// if(count_ones>1 && count_zeros==0)
		// {
		// 	System.out.println(b_string);
		// 	return;
		// }

		// if(count_ones>1)
		// {
		String new_string = "1";
		for( int i=0; i<count_zeros ; i++)
		{
			new_string = new_string + "0";
		}
			System.out.println(new_string);
		// }
		// else
		// {
			// System.out.println(b_string);
		// }

	}
}

import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Practice {

		public static void main(String []args)
		{
			Scanner sc=new Scanner(System.in);
			int n=sc.nextInt();
			sc.nextLine();
			String s=sc.nextLine();
			//System.out.println(s);
			char c[]=s.toCharArray();
			ArrayList a =new ArrayList();

			for(int i=0;i<c.length;i++)
			{
				//System.out.println(c[i]);
				a.add(c[i]);
			}

			int x=Collections.frequency(a,'0' );
			int y=Collections.frequency(a,'1');

			//System.out.println(x+ "  "+y );
			if(y==0 || y==1)
			{
				System.out.println(s);
			}
			else
			{
				if(y>=2)
				{
					String s1="1";
					for(int i=0;i<x;i++)
					{
						s1=s1+"0";
					}
					System.out.println(s1);

				}
			}

	}

}

import java.util.*;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        sc.nextInt();
        String s = sc.next();
        if(s.equals("0")) {
            System.out.println("0");
            return;
        }
        if(s.equals("1")) {
            System.out.println("1");
            return;
        }
        int cnt = 0;
        StringBuilder sb = new StringBuilder("1");
        for(char c: s.toCharArray()) {
            if(c=='0') sb.append("0");
        }
        System.out.println(sb.toString());
    }
}

import java.util.*;

public class q1 {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String s = sc.next();
    String[] out = s.split("");
    for(int i=0; i<n-1; i++) {
       if(!out[i].equals(out[i+1])) {
         String tmp = out[i];
         out[i] = out[i+1];
         out[i+1] = tmp;
       } else if(out[i].equals(out[i+1]) && out[i].equals("1")){
         out[i] = "-1";
       }
    }
    for( int i=n-1;i>=0;i-- ) {
      if( out[n-1].equals("0") && n!=1 ) {
        out[n-1] = "-1";
      }
       if(out[i] != "-1") {
        System.out.print(out[i]);
      }
    }
  }
}

import java.util.Scanner;

public class MinimumBinaryNumber {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextInt();
		String s = sc.next();
		System.out.print((s.charAt(0) == '1' ? "1" : "") + s.replace("1", ""));
		sc.close();
	}
}

import java.util.Scanner;

public class meniat {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.nextLine());
		String input = in.nextLine();
		int k = 0;
		if (input.equals("0")) {
			System.out.print(0);
		} else {

			for (int i = 0; i < input.length(); i++) {
				if(input.charAt(i) == '1') {
					k++;
				}
			}

			System.out.print(1);
			for (int i = 0; i < n - k ; i++)

				System.out.print(0);
		}
	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            StringBuilder s = new StringBuilder(in.next());
            StringBuilder last = new StringBuilder(s);
            while (true) {
                for (int i = 0, l = s.length(); i < l - 1; i++) {
                    char cur = s.charAt(i);
                    char next = s.charAt(i + 1);
                    if (cur == '0' && next == '1')
                        swap(s, i);
                }
                delete(s);
                if (last.toString().compareTo(s.toString()) == 0)
                    break;
                else
                    last = new StringBuilder(s);
            }
            out.println(last);
        }

        private static void delete(StringBuilder s) {
            while (true) {
                int i = s.indexOf("11");
                if (i == -1)
                    break;
                else
                    s.replace(i, i + 2, "1");
            }
        }

        private static void swap(StringBuilder s, int pos) {
            char t = s.charAt(pos);
            s.setCharAt(pos, s.charAt(pos + 1));
            s.setCharAt(pos + 1, t);
        }

    }

    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 int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.io.*;
import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        String s=sc.next();
        int zeroes=0;
        for(int i=0;i<s.length();i++)
        {
            if(s.charAt(i)=='0')
                zeroes++;
        }
        if(zeroes==n)
            System.out.println("0");
        else
        {
            System.out.print("1"+"");
            while(zeroes-- >0)
                System.out.print("0"+"");
        }
    }
}

import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main{
    public static void main(String[] args)throws IOException{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	PrintWriter out = new PrintWriter(System.out);
	int n = Integer.parseInt(br.readLine());
	String s = br.readLine().replaceAll("1","");
	int one = n-s.length();
	out.println(one!=0?"1"+s:s);
	out.close();
    }
}

import java.util.*;
import java.io.*;
import java.math.*;
public class hi{

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int nb = 0;
        boolean ok = false;
        for(int i=0;i<n;i++){
            if(s.charAt(i)=='0') nb++;
            if(s.charAt(i)=='1') ok = true;
        }
        if(ok) System.out.print("1");
        for(int i=0;i<nb;i++) System.out.print("0");
        System.out.println("");

    }

}

import java.util.*;

public class Main {

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		String s,str;
		int v;
		v = sc.nextInt();
		s = sc.next();
		str = s.replace("1", "");
		if(s.contains("1"))
		 System.out.println(1+""+str);
		else
			System.out.println(str);

		sc.close();
	}

}

import java.util.*;

public class codeforce {
    public static  void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String a = sc.next();
        String b = a.contains("1")?"1":"";
        for (int i = 0; i < a.length(); i++) {
            if(a.charAt(i)=='0'){
                b+='0';
            }
        }
        System.out.println(b);
    }
}

//package codeforces;

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int len = sc.nextInt();
		String str = sc.next();
		if (len < 2) {
			System.out.println(str);
		} else {
			String[] str_char = str.split("");
			StringBuffer sb = new StringBuffer("1");
			for (int i = 0; i < str_char.length; i++) {
				if(str_char[i].equals("0")){
					sb.append("0");
				}
			}
			System.out.println(sb);
		}

	}

}

import java.io.IOException;
import java.awt.color.*;
import java.util.*;
import java.math.*;
import java.io.*;
import java.util.InputMismatchException;

@SuppressWarnings("unused")
public class main {
	public static void main(String[] args) {
                new main().solve();
                                  }
            public void solve() {
            	int n=sc.nextInt();String d="";
            	String s=sc.next();int c=0;
            	for(int i=0;i<n;i++) {
            		if(s.charAt(i)=='1')
            			c++;
            	}
            	if(c==0)
            		System.out.println(s);
            	else  {
            		 d="1";
            		for(int i=0;i<n-c;i++)
            			d=d+"0";

            	}

            	System.out.println(d);

           }

          /*  boolean[] sieveOfEratosthenes(int n)
            {

                // (a / b) % m = (a % m * b^(m - 2) % m) % mCreate a boolean array "prime[0..n]" and initialize
                // all entries it as true. A value in prime[i] will
                // finally be false if i is Not a prime, else true.
                boolean prime[] = new boolean[n+1];
                for(int i=0;i<n;i++)
                    prime[i] = true;

                for(int p = 2; p*p <=n; p++)
                {
                    // If prime[p] is not changed, then it is a prime
                    if(prime[p] == true)
                    {
                        // Update all multiples of p
                        for(int i = p*2; i <= n; i += p)
                            prime[i] = false;
                    }
                }

                // Print all prime numbers
               return prime;
            }

   /*         void DFS(int v,boolean visited[])
    {
        // Mark the current node as visited and print it
        visited[v] = true;
        System.out.print(v+" ");

        // Recur for all the vertices adjacent to this vertex
        Iterator<Integer> i = adj[v].listIterator();
        while (i.hasNext())
        {
            int n = i.next();
            if (!visited[n])
                DFS(n, visited);
        }
    }*/
    /*static int binomialCoeff(int n, int k)
    {
        int C[] = new int[k + 1];

        // nC0 is 1
        C[0] = 1;

        for (int i = 1; i <= n; i++)
        {
            // Compute next row of pascal
            // triangle using the previous row
            for (int j = Math.min(i, k); j > 0; j--)
                C[j] = C[j] + C[j-1];
        }
        return C[k];
    }*/

          FastReader sc=new FastReader();
static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }}

import java.io.*;
import java.util.*;
//import java.util.stream.*;;
//import java.math.*;

public class Main {

    public static boolean vowel(char c) {
        String v = "aeiouy";
        return v.contains(Character.toString(c));
    }

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        br.readLine();
        String s = br.readLine();
        String str = "";
        int count = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                count++;
                str += "0";
            }
        }
        if (count == s.length()) {
            System.out.println(str);
        } else {
            System.out.println("1" + str);
        }
        bw.flush();
    }
}

//package DC;

import java.awt.List;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Scanner;

import javax.print.attribute.Size2DSyntax;;

public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		String k = s.next();
		int counter = 0;
		for (int i = 0; i < n; i++)
			if (k.charAt(i) == '0')
				counter++;
		String newS = "1";
		for (int i = 0; i < counter; i++)
			newS += "0";
		if (counter == k.length())
			System.out.println(k);
		else
			System.out.println(newS);
	}

}

import java.util.ArrayList;

import java.util.Scanner;

public class Duplicateelement {

    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        int n,c=0;
        int c1=0;
        n=input.nextInt();
        String s;
        s=input.next();
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i)=='0'){

                c1++;
            }else{
                c++;
            }
        }
        if(c>0){
             System.out.print("1");
        }

        for (int i = 0; i < c1; i++) {
            System.out.print("0");
        }

    }

}

import java.util.*;
public class _976A
{

	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int len = scan.nextInt();
		String s = scan.next();
		int i, ones = 0, zeros = 0;
		for(i = 0 ; i < len ; i++)
			if(s.charAt(i) == '1')	ones++;
			else					zeros++;
		StringBuilder sb = new StringBuilder();
		if(ones > 0)
		sb.append("1");
		for(i = 0 ; i < zeros ; i++)
			sb.append("0");
		System.out.println(sb);
		scan.close();

	}

}

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		if(s.equals("0")) System.out.println(0);
		else {
			StringBuilder sb = new StringBuilder();
			sb.append('1');
			for(int i = 0 ; i < s.length() ; ++i) {
				if(s.charAt(i) == '0') sb.append('0');
			}
			System.out.println(sb);
		}
	}

}

import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class TOKI {

	/*
	 * https://www.hackerrank.com/challenges/correctness-invariant/problem
	 */

	private static int result = 0;

    public static void main(String[] args) throws IOException {
        Reader sc = new Reader();
        int T = sc.nextInt();
        sc.readLine();
        	String[] str = sc.readLine().trim().split("");
        	int[] integer = new int[str.length];
        	for(int i  = 0;i < str.length;i++) {
        		integer[i] = Integer.parseInt(str[i]);
        	}
        	Arrays.sort(integer);
        	String concat = "";
        	for(int i : integer) {
        		concat+=i;
        	}
        	concat = new StringBuilder(concat).reverse().toString();
        	while(concat.contains("11")) {
        		concat = concat.replace("11", "1");
        	}
        	p(concat);
    }

    /* -- Start PrintOut Method -- */
    static <T> void p(T o) {

        try {
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            out.write(o + "");
            out.flush();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }
    static <T> void p(T[] a) {
        try {
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            out.write(Arrays.toString(a) + "");
            out.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    /* -- End PrintOut Method -- */
}

/* Fast Scanner */
class Reader {
    final private int BUFFER_SIZE = 1 << 16, BYTE_SIZE = 100001;
    private DataInputStream din;
    private byte[] buffer;
    private int bufferPointer, bytesRead;

    public Reader() {
        din = new DataInputStream(System.in);
        buffer = new byte[BUFFER_SIZE];
        bufferPointer = bytesRead = 0;
    }

    /*String reader, using s.readLine() after calling next long int or double*/
    public String readLine() throws IOException {
        byte[] buf = new byte[BYTE_SIZE];
        int cnt = 0, c;
        while ((c = read()) != -1) {
            if (c == '\n')
                break;
            buf[cnt++] = (byte) c;
        }
        return new String(buf, 0, cnt);
    }

    public int nextInt() throws IOException {
        int ret = 0;
        byte c = read();
        while (c <= ' ')
            c = read();
        boolean neg = (c == '-');
        if (neg)
            c = read();
        do
        {
            ret = ret * 10 + c - '0';
        }  while ((c = read()) >= '0' && c <= '9');

        if (neg)
            return -ret;
        return ret;
    }

    public long nextLong() throws IOException {
        long ret = 0;
        byte c = read();
        while (c <= ' ')
            c = read();
        boolean neg = (c == '-');
        if (neg)
            c = read();
        do {
            ret = ret * 10 + c - '0';
        }
        while ((c = read()) >= '0' && c <= '9');
        if (neg)
            return -ret;
        return ret;
    }

    public double nextDouble() throws IOException {
        double ret = 0, div = 1;
        byte c = read();
        while (c <= ' ')
            c = read();
        boolean neg = (c == '-');
        if (neg)
            c = read();

        do {
            ret = ret * 10 + c - '0';
        }
        while ((c = read()) >= '0' && c <= '9');

        if (c == '.')
        {
            while ((c = read()) >= '0' && c <= '9')
            {
                ret += (c - '0') / (div *= 10);
            }
        }

        if (neg)
            return -ret;
        return ret;
    }

    private void fillBuffer() throws IOException {
        bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
        if (bytesRead == -1)
            buffer[0] = -1;
    }

    private byte read() throws IOException {
        if (bufferPointer == bytesRead)
            fillBuffer();
        return buffer[bufferPointer++];
    }

    public void close() throws IOException {
        if (din == null)
            return;
        din.close();
    }

    public ArrayList<Integer> rALI(int n) throws IOException {
        ArrayList<Integer> res = new ArrayList<Integer>();
        while(n-->0) res.add(nextInt());
        return res;
    }

    public ArrayList<String> rALS(int n) throws IOException {
        ArrayList<String> res = new ArrayList<String>();
        while(n-->0) res.add(readLine());
        return res;
    }

    public ArrayList<Long> rALL(int n) throws IOException {
        ArrayList<Long> res = new ArrayList<Long>();
        while(n-->0) res.add(nextLong());
        return res;
    }

    public ArrayList<Double> rALD(int n) throws IOException {
        ArrayList<Double> res = new ArrayList<Double>();
        while(n-->0) res.add(nextDouble());
        return res;
    }
}

import java.util.*;
import java.io.*;
import java.lang.*;

public class code3
	{

		public static HashSet<Long> set;
		public static void main(String[] args)
		{
			InputReader in = new InputReader(System.in);
			PrintWriter pw = new PrintWriter(System.out);

			//Code starts..

			int n = in.nextInt();
			String s = in.nextLine();
			int one = 0;
			int zero = 0;
			for(int i=0; i<n; i++)
				if(s.charAt(i)=='0')
					zero++;
				else
					one++;
			if(one>0)
			pw.print(1);
			for(int i=0; i<zero; i++)
				pw.print(0);

			//Code ends....

			pw.flush();
			pw.close();
		}

		public static double sumOfGP(double a, double r, double n)
		    {
		        // calculating and storing sum
		        return (a * (1 - (int)(Math.pow(r, n)))) /
		                                            (1 - r);
		    }

		static class InputReader
		{

			private final InputStream stream;
			private final byte[] buf = new byte[8192];
			private int curChar, snumChars;
			private SpaceCharFilter filter;

			public InputReader(InputStream stream)
			{
				this.stream = stream;
			}

			public int snext()
			{
				if (snumChars == -1)
					throw new InputMismatchException();
				if (curChar >= snumChars)
				{
					curChar = 0;
					try
					{
						snumChars = stream.read(buf);
					}
					catch (IOException e)
					{
						throw new InputMismatchException();
					}
					if (snumChars <= 0)
						return -1;
				}
				return buf[curChar++];
			}

			public int nextInt()
		    {
				int c = snext();
				while (isSpaceChar(c))
				{
					c = snext();
				}
				int sgn = 1;
				if (c == '-')
			    {
					sgn = -1;
					c = snext();
				}
				int res = 0;
				do
				{
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					res *= 10;
					res += c - '0';
					c = snext();
				} while (!isSpaceChar(c));
				return res * sgn;
			}

			public long nextLong()
		    {
				int c = snext();
				while (isSpaceChar(c))
				{
					c = snext();
				}
				int sgn = 1;
				if (c == '-')
				{
					sgn = -1;
					c = snext();
				}
				long res = 0;
				do
				{
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					res *= 10;
					res += c - '0';
					c = snext();
				} while (!isSpaceChar(c));
				return res * sgn;
			}

			public int[] nextIntArray(int n)
			{
				int a[] = new int[n];
				for (int i = 0; i < n; i++)
				{
					a[i] = nextInt();
				}
				return a;
			}

			public String readString()
		    {
				int c = snext();
				while (isSpaceChar(c))
				{
					c = snext();
				}
				StringBuilder res = new StringBuilder();
				do
				{
					res.appendCodePoint(c);
					c = snext();
				} while (!isSpaceChar(c));
				return res.toString();
			}

			public String nextLine()
			{
				int c = snext();
				while (isSpaceChar(c))
					c = snext();
				StringBuilder res = new StringBuilder();
				do
				{
					res.appendCodePoint(c);
					c = snext();
				} while (!isEndOfLine(c));
				return res.toString();
			}

			public boolean isSpaceChar(int c)
			{
				if (filter != null)
					return filter.isSpaceChar(c);
				return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
			}

			private boolean isEndOfLine(int c)
			{
				return c == '\n' || c == '\r' || c == -1;
			}

			public interface SpaceCharFilter
		    {
				public boolean isSpaceChar(int ch);
			}
		}
		public static long c = 0;

		public static long mod = 1000000009;
		public static int d;
		public static int p;
		public static int q;
		public static boolean flag;

		public static  int gcd(int p2, int p22)
		{
		    if (p2 == 0)
		        return (int) p22;
		    return gcd(p22%p2, p2);
		}

		public static int findGCD(int arr[], int n)
		{
		    int result = arr[0];
		    for (int i=1; i<n; i++)
		        result = gcd(arr[i], result);

		    return result;
		}

		public static void nextGreater(long[] a, int[] ans)
		{

			Stack<Integer> stk = new Stack<>();
			stk.push(0);

			for(int i=1; i<a.length; i++)
			{

				if(!stk.isEmpty())
				{
				int s = stk.pop();
				while(a[s]<a[i])
				{
					ans[s] = i;
					if(!stk.isEmpty())
						s = stk.pop();
					else
						break;
				}
				if(a[s]>=a[i])
					stk.push(s);
				}

				stk.push(i);

			}
			return;

		}

		public static void nextGreaterRev(long[] a, int[] ans)
		{

			int n = a.length;
			int[] pans = new int[n];
			Arrays.fill(pans, -1);
			long[] arev = new long[n];
			for(int i=0; i<n; i++)
				arev[i] = a[n-1-i];

			Stack<Integer> stk = new Stack<>();
			stk.push(0);

			for(int i=1; i<n; i++)
			{

				if(!stk.isEmpty())
				{
				int s = stk.pop();
				while(arev[s]<arev[i])
				{
					pans[s] = n - i-1;
					if(!stk.isEmpty())
						s = stk.pop();
					else
						break;
				}
				if(arev[s]>=arev[i])
					stk.push(s);
				}

				stk.push(i);

			}

			//for(int i=0; i<n; i++)
				//System.out.print(pans[i]+" ");

			for(int i=0; i<n; i++)
				ans[i] = pans[n-i-1];

			return;

		}

		public static void nextSmaller(long[] a, int[] ans)
		{

			Stack<Integer> stk = new Stack<>();
			stk.push(0);

			for(int i=1; i<a.length; i++)
			{

				if(!stk.isEmpty())
				{
				int s = stk.pop();
				while(a[s]>a[i])
				{
					ans[s] = i;
					if(!stk.isEmpty())
						s = stk.pop();
					else
						break;
				}
				if(a[s]<=a[i])
					stk.push(s);
				}

				stk.push(i);

			}
			return;

		}

	    public static long lcm(int[] numbers) {
	        long lcm = 1;
	        int divisor = 2;
	        while (true) {
	            int cnt = 0;
	            boolean divisible = false;
	            for (int i = 0; i < numbers.length; i++) {
	                if (numbers[i] == 0) {
	                    return 0;
	                } else if (numbers[i] < 0) {
	                    numbers[i] = numbers[i] * (-1);
	                }
	                if (numbers[i] == 1) {
	                    cnt++;
	                }
	                if (numbers[i] % divisor == 0) {
	                    divisible = true;
	                    numbers[i] = numbers[i] / divisor;
	                }
	            }
	            if (divisible) {
	                lcm = lcm * divisor;
	            } else {
	                divisor++;
	            }
	            if (cnt == numbers.length) {
	                return lcm;
	            }
	        }
	    }
		public static long fact(long n) {

			long factorial = 1;
			 for(int i = 1; i <= n; i++)
		        {
		            factorial *= i;
		        }
			 return factorial;
		}

		public static int lowerLimit(int[] a, int n) {
			int ans = 0;

			int ll = 0;
			int rl = a.length-1;
		//	System.out.println(a[rl]+" "+n);
			if(a[0]>n)
				return 0;
			if(a[0]==n)
				return 1;
			else if(a[rl]<=n)
				return rl+1;

			while(ll<=rl)
			{

				int mid = (ll+rl)/2;
				if(a[mid]==n)
				{
					ans = mid + 1;
					break;
				}

				else if(a[mid]>n)
				{
					rl = mid-1;

				}
				else
				{
					ans = mid+1;
					ll = mid+1;
				}
			}

			return ans;
		}

		public static long choose(long total, long choose){
		    if(total < choose)
		        return 0;
		    if(choose == 0 || choose == total)
		        return 1;
		    return (choose(total-1,choose-1)+choose(total-1,choose))%mod;
		}

		public static int[] suffle(int[] a,Random gen)
		{
			int n = a.length;
			for(int i=0;i<n;i++)
			{
				int ind = gen.nextInt(n-i)+i;
				int temp = a[ind];
				a[ind] = a[i];
				a[i] = temp;
			}
			return a;
		}

		public static int floorSearch(int arr[], int low, int high, int x)
		{
		    if (low > high)
		        return -1;

		    if (x > arr[high])
		        return high;
		    int mid = (low+high)/2;

		    if (mid > 0 && arr[mid-1] < x && x < arr[mid])
		        return mid-1;

		    if (x < arr[mid])
		        return floorSearch(arr, low, mid-1, x);

		    return floorSearch(arr, mid+1, high, x);
		}

		public static void swap(int a, int b){
			int temp = a;
			a = b;
			b = temp;
		}
		public static ArrayList<Integer> primeFactorization(int n)
		{
			ArrayList<Integer> a =new ArrayList<Integer>();
			HashSet<Long> set = new HashSet<>();
			for(int i=2;i*i<=n;i++)
			{
				while(n%i==0)
				{

					n/=i;
				}
			}
			if(n!=1)
				a.add(n);
			return a;
		}

		public static void sieve(boolean[] isPrime,int n)
		{
			for(int i=1;i<n;i++)
				isPrime[i] = true;

			isPrime[0] = false;
			isPrime[1] = false;

			for(int i=2;i*i<n;i++)
			{
				if(isPrime[i] == true)
				{
					for(int j=(2*i);j<n;j+=i)
						isPrime[j] = false;
				}
			}
		}

		public static int lowerbound(ArrayList<Integer> list, int n) {
			int i=Collections.binarySearch(list, n);
			if(i<0)
				i = -(i+2);
			return i;

		}
		public static int lowerboundArray(long[] list, long n) {
			int i=Arrays.binarySearch(list, n);
			if(i<0)
				i = -(i+2);
			return i;

		}
		public static int uperbound(ArrayList<Integer> list, int n) {
			int i=Collections.binarySearch(list, n);
			if(i<0)
				i = -(i+1);
			return i;

		}
		public static int uperboundArray(long[] list, long n) {
			int i=Arrays.binarySearch(list, n);
			if(i<0)
				i = -(i+1);
			return i;

		}

		public static int GCD(int a,int b)
		{
			if(b==0)
				return a;
			else
				return GCD(b,a%b);
		}

		public static long GCD(long a,long b)
		{
			if(b==0)
				return a;
			else
				return GCD(b,a%b);
		}

		public static void extendedEuclid(int A,int B)
		{
			if(B==0)
			{
				d = A;
				p = 1 ;
				q = 0;
			}
			else
			{
				extendedEuclid(B, A%B);
				int temp = p;
				p = q;
				q = temp - (A/B)*q;
			}
		}

		public static long LCM(long a,long b)
		{
			return (a*b)/GCD(a,b);
		}

		public static int LCM(int a,int b)
		{
			return (a*b)/GCD(a,b);
		}

		public static int binaryExponentiation(int x,int n)
		{
		    int result=1;
		    while(n>0)
		    {
		        if(n % 2 ==1)
		            result=result * x;
		        x=x*x;
		        n=n/2;
		    }
		    return result;
		}

		public static int[] countDer(int n)
	    {
	        int der[] = new int[n + 1];

	        der[0] = 1;
	        der[1] = 0;
	        der[2] = 1;

	        for (int i = 3; i <= n; ++i)
	            der[i] = (i - 1) * (der[i - 1] + der[i - 2]);

	        // Return result for n
	        return der;
	    }

		 static long binomialCoeff(int n, int k)
		    {
		    long C[][] = new long[n+1][k+1];
		    int i, j;

		        // Calculate  value of Binomial Coefficient in bottom up manner
		    for (i = 0; i <= n; i++)
		    {
		        for (j = 0; j <= Math.min(i, k); j++)
		        {
		            // Base Cases
		            if (j == 0 || j == i)
		                C[i][j] = 1;

		            // Calculate value using previosly stored values
		            else
		                C[i][j] = C[i-1][j-1] + C[i-1][j];
		          }
		     }

		    return C[n][k];
		    }

		public static long binaryExponentiation(long x,long n)
		{
		    long result=1;
		    while(n>0)
		    {
		        if(n % 2 ==1)
		            result=result * x;
		        x=(x%mod * x%mod)%mod;
		        n=n/2;
		    }
		    return result;
		}

		public static int modularExponentiation(int x,int n,int M)
		{
		    int result=1;
		    while(n>0)
		    {
		        if(n % 2 ==1)
		            result=(result * x)%M;
		        x=(x*x)%M;
		        n=n/2;
		    }
		    return result;
		}

		public static double modularExponentiation(double x,double n,long M)
		{
		    double result=1;
		    while(n>0)
		    {
		        if(n % 2 ==1)
		            result=(result * x)%M;
		        x=(x*x)%M;
		        n=n/2;
		    }
		    return result;
		}

		public static int modInverse(int A,int M)
		{
		    return modularExponentiation(A,M-2,M);
		}

		public static double modInverse(long A,long M)
		{
		    return modularExponentiation(A,M-2,M);
		}

		public static void sieveFact(int[] primf, int n) {

			for(int i=2;i*i<=n;i++)
				if(primf[i]==0){
					primf[i]=i;

					for(int j=i*i;j<=n;j+=i)
						primf[j]=i;

			}

			/*int x = 48;
			while(x>=1)
			{
				System.out.println(primef[x]);
				x/=primef[x];
				if(x==1)
					break;

			}
			*/
		}

		public static boolean isPrime(int n)
		{

		    if (n <= 1)  return false;
		    if (n <= 3)  return true;

		    if (n%2 == 0 || n%3 == 0)
		    	return false;

		    for (int i=5; i*i<=n; i=i+6)
		    {
		        if (n%i == 0 || n%(i+2) == 0)
		           return false;
		    }

		    return true;
		}

		static class pair implements Comparable<pair>

		{
			Integer x, y;
			pair(int x,int y)
			{
				this.x=x;
				this.y=y;
			}

			public int compareTo(pair o) {
				int result = x.compareTo(o.x);
				if(result==0)
					result = y.compareTo(o.y);

				return result;
			}

			public String toString()
			{
				return x+" "+y;
			}

			public boolean equals(Object o)
			{
				if (o instanceof pair)
			    {
					pair p = (pair)o;
					return p.x == x && p.y == y ;
				}
				return false;
			}

			public int hashCode()
			{
				return new Long(x).hashCode()*31 + new Long(y).hashCode();
			}
		}

		static class triplet implements Comparable<triplet>
		{
			Integer x,y,z;
			triplet(int x,int y,int z)
			{
				this.x = x;
				this.y = y;
				this.z = z;
			}

			public  int compareTo(triplet o)
			{
				int result = x.compareTo(o.x);
				if(result==0)
					result =  y.compareTo(o.y);
				if(result==0)
					result = z.compareTo(o.z);

				return result;
			}

			public boolean equlas(Object o)
			{
				if(o instanceof triplet)
				{
					triplet p = (triplet)o;
					return x==p.x && y==p.y && z==p.z;
				}
				return false;
			}

			public String toString()
			{
				return x+" "+y+" "+z;
			}
			public int hashCode()
			{
				return new Long(x).hashCode()*31 + new Long(y).hashCode() + new Long(z).hashCode();
			}
		}

		static class node implements Comparable<node>

		{
			Integer x, y, z;
			node(int x,int y, int z)
			{
				this.x=x;
				this.y=y;
				this.z=z;
			}

			public int compareTo(pair o) {
				int result = x.compareTo(o.x);
				if(result==0)
					result = y.compareTo(o.y);
				if(result==0)
					result = z.compareTo(z);
				return result;
			}

			@Override
			public int compareTo(node o) {
				// TODO Auto-generated method stub
				return 0;
			}
		}
	}

import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        byte n = in.nextByte();
        String s = in.next();
        char a[] = s.toCharArray();
        Arrays.sort(a);
        s = new String(a);
        if (s.indexOf('1') != -1)
        s = s.substring(0, s.indexOf('1')+1);
        for (int i = s.length()-1; i >= 0; i--) System.out.print(s.charAt(i));
    }
}

import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String S = sc.next();
    sc.close();

    String[] s = S.split("");

    int[] v = new int[2];

    for (int i = 0; i < n; i++) {
      int l = Integer.valueOf(s[i]);
      v[l]++;
    }

    if (S.equals("0")) {
      System.out.println("0");
    } else {
      System.out.print("1");
      for (int i = 0; i < v[0]; i++) {
        System.out.print("0");
      }
      System.out.println("");
    }

  }

}

import java.util.*;
public class Test2{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		String s = sc.nextLine();
		if(s.equals("0"))
			System.out.println(0);
		else
			System.out.println("1"+s.replace("1",""));

	}
}

/*input
4
1001
*/
import java.io.*;
import java.util.*;
public class Main
{
    public static void main(String[] args) throws Exception
    {
        Bolt sc=new Bolt(System.in);
        int n=sc.nextInt();
        String s=sc.next();
        int count=0;
        if(n==1)
            System.out.println(s);
        else
        {
            for(int i=1;i<n;i++)
            {
                if(s.charAt(i)=='0')
                    count++;
            }
            System.out.print(1);
            for(int i=0;i<count;i++)
                System.out.print(0);
        }
        // n=n-count-1;

    }
}
class Bolt{

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        Bolt(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan());
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan());
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }

        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan());
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }

import java.util.Scanner;
public class minimom {
public static void main(String[] args) {
	Scanner scanner = new Scanner (System.in);
	int n = scanner.nextInt(),sum=0;
	String s = scanner.next();
	for (int i=0;i<n;i++) {
		if (s.charAt(i)=='0') sum++;
	}
	System.out.print(1);
	for (int i=0;i<sum;i++) {
		System.out.print(0);
	}
	scanner.close();
}
}

import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.*;

public class MinBiNum {
	public void run() throws Exception {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s = sc.next();

		int count1 = 0;
		int count0 = 0;

		for (int i = 0; i<n; i++) {
			if (s.substring(i, i+1).equals("1")) {
				count1++;
			}
			else {
				count0++;
			}
		}
		String total;
		if (count1>0) {
			total = "1";
		}
		else {
			total = "0";
		}
		for (int q = 0; q<count0; q++) {
			total = total + "0";
		}

		System.out.println(String.valueOf(total));

	}
		public static void main (String[] args) throws Exception {
			new MinBiNum().run();
		}
	}

//ArrayList<Integer> arr = new ArrayList<Integer>(); -- Creating an array new array for Integers

//sort array with Collections.sort(array); sort from least to greatest

//for(int i = 0; i < n; i++) {
	//arr.add(sc.nextInt());
//} -- For when a # of inputs are being put into an array

//sc.nextInt(); -- Put stuff in

//Look for cases like n=0 n=neg. n=1

import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        String str = sc.next();
        int mas[] = new int[a];
        int ch = 0;

        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i) == '0'){
                mas[i] = 0;
            }else{
                mas[i] = 1;
            }
        }
       // System.out.println(str);
       /* for (int i = 0; i < a; i++) {
            System.out.print(mas[i] + " ");
        }
        */
        for (int i = a - 1; i > 0; i--) {
            if(mas[i] == 1 && mas[i - 1] == 0){
                mas[i - 1] = 1;
                mas[i] = 0;
            }else if(mas[i] == 1 && mas[i - 1] == 1){
                mas[i] = 0;
                ch++;
            }
        }

        for (int i = 0; i < a - ch; i++) {
            System.out.println(mas[i]);
        }

    }
}

import java.util.*;

public class codeforce {
    public static  void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String a = sc.next();
        String b = "1";
        for (int i = 0; i < a.length(); i++) {
            if(a.charAt(i)=='0'){
                b+='0';
            }
        }
        System.out.println(b);
    }
}

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Arrays;
import java.math.BigInteger;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
     public static void main (String[] args) throws java.lang.Exception
     {
     	Scanner in =new Scanner(System.in);
		int n,j,t=1,i;
		//substring( //toCharArray();
		//Arrays.sort();
		String s1="",st="";
		int p,h,r,m,l,k;
		long x,y,z;
	     for(i=0;i<t;i++)
		{
		     p=0;h=0;
		     n=in.nextInt();
		     s1=in.next();
		     char c[]=s1.toCharArray();
		     for(j=0;j<n;j++)
		     {
		          if(c[j]=='0')
		               p++;
		     }
		     System.out.println(p+1);
		     s1="1";
		     for(j=1;j<p+1;j++)
		          s1+="0";
		     System.out.println(s1);
		}
     }
}

import java.io.BufferedReader;
import java.util.Scanner;

public class Codeforces {
    public static void main(String args[]){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        String s1 = s.next();
        int zcnt = 0;
        for(int i=0;i<n;i++){
            if(s1.charAt(i)=='0'){
                zcnt++;
            }
        }
        System.out.print("1");
        for(int i=1;i<=zcnt;i++){
            System.out.print("0");
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.StringTokenizer;

public class CodeForces {

    public static void main(String[] args) throws IOException {
        in.init(System.in);
        StringBuilder out = new StringBuilder();
        int n = in.nextInt();
        char s[] = in.nextLine().toCharArray();
        HashMap<Character, Integer> map = new HashMap<>();
        map.put('0', 0);
        map.put('1', 0);
        for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i]) + 1);
        }
        int ones = map.get('1');
        int zeros = map.get('0');
        if (ones == 0) {
            out.append("0");
        } else if(ones <= 2) {
            out.append("1");
            ones--;
            for (int i = 0; i < zeros; i++) {
                out.append("0");
            }
        } else if(ones >2) {
            out.append("0");
        }
        System.out.print(out);
    }

}

class in {

    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer(" ");
    }

    static String nextLine() throws IOException {
        return reader.readLine();
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static boolean hasNext() {
        return tokenizer.hasMoreTokens();
    }

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

    static int nextShort() throws IOException {
        return Short.parseShort(next());
    }

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

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class defauldvst_t {
    public static void main(String[] args) {
        in = new FastReader();
        int n=ni();
        char[] arr=n().toCharArray();
        int one=0;
        int zero=0;
        for (char i:arr){
            if (i=='1'){
                one++;
            }else {
                zero++;
            }

        }
        StringBuilder sb=new StringBuilder();
        sb.append(1);
        for (int i=0;i<zero;i++)sb.append("0");
        System.out.println(sb.toString());

    }
    static class pair{
        int x;
        int y;
        pair(int x,int y){
            this.x=x;
            this.y=y;
        }
    }
    public static long binarySearch(long low, long high) {
        while (high - low > 1) {
            long mid = (high - low)/2 + low;
            //System.out.println(mid);
            if (works(mid)) {
                high = mid;
            } else {
                low = mid;
            }
        }
        return (works(low) ? low : high);
    }
    static long fast_exp_with_mod(long base, long exp) {
        long MOD=1000000000+7;
        long res=1;
        while(exp>0) {
            if(exp%2==1) res=(res*base)%MOD;
            base=(base*base)%MOD;
            exp/=2;
        }
        return res%MOD;
    }
    public static long gcd(long a, long b)
    {
        if (a == 0)
            return b;
        return gcd(b%a, a);
    }
    static class my_no{
        long num;
        long denom;

        @Override
        public String toString() {
            if (denom<0){
                this.num=-this.num;
                this.denom=-this.denom;
            }
            if (num==0)return "0";
            return (num+"/"+denom);
        }

        my_no(int no){
            this.num=no;
            this.denom=1;
        }
        my_no(long num,long denom){
            this.num=num;
            this.denom=denom;
        }

        my_no multiply(my_no obj){
            long num1=obj.num;
            long denom1=obj.denom;
            long n=num1*num;
            long d=denom1*denom;
            long gcd=gcd(n,d);
            n/=gcd;
            d/=gcd;
            return new my_no(n,d);

        }
//        my_no multiply(my_no obj){
//            long num1=obj.num;
//            long denom1=obj.denom;
//            long num2=this.num;
//            long denom2=this.denom;
//
//        }

        my_no multiply(int no){
            long n=num*no;
            long d=denom;
            long gcd=gcd(n,d);
            n/=gcd;
            d/=gcd;
            return new my_no(n,d);

        }
    }
    static void memset(int[][] arr,int val){
        for (int i=0;i<arr.length;i++){
            for (int j=0;j<arr[i].length;j++){
                arr[i][j]=val;
            }
        }
    }
    static void memset(int[] arr,int val){
        for (int i=0;i<arr.length;i++){
            arr[i]=val;
        }
    }

    static void memset(long[][] arr,long val){
        for (int i=0;i<arr.length;i++){
            for (int j=0;j<arr[i].length;j++){
                arr[i][j]=val;
            }
        }
    }
    static void memset(long[] arr,long val){
        for (int i=0;i<arr.length;i++){
            arr[i]=val;
        }
    }
    static private boolean works(long test){
        return true;
    }

    static void reverse(char[] arr ,int i,int j){
        if (i==j)
            return;
        while (i<j){
            char temp=arr[i];
            arr[i]=arr[j];
            arr[j]=temp;
            ++i;
            --j;
        }
    }
    static int[]  takeIntegerArrayInput(int no){
        int[] arr=new int[no];
        for (int i=0;i<no;++i){
            arr[i]=ni();
        }
        return arr;
    }
    static long fast_Multiply(long no , long pow){
        long result=1;
        while (pow>0){
            if ((pow&1)==1){
                result=result*no;
            }
            no=no*no;
            pow>>=1;
        }
        return result;
    }

    static long[]  takeLongArrayInput(int no){
        long[] arr=new long[no];
        for (int i=0;i<no;++i){
            arr[i]=ni();
        }
        return arr;
    }
    static final long MOD = (long)1e9+7;
    static FastReader in;

    static void p(Object o){
        System.out.print(o);
    }

    static void pn(Object o){
        System.out.println(o);
    }

    static String n(){
        return in.next();
    }

    static String nln(){
        return in.nextLine();
    }

    static int ni(){
        return Integer.parseInt(in.next());
    }

    static int[] ia(int N){
        int[] a = new int[N];
        for(int i = 0; i<N; i++)a[i] = ni();
        return a;
    }

    static long[] la(int N){
        long[] a = new long[N];
        for(int i = 0; i<N; i++)a[i] = nl();
        return a;
    }

    static long nl(){
        return Long.parseLong(in.next());
    }

    static double nd(){
        return Double.parseDouble(in.next());
    }

    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next(){
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            }catch (IOException e){
                e.printStackTrace();
            }
            return str;
        }
    }
    static void println(String[] arr){
        for (int i=0;i<arr.length;++i){
            System.out.println(arr[i]);
        }
    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Created by prituladima on 5/23/18.
 */
public class MinimumBinaryNumber {

    private void solve() throws IOException {
        int n = nextInt();
        String s = nextToken();
        if (s.matches("^1[0]*")) {
            System.out.println(1);
            return;
        }
        while (true) {
            if (s.contains("01")) s = s.replace("01", "10");
            if (s.contains("11")) s = s.replace("11", "1");
            if (!s.contains("01") && !s.contains("11")) break;
        }
        System.out.println(s);
    }

    public static void main(String[] args) {
        new MinimumBinaryNumber().run();
    }

    StringTokenizer tokenizer;
    BufferedReader reader;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

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

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

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

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    int[] nextArr(int size) throws NumberFormatException, IOException {
        int[] arr = new int[size];
        for (int i = 0; i < size; i++)
            arr[i] = nextInt();
        return arr;
    }

    long[] nextArrL(int size) throws NumberFormatException, IOException {
        long[] arr = new long[size];
        for (int i = 0; i < size; i++)
            arr[i] = nextLong();
        return arr;
    }

    double[] nextArrD(int size) throws NumberFormatException, IOException {
        double[] arr = new double[size];
        for (int i = 0; i < size; i++)
            arr[i] = nextDouble();
        return arr;
    }

}

import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author anhnth37
 */
public class A_0976 {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        String s = input.next();
        System.out.println("1" + s.replace("1", ""));
    }
}

 import java.io.*;

import java.util.*;
import java.util.Collections;
import java.util.Arrays;

public class Codechef {

  public static void main(String[] args) throws IOException {

		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String s=sc.next();
		String r="1";
		for(int i=0;i<s.length();i++){
			if(s.charAt(i)=='0'){
				r=r+s.charAt(i);
			}
		}
		System.out.println(r);

  }

   }

import java.io.*;
import java.util.*;

public class ForTests {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        String s = in.next();
        ArrayList<Character> c = new ArrayList<>();
        for(int i = 0; i<s.length(); i++)
            c.add(s.charAt(i));
        Collections.sort(c, (p1, p2)->p1.equals('1')&&p2.equals('0')?-1:1);
        int l = 0;
        while(l<n && c.get(l)=='1') l++;
        out.print(1);
        for(; l<n; l++) out.print(0);
        out.flush();
    }
}

import java.io.BufferedReader;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.ArrayList;
import java.util.Scanner;
//ArrayList<Integer> list = new ArrayList<Integer>();
import java.util.Collections;
public class LOL {

		public static void main( String[] args) throws IOException {
	Scanner sc=new Scanner(System.in);
	String s=sc.nextLine();
	int n=sc.nextInt();
	String m="1";
	for(int i=0; i<s.length() ; i++) {
		if(s.charAt(i)=='0') {
			m=m+s.charAt(i);
		}
	}
	System.out.println(m);
	}
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}

		public long[] nextLongArr(int n) throws IOException {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextLong();
			return arr;
		}

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}

import java.util.*;
public class A976 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = scan.nextInt(), c = 0;
		String s = scan.next();
		for(int i = 0; i < n; i++)
			if(s.charAt(i) == '0') c++;
		sb.append(s.charAt(0));
		for(int i = 0; i < c; i++) sb.append("0");
		System.out.println(sb.toString());
	}
}

import java.util.*;
import java.util.*; import java.lang.*; import java.io.*;

  public class s{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String str = sc.next();
        int v = 0,z=0;
        for(int i = 0;i<n;i++){
            if(str.charAt(i) == '1')
                v=v+1;
            else
                z=z+1;
        }
        System.out.print("1");
        for(int i = 0;i < z;i++)
            System.out.print("0");
    }
}

import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.geom.*;
public class SuperEasy{
    public static void main(String[] args) {
      MyScanner sc=new MyScanner();
      int n=sc.ni();
      char arr[]=(sc.next()).toCharArray();
      if(arr.length==1 && arr[0]=='1') System.out.println(1);
      int cnt=0;
      for(Character c:arr)
        if(c=='0') cnt++;
      int ans=(int)Math.pow(2,cnt);
      System.out.println(Integer.toBinaryString(ans));
  }
    private static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }

      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

      int ni() {
          return Integer.parseInt(next());
      }
      float nf() {
        return Float.parseFloat(next());
      }
      long nl() {
          return Long.parseLong(next());
      }

      double nd() {
          return Double.parseDouble(next());
      }

      String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      }
   }
}

import java.util.*;
public class A976 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = scan.nextInt(), c = 0;
		String s = scan.next();
		for(int i = 0; i < n; i++)
			if(s.charAt(i) == '0') c++;
		sb.append("1");
		for(int i = 0; i < c; i++) sb.append("0");
		System.out.println(sb.toString());
	}
}

import java.lang.*;
import java.util.*;
import java.io.*;
public class test
{
  Scanner sc=new Scanner(System.in);
  PrintWriter pr=new PrintWriter(System.out,true);
  public static void main(String... args)
  {
       test c=new test();
       c.prop();
  }
  public void prop()
  {
    int n,count=0;
    n=sc.nextInt();
    StringBuffer sb=new StringBuffer("");
    String s=sc.next() ;
         for (int i=0;i<n ;++i) {
              if(s.charAt(i)=='1')
                ++count ;
            }
          sb.append("1");
        for (int i=1;i<=n-count ;++i ) {
           sb.append("0");
        }
         pr.println(sb);

  }
}

import java.util.*;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        sc.nextInt();
        String s = sc.next();
        if(s.equals("0")) {
            System.out.println("0");
            return;
        }
        if(s.equals("1")) {
            System.out.println("1");
            return;
        }
        int cnt = 0;
        for(char c: s.toCharArray()) {
            if(c=='0') cnt++;
        }
        System.out.println((int)Math.pow(10,cnt));
    }
}

import java.util.*;
import java.util.*; import java.lang.*; import java.io.*;

  public class s{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String str = sc.next();
        int v = 0,z=0;
        for(int i = 0;i<n;i++){
            if(str.charAt(i) == '1')
                v=v+1;
            else
                z=z+1;
        }
        int d = v/2,r = v%2;
        for(int i = 0;i<d;i++)
            System.out.print("1");
        for(int i = 0;i<r;i++)
            System.out.print("1");
        for(int i = 0;i < z;i++)
            System.out.print("0");
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class Binary {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in =new Scanner (System.in);
		int n=in.nextInt();
		String s=in.next();
		char[] arr= s.toCharArray();
		Arrays.sort(arr);
		StringBuilder ans=new StringBuilder();
		for(int i=0;i<n;i++) {
			ans.append('0'==arr[i]?"0":"");
		}
		System.out.println(s.contains("1")?"1":""+ans.toString());
	}
}

import java.util.*;
import java.io.*;

public class gfg
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		int zero = 0;
		int one = 0;
		for(int i=0; i<n; i++)
		{
			if(s.charAt(i)=='1')
				one++;
			else
				zero++;
		}
		if(one!=1)
			one = one/2;

		while(one-->0)
			System.out.print(1);
		while(zero-->0)
			System.out.print(0);
	}
}

import java.util.*;

public class codeforce {
    public static  void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String a = sc.next();
        String b = "1";
        for (int i = 0; i < a.length(); i++) {
            if(a.charAt(i)=='0'){
                b+='0';
            }
        }
        System.out.println(b);
    }
}

import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        in.nextByte();
        String s = in.next();
        char a[] = s.toCharArray();
        Arrays.sort(a);
        s = new String(a);
        s = s.substring(0, s.indexOf('1')+1);
        for (int i = s.length()-1; i >= 0; i--) System.out.print(s.charAt(i));
    }
}

import java.io.*;
import java.math.*;
import java.util.*;
public class poogramA {
		public static void main (String[] args)throws IOException {
		   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		   int n = Integer.parseInt(br.readLine());
		   String str1 = br.readLine();
		   int ocunt= 0;
		   for(int i=0;i<str1.length();i++) {
			   if(str1.charAt(i) == '0')ocunt++;
		   }
		   System.out.print(1);
		   for(int i=0;i<ocunt;i++) {
			   System.out.print(0);
		   }
		}
	}

import java.util.*;
import java.io.*;
import java.math.*;
public class hi{

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int nb = 0;
        for(int i=0;i<n;i++){
            if(s.charAt(i)=='0') nb++;
        }
        System.out.print("1");
        for(int i=0;i<nb;i++) System.out.print("0");
        System.out.println("");

    }

}

import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        char a[] = s.toCharArray();
        Arrays.sort(a);
        s = new String(a);
        s = s.substring(0, s.indexOf('1')+1);
        for (int i = s.length()-1; i >= 0; i--) System.out.print(s.charAt(i));
    }
}

//package codeforces;

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int len = sc.nextInt();
		String str = sc.nextLine();
		if (len < 2) {
			System.out.println(str);
		} else {
			String[] str_char = str.split("");
			StringBuffer sb = new StringBuffer("1");
			for (int i = 0; i < str_char.length; i++) {
				if(str_char[i].equals("0")){
					sb.append("0");
				}
			}
			System.out.println(sb);
		}

	}

}

import java.util.*;
public class A976 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt(), c = 0;
		String s = scan.next();
		for(int i = 0; i < n; i++)
			if(s.charAt(i) == '0') c++;
		System.out.println((long)Math.pow(10, c));
	}
}

import java.io.BufferedReader;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.ArrayList;
import java.util.Scanner;
//ArrayList<Integer> list = new ArrayList<Integer>();
import java.util.Collections;
public class LOL {

		public static void main( String[] args) throws IOException {
	Scanner sc=new Scanner(System.in);
	int n=sc.nextInt();
	String s=sc.nextLine();

	String m="1";
	for(int i=0; i<s.length() ; i++) {
		if(s.charAt(i)=='0') {
			m=m+s.charAt(i);
		}
	}
	System.out.println(m);
	}
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}

		public long[] nextLongArr(int n) throws IOException {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextLong();
			return arr;
		}

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}

import java.io.IOException;
import java.awt.color.*;
import java.util.*;
import java.math.*;
import java.io.*;
import java.util.InputMismatchException;

@SuppressWarnings("unused")
public class main {
	public static void main(String[] args) {
                new main().solve();
                                  }
            public void solve() {
            	int n=sc.nextInt();String d="";
            	String s=sc.next();int c=0;
            	for(int i=0;i<n;i++) {
            		if(s.charAt(i)=='1')
            			c++;
            	}
            	if(c==0)
            		System.out.println(s);
            	else if(c%2==0) {
            		 d="1";
            		for(int i=0;i<n-c;i++)
            			d=d+"0";
            		if(c-2>0)
            			d=d+"1";
            	}
            	else {
            		d="1";
            		for(int i=0;i<n-c;i++)
            			d=d+"0";
            		if(c-2>0)
            			d=d+"1";
            	}
            	System.out.println(d);

           }

          /*  boolean[] sieveOfEratosthenes(int n)
            {

                // (a / b) % m = (a % m * b^(m - 2) % m) % mCreate a boolean array "prime[0..n]" and initialize
                // all entries it as true. A value in prime[i] will
                // finally be false if i is Not a prime, else true.
                boolean prime[] = new boolean[n+1];
                for(int i=0;i<n;i++)
                    prime[i] = true;

                for(int p = 2; p*p <=n; p++)
                {
                    // If prime[p] is not changed, then it is a prime
                    if(prime[p] == true)
                    {
                        // Update all multiples of p
                        for(int i = p*2; i <= n; i += p)
                            prime[i] = false;
                    }
                }

                // Print all prime numbers
               return prime;
            }

   /*         void DFS(int v,boolean visited[])
    {
        // Mark the current node as visited and print it
        visited[v] = true;
        System.out.print(v+" ");

        // Recur for all the vertices adjacent to this vertex
        Iterator<Integer> i = adj[v].listIterator();
        while (i.hasNext())
        {
            int n = i.next();
            if (!visited[n])
                DFS(n, visited);
        }
    }*/
    /*static int binomialCoeff(int n, int k)
    {
        int C[] = new int[k + 1];

        // nC0 is 1
        C[0] = 1;

        for (int i = 1; i <= n; i++)
        {
            // Compute next row of pascal
            // triangle using the previous row
            for (int j = Math.min(i, k); j > 0; j--)
                C[j] = C[j] + C[j-1];
        }
        return C[k];
    }*/

          FastReader sc=new FastReader();
static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }}

import java.util.*;
import java.util.*; import java.lang.*; import java.io.*;

  public class s{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String str = sc.next();
        int v = 0,z=0;
        for(int i = 0;i<n;i++){
            if(str.charAt(i) == '1')
                v=v+1;
            else
                z=z+1;
        }
        System.out.print("1");
        for(int i = 0;i < z;i++)
            System.out.print("0");
    }
}

import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextLine();
		char[] c = sc.nextLine().toCharArray();
		int count = 0;
		for (int i = 0; i < c.length; i++) {
			if(c[i] == '0') {
				count++;
			}
		}
		System.out.print("1");
		for (int i = 0; i < count; i++) {
			System.out.print("0");
		}
		System.out.println();
		sc.close();
	}
}

/*input
4
1001

*/
import java.io.*;
import java.util.*;
public class Main
{
    public static void main(String[] args) throws Exception
    {
        Bolt sc=new Bolt(System.in);
        int n=sc.nextInt();
        String s=sc.next();
        int count=0;
        if(n==1)
            System.out.println(s);
        else
        {
            for(int i=1;i<n;i++)
            {
                if(s.charAt(i)=='0')
                    count++;
            }
        }
        // n=n-count-1;
        System.out.print(1);
        for(int i=0;i<count;i++)
            System.out.print(0);

    }
}
class Bolt{

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        Bolt(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan());
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan());
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }

        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan());
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
 *
 * @author Ahmad
 */
public class JavaApplication1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       FastReader console = new FastReader();
       int n = console.nextInt() ;
       String x = console.next();
       String one = "" ;
       String zero = "" ;
       String f = "" ;
       int count  = 0 ;
       for (int i=0 ; i<x.length() ; i++){
           if (x.charAt(i)=='0'){
               zero+=x.charAt(i) ;
           }
           else {
               one+=x.charAt(i) ;
           }
       }
       if (one.length()%2==0){
      for (int i=0 ; i<one.length() ; i++){
            count ++ ;
            if (count==2){
                f+="1" ;
            }
      }
      }
       else {
       for (int i=0 ; i<one.length()-1 ; i++){
            count ++ ;
            if (count==2){
                f+="1" ;
            }
        }
       f+="1" ;
       }
        System.out.println(f+zero);
  }
}
class FastReader {

    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

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

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

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

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}

import java.io.*;
import java.math.BigInteger;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {

    static final int INF = Integer.MAX_VALUE;

    static void mergeSort(int[] a, int[] b, int p, int r) {
        if (p < r) {
            int q = (p + r) / 2;
            mergeSort(a, b, p, q);
            mergeSort(a, b, q + 1, r);
            merge(a, b, p, q, r);
        }
    }

    static void merge(int[] a, int[] b, int p, int q, int r) {
        int n1 = q - p + 1;
        int n2 = r - q;
        int[] L = new int[n1 + 1], R = new int[n2 + 1];
        int[] L1 = new int[n1 + 1], R1 = new int[n2 + 1];

        for (int i = 0; i < n1; i++) {
            L[i] = a[p + i];
            L1[i] = b[p + i];

        }
        for (int i = 0; i < n2; i++) {
            R[i] = a[q + 1 + i];
            R1[i] = b[q + 1 + i];

        }
        L[n1] = R[n2] = INF;
        L1[n1] = R1[n2] = INF;

        for (int k = p, i = 0, j = 0; k <= r; k++) {
            if (L[i] <= R[j]) {
                a[k] = L[i];
                b[k] = L1[i++];

            } else {
                a[k] = R[j];
                b[k] = R1[j++];

            }
        }
    }

    static void mergeSort(int[] a, int p, int r) {
        if (p < r) {
            int q = (p + r) / 2;
            mergeSort(a, p, q);
            mergeSort(a, q + 1, r);
            merge(a, p, q, r);
        }
    }

    static void merge(int[] a, int p, int q, int r) {
        int n1 = q - p + 1;
        int n2 = r - q;
        int[] L = new int[n1 + 1], R = new int[n2 + 1];

        for (int i = 0; i < n1; i++) {
            L[i] = a[p + i];

        }
        for (int i = 0; i < n2; i++) {
            R[i] = a[q + 1 + i];

        }
        L[n1] = R[n2] = INF;

        for (int k = p, i = 0, j = 0; k <= r; k++) {
            if (L[i] <= R[j]) {
                a[k] = L[i++];

            } else {
                a[k] = R[j++];

            }
        }
    }

    public static int[] sieve(int n) {
        int a[] = new int[n + 1];
        for (int i = 2; i <= n; i++) {
            a[i] = 1;
        }
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (a[i] == 1) {
                for (int k = 2; i * k <= n; k++) {
                    a[i * k] = 0;
                }
            }
        }
        return a;
    }

    public static long sum(int a) {
        long su = 0;
        while (a > 0) {
            su += (long) a % 10;
            a /= 10;
        }
        return su;
    }

    public static int divi(int b) {
        int n = 0;
        for (int i = 2; i <= Math.sqrt(b); i++) {
            if (b % i == 0) {
                n = i;
                break;
            }
        }
        if (n == 0) {
            return b;
        }
        return n;
    }

    public static boolean prime(int n) {
        if (n == 1) {
            return true;
        }

        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

    public static String reve(int a, int b, String s) {
        String q = "";
        for (int i = b; i >= a; i--) {
            q += s.charAt(i);
        }
        return q;
    }

    public static boolean isvowel(char c) {
        if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y') {
            return true;
        } else {
            return false;
        }
    }

    static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    public static int hole(int n) {
        int y = 0;
        if (n == 1) {
            return 0;
        }
        if (prime(n)) {
            return 1;
        }
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                if (prime(i)) {
                    y++;
                }
                if (prime(n / i) && i != (n / i)) {
                    y++;
                }
            }
        }
        return y;
    }

    static List<Integer> gd(int a, int b) {
        int m = (int) gcd(a, b);
        List<Integer> q = new ArrayList();
        for (int i = 1; i * i <= m; ++i) {
            if (m % i == 0) {
                q.add(i);
                if (i != m / i) {
                    q.add(m / i);
                }
            }
        }
        return q;
    }

    static boolean contain(int[] a) {
        for (int i = 1; i < a.length; i++) {
            if (a[i] == 0) {
                return true;
            }
        }
        return false;
    }

    static void decrease(int[] a) {
        for (int i = 1; i < a.length; i++) {
            a[i]--;
        }
    }

    static long power(StringBuilder s) {
        long c = 1, sum = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == 'C') {
                c *= 2;
            } else {
                sum += c;
            }
        }
        return sum;
    }

    static long sum(long n) {
        return n * (n + 1) / 2;
    }

    static int divisors(int n) {
        Set<Integer> c = new HashSet();
        for (int i = 1; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                c.add(i);
                c.add((int) (n / i));
            }
        }
        return c.size();
    }

    public static void main(String[] args) throws IOException, ParseException {
        InputReader in = new InputReader(System.in);
        OutputWriter or = new OutputWriter(System.out);
       int n= in.nextInt();
      StringBuilder s= new StringBuilder(in.nextLine());
      int o=0,z=0;
        for (int i = 0; i < n; i++) {
            if (s.charAt(i)=='1') {
                o++;
            }
            else z++;
        }
        StringBuilder d= new StringBuilder();
        int y=o;
        for (int i = 0; true; ) {
            if(z==0 && o==0)break;
            if (o>0) {
                d.append('1');
                o--;
            }
            else if(z>0){
                d.append('0');
                z--;
            }
        }
        for (int i = 0; i < d.length()-1; i++) {

             if (d.charAt(i)=='1'&&d.charAt(i+1)=='1') {
                d.deleteCharAt(i);
                //i--;
            }
        }
        if (y==0) {
            or.print(0);
        }
            else or.print(d);

        or.flush();
    }
}

class Pair implements Comparable<Pair> {

    int ind;
    int lef;
    int arr;

    public Pair(int n, int p, int C) {
        ind = n;
        arr = p;
        lef = C;
    }

    @Override
    public int compareTo(Pair o) {
        if (o.arr - arr == 0) {
            return -1 * (o.ind - ind);
        }

        return -1 * (o.arr - arr);
    }

}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}

import java.util.Scanner;
//http://codeforces.com/contest/976/problem/A
public class MinimumBinaryNumber {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextLine();
		char[] c = sc.nextLine().toCharArray();
		sc.close();
		if(c.length==0 && c[0] == '0') {
			System.out.println("0");
			return;
		}
		int count0 = 0;
		for (int i = 0; i < c.length; i++) {
			if (c[i] == '0') {
				count0++;
			}
		}
		System.out.print("1");
		for (int i = 0; i < count0; i++) {
			System.out.print("0");
		}
		System.out.println();
	}
}

import java.io.BufferedReader;
import java.util.Scanner;

public class Codeforces {
    public static void main(String args[]){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        String s1 = s.next();
        int zcnt = 0;
        for(int i=0;i<n;i++){
            if(s1.charAt(i)=='0'){
                zcnt++;
            }
        }
        System.out.print("1");
        for(int i=1;i<=zcnt;i++){
            System.out.print("0");
        }
    }
}

import java.util.*;
public class Minbin {
	public static void main(String[] args)
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		String s=in.next();
		char[] ch= new char[n];
		int[] a=new int[n];
		int count1=0,count2=0;
		for(int i=0;i<n;i++)
		{
			ch[i]=s.charAt(i);
			a[i]=Character.getNumericValue(ch[i]);
			if(a[i]==0)
			{
				count1++;
			}
			if(a[i]==1)
			{
				count2++;
			}
		}
		for(int i=0;i<n;i++)
		{
			if(a[i]==0)
			{
				count1--;
			}
			if(a[i]==1)
			{
				break;
			}
		}
		if(count2!=0)
			System.out.print("1");
		for(int i=0;i<count1;i++)
		{
			System.out.print("0");
		}
	}
}

import java.io.BufferedReader;
import java.util.Scanner;

public class Codeforces {
    public static void main(String args[]){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        String s1 = s.next();
        int onecnt = 0;
        for(int i=1;i<n;i++){
            if(s1.charAt(i)=='1'){
                onecnt++;
            }
        }
        System.out.print("1");
        for(int i=1;i<n-onecnt;i++){
            System.out.print("0");
        }
    }
}

import java.util.ArrayList;

import java.util.Scanner;

public class Duplicateelement {

    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        int n,c=0,c1=0;
        n=input.nextInt();
        String s;
        s=input.next();
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i)=='1'){
                c++;
            }else{
                c1++;
            }
        }
        if(c>1 || c==0){
        for (int i = 0; i < (int)Math.ceil(c/2.0); i++) {
            System.out.print("1");
        }
        for (int i = 0; i < c1; i++) {
            System.out.print("0");
        }
        }else{
             System.out.print("1");
        }

    }

}

import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        in.nextByte();
        String s = in.next();
        char a[] = s.toCharArray();
        Arrays.sort(a);
        s = new String(a);
        s = s.substring(0, s.indexOf('1')+1);
        for (int i = s.length()-1; i >= 0; i--) System.out.print(s.charAt(i));
    }
}

import java.util.Scanner;

public class educational {
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		int a = sc.nextInt();
		String s = sc.next();
		int z= countZ(s);
		if(s.equals("0"))
			System.out.println("0");
		else
		if (z==0)
			System.out.println(s);
		else {
			System.out.print("1");
			for (int i = 0; i < z; i++) {
				System.out.print("0");
			}
		}

	}
	public static int countZ (String s) {
		int x =0;
		for (int i = 0; i < s.length(); i++) {
			if(s.charAt(i)=='0')
				x++;
		}
		return x;
	}

}

/**
 * Created by nikhil on 30/4/18.
 */
import java.io.IOException;
import java.util.*;
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt();
        int oneCount = 0;
        int zeroCount = 0;
        while(l != 0){
            int c = System.in.read();
            if(c == '1'){
                oneCount++;
            } else {
                zeroCount++;
            }
            l--;
        }

        StringBuffer sb = new StringBuffer();
        sb.append(1);
        oneCount--;
        while(zeroCount != 0) {
            sb.append(0);
            zeroCount--;
        }

        System.out.print(sb);
    }
}

//package codeforces;

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		if (str.length() < 2) {
			System.out.println("0");
		} else {
			String[] str_char = str.split("");
			StringBuffer sb = new StringBuffer("1");
			for (int i = 0; i < str_char.length; i++) {
				if(str_char[i].equals("0")){
					sb.append("0");
				}
			}
			System.out.println(sb);
		}

	}

}

import java.util.*;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        sc.nextInt();
        String s = sc.next();
        if(s.equals("0")) {
            System.out.println("0");
            return;
        }
        if(s.equals("1")) {
            System.out.println("1");
            return;
        }
        int cnt = 0;
        for(char c: s.toCharArray()) {
            if(c=='0') cnt++;
        }
        System.out.println((int)Math.pow(10,cnt));
    }
}

import java.io.IOException;
import java.util.Scanner;

public class AMinimumBinaryNumber {

    public static void main(String[] args)throws IOException
    {

        Scanner in = new Scanner(System.in);
         int n;
        String s;
        n=in.nextInt();
        s=in.nextLine();
        s=in.nextLine();
        int l=s.length();
        int p=0;
         //System.out.println(l);
        for(int i=0;i<l;i++)
        {
        if(s.charAt(i)=='0')p++;
        }
        System.out.print('1');
        for(int i=0;i<p;i++)
        {
        System.out.print(0);
        }
          System.out.println();
    }

}

import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String S = sc.next();
    sc.close();

    String[] s = S.split("");

    int[] v = new int[2];

    for (int i = 0; i < n; i++) {
      int l = Integer.valueOf(s[i]);
      v[l]++;
    }

    if (s.equals("0")) {
      System.out.println("0");
    } else {
      System.out.print("1");
      for (int i = 0; i < v[0]; i++) {
        System.out.print("0");
      }
      System.out.println("");
    }

  }

}

import java.util.*;

public class MinBinary {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		input.nextLine();
		String s = input.nextLine();
		int count1 = 0;
		int count0 = 0;
		for (int i = 0; i<n; i++) {
			if (s.charAt(i)=='0') count0++;
			else count1++;
		}
		if (count1 == 0) {
			System.out.println(0);
		}
		else if (count0 == 0) {
			if (count1%2 == 0) {
				System.out.println("");
			}
			else {
				System.out.println("1");
			}
		}
		else {
			System.out.print("1");
			for(int i = 0; i<count0; i++) {
				System.out.print(0);
			}
		}
	}
}

import java.util.*;

public class MinBinary {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		input.nextLine();
		String s = input.nextLine();
		int count1 = 0;
		int count0 = 0;
		for (int i = 0; i<n; i++) {
			if (s.charAt(i)=='0') count0++;
			else count1++;
		}
		if (count1 == 0) {
			System.out.println(0);
		}
		else if (count0 == 0) {
			if (count1%2 == 0) {
				System.out.println("11");
			}
			else {
				System.out.println("1");
			}
		}
		else {
			System.out.print("1");
			for(int i = 0; i<count0; i++) {
				System.out.print(0);
			}
		}
	}
}

import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        char a[] = s.toCharArray();
        Arrays.sort(a);
        s = new String(a);
        s = s.substring(0, s.indexOf('1')+1);
        for (int i = s.length()-1; i >= 0; i--) System.out.print(s.charAt(i));
    }
}

import java.util.*;
public class A976 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		scan.nextInt();
		String s = scan.next();
		System.out.print(s.charAt(0) == '1' ? "1" : "" + s.replace("1", ""));
	}
}

import java.util.*;

public class q1 {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String s = sc.next();
    String[] out = s.split("");
    for(int i=0; i<n-1; i++) {
       if(!out[i].equals(out[i+1])) {
         String tmp = out[i];
         out[i] = out[i+1];
         out[i+1] = tmp;
       } else if(out[i].equals(out[i+1]) && out[i].equals("1")){
         out[i] = "-1";
       }
    }
    for(int i=n-1;i>=0;i--) {
      if(out[n-1].equals("0")) {
        out[n-1] = "-1";
      }
       if(out[i] != "-1") {
        System.out.print(out[i]);
      }
    }
  }
}

import java.io.BufferedReader;
import java.util.Scanner;

import java.util.Scanner;

public class Codeforces {
    public static void main(String args[]){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        String str = s.next();
        int zcnt = 0;
        if(s.equals("0")){
            System.out.println(0);
            return;
        }
        for(int i=0;i<n;i++){
            if(str.charAt(i)=='0') zcnt++;
        }
        System.out.print(1);
        while (zcnt-->0){
            System.out.print(0);
        }
    }
}

import java.util.Scanner;
public class Ishu
{
	public static void main(String[] args)
	{
	Scanner scan=new Scanner(System.in);
	int n,zero=0,i;
	String str;
	n=scan.nextInt();
	str=scan.next();
	for(i=0;i<n;++i)
		if(str.substring(i,i+1).equals("0"))
			++zero;
	System.out.print(1);
	while(zero>0)
		{
		System.out.print(0);
		--zero;
		}
	}
}

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.nextLine();
		if(s.equals("0")) System.out.println(0);
		else {
			StringBuilder sb = new StringBuilder();
			sb.append('1');
			for(int i = 0 ; i < s.length() ; ++i) {
				if(s.charAt(i) == '0') sb.append('0');
			}
			System.out.println(sb);
		}
	}

}

import java.util.ArrayList;

import java.util.Scanner;

public class Duplicateelement {

    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        int n,c=0,c1=0;
        n=input.nextInt();
        String s;
        s=input.next();
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i)=='1'){
                c++;
            }else{
                c1++;
            }
        }
        if(c>1 || c==0){
        for (int i = 0; i < (int)Math.ceil(c/2.0); i++) {
            System.out.print("1");
        }
        for (int i = 0; i < c1; i++) {
            System.out.print("0");
        }
        }else{
             System.out.print("1");
        }

    }

}

import java.util.Scanner;

public class MinimumBinaryNumber_976A {
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		@SuppressWarnings("unused")
		int n = input.nextInt();
		String str = input.next();
		long zero = str.chars().filter(x -> x == '0').count();
		if (n == 1 && str.charAt(0) == 0) {
			System.out.println(0);
			return;
		}
		System.out.print(1);
		while (zero-- > 0) {
			System.out.print(0);
		}
		input.close();
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.StringTokenizer;

public class CodeForces {

    public static void main(String[] args) throws IOException {
        in.init(System.in);
        StringBuilder out = new StringBuilder();
        int n = in.nextInt();
        char s[] = in.nextLine().toCharArray();
        HashMap<Character, Integer> map = new HashMap<>();
        map.put('0', 0);
        map.put('1', 0);
        for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i]) + 1);
        }
        int ones = (int) Math.ceil(map.get('1') / 2.0);
        int zeros = map.get('0');
        if (ones == 0) {
            out.append("0");
        } else if (zeros == 0) {
            for (int i = 0; i < ones; i++) {
                out.append("1");
            }
        } else {
            out.append("1");
            ones--;
            for (int i = 0; i < zeros; i++) {
                out.append("0");
            }
            for (int i = 0; i < ones; i++) {
                out.append("1");
            }
        }
        System.out.print(out);
    }

}

class in {

    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer(" ");
    }

    static String nextLine() throws IOException {
        return reader.readLine();
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static boolean hasNext() {
        return tokenizer.hasMoreTokens();
    }

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

    static int nextShort() throws IOException {
        return Short.parseShort(next());
    }

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

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

import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author sachi
 */
public class CodeForces {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();//length of string
        String s = sc.next();
        if(s.equals("1")){
            System.out.println("1");
        }else{
            int x= getCount(s);
            System.out.print("1");
            for(int i=0;i<x;i++){
                System.out.print("0");
            }
        }
    }
    private static int getCount(String s){
        int count =0;
        for(int i=1;i<s.length();i++){
            if(s.charAt(i)=='0')
                count++;
        }
        return count;
    }
}

import java.util.Scanner;
public class minimom {
public static void main(String[] args) {
	Scanner scanner = new Scanner (System.in);
	int n = scanner.nextInt(),sum=0;
	String s = scanner.next();
	for (int i=0;i<n;i++) {
		if (s.charAt(i)=='0') sum++;
	}
	System.out.print(1);
	for (int i=0;i<sum;i++) {
		System.out.print(0);
	}
	scanner.close();
}
}

import java.util.*;
public class _976A
{

	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		int i, ones = 0, zeros = 0, len = s.length();
		for(i = 0 ; i < len ; i++)
			if(s.charAt(i) == '1')	ones++;
			else					zeros++;
		StringBuilder sb = new StringBuilder();
		sb.append("1");
		for(i = 0 ; i < zeros ; i++)
			sb.append("0");
		System.out.println(sb);
		scan.close();

	}

}

import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.*;

public class MinBiNum {
	public void run() throws Exception {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s = sc.next();

		int count1 = 0;
		int count0 = 0;

		for (int i = 0; i<n; i++) {
			if (s.substring(i, i+1).equals("1")) {
				count1++;
			}
			else {
				count0++;
			}
		}

		if (count1%2 == 0) {
			count1 = count1/2-1;
		}
		else {
			count1 = count1/2;
		}
		String total = "1";
		for (int q = 0; q<count0; q++) {
			total = total + "0";
		}
		for (int w = 0; w<count1; w++) {
			total = total + "1";
		}

		System.out.println(total);

	}
		public static void main (String[] args) throws Exception {
			new MinBiNum().run();
		}
	}

//ArrayList<Integer> arr = new ArrayList<Integer>(); -- Creating an array new array for Integers

//sort array with Collections.sort(array); sort from least to greatest

//for(int i = 0; i < n; i++) {
	//arr.add(sc.nextInt());
//} -- For when a # of inputs are being put into an array

//sc.nextInt(); -- Put stuff in

//Look for cases like n=0 n=neg. n=1

import java.io.*;
import java.math.*;
import java.util.*;
public class poogramA {
		public static void main (String[] args)throws IOException {
		   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		   int n = Integer.parseInt(br.readLine());
		   String str1 = br.readLine();
		   int ocunt= 0;
		   for(int i=0;i<str1.length();i++) {
			   if(str1.charAt(i) == '0')ocunt++;
		   }
		   System.out.print(1);
		   for(int i=0;i<ocunt;i++) {
			   System.out.print(0);
		   }
		}
	}

import java.util.*;

public class P976A{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();
		String s = sc.nextLine();

		int counter = 0;
		for(int i=0; i<n; i++){
			if(s.charAt(i)=='0'){
				counter++;
			}
		}

		String ans = "1";
		for(int i=0; i<counter; i++){
			ans = ans+"0";
		}

		System.out.println(ans);
	}
}

import java.util.*;

public class Sol
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    if(s=="0")
      System.out.println(0);
    else
    {
      System.out.print(1);
      for(int i=0; i<s.length(); i++)
        if(s.charAt(i)=='0')
          System.out.print(0);
      System.out.println("");
    }
  }
}

import java.util.*;
public class A {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        String s = in.next();
        char[] c = s.toCharArray();
        int c0 = 0;
        for (char ch : c) {
            if (ch == '0') c0++;
        }

        StringBuilder sb = new StringBuilder();
        sb.append("1");
        for (int i = 0; i < c0; i++)  sb.append("0");
        System.out.println(sb.toString());
    }
}

import java.util.Scanner;

public class educational {
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		int a = sc.nextInt();
		String s = sc.next();
		int z= countZ(s);
		if(s.equals("0"))
			System.out.println("0");
		else
		if (z==0)
			System.out.println(s);
		else {
			System.out.print("1");
			for (int i = 0; i < z; i++) {
				System.out.print("0");
			}
		}

	}
	public static int countZ (String s) {
		int x =0;
		for (int i = 0; i < s.length(); i++) {
			if(s.charAt(i)=='0')
				x++;
		}
		return x;
	}

}

//I AM THE CREED
/* //I AM THE CREED
/* package codechef; // don't place package name! */
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.*;
import java.awt.Point;
public class Main{
    static HashMap<Integer, Integer> log=new HashMap<>();
    public static void main(String[] args) throws IOException
    {

        Scanner input = new Scanner(System.in);

        while(input.hasNext()){
            int n=input.nextInt();
            String s=input.next();
            int one=0;
            int z=0;
            for(int i=0;i<n;i++){
                if(s.charAt(i)=='1'){
                    one++;
                    continue;
                }
                z++;
            }
            StringBuilder sb=new StringBuilder();

            one=1;
            while(one>0 || z>0){
                if(one!=0){
                    sb.append("1");
                    one--;
                    continue;
                }
                sb.append("0");
                z--;
            }
            System.out.println(sb.toString());
        }
    }

}

import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        cin.nextLine();
        String s = cin.nextLine();

        int dem=0;
        for(int i=0;i<s.length();i++){
            if(s.charAt(i) == '0')
                dem++;
        }

        System.out.print("1");
        for(int i=0;i<dem;i++)
            System.out.print("0");

    }
}

import java.io.*;
import java.util.*;
//import java.util.stream.*;;
//import java.math.*;

public class Main {

    public static boolean vowel(char c) {
        String v = "aeiouy";
        return v.contains(Character.toString(c));
    }

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        br.readLine();
        String s = br.readLine();
        String str = "1";
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                str += "0";
            }
        }
        System.out.println(str);
        bw.flush();
    }
}

import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import static java.lang.Math.*;
import java.util.concurrent.ThreadLocalRandom;

public class Sol implements Runnable {

    long mod = (long)1e9 + 7;

    void solve(InputReader in, PrintWriter w) {
        int n = in.nextInt();
        String s = in.next();

        int ones = 0, zeroes = 0;
        for(int i=0;i<s.length();i++) if(s.charAt(i) == '1') ones++; else zeroes++;

        ones = (ones / 2) + (ones % 2);

        String S = "";
        if(ones != 0) {
            S += "1";
            ones--;
        }

        for(int i=0;i<zeroes;i++) S += "0";
        for(int i=0;i<ones;i++) S += "1";

        w.println(S);
    }

    // ************* Code ends here ***************

    void init() throws Exception {
        //Scanner in;
        InputReader in;
        PrintWriter w;
        boolean online = false;

        String common_in_fileName = "in";
        String common_out_fileName = "\\out";
        int test_files = 0;

        for(int file_no = 0; file_no <= test_files; file_no++) {

            String x = "" + file_no;
            if (x.length() == 1) x = "0" + x;

            String in_fileName = common_in_fileName;// + "" + x;
            String out_fileName = common_out_fileName;// + "" + x;

            if (online) {
                //in = new Scanner(new File(in_fileName + ".txt"));
                in = new InputReader(new FileInputStream(new File(in_fileName + ".txt")));
                w = new PrintWriter(new FileWriter(out_fileName + ".txt"));
            } else {
                //in = new Scanner(System.in);
                in = new InputReader(System.in);
                w = new PrintWriter(System.out);
            }

            solve(in, w);
            w.close();
        }
    }

    public void run() {
        try {
            init();
        }
        catch(Exception e) {
            System.out.println(e);
            e.printStackTrace();
        }
    }

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

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public String nextLine() {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public int nextInt() {
            int c = read();

            while (isSpaceChar(c)) {
                c = read();
            }

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, nextInt());
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E') {
                        return res * Math.pow(10, nextInt());
                    }
                    if (c < '0' || c > '9') {
                        throw new InputMismatchException();
                    }
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class Binary {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in =new Scanner (System.in);
		int n=in.nextInt();
		String s=in.next();
		char[] arr= s.toCharArray();
		Arrays.sort(arr);
		StringBuilder ans=new StringBuilder();
		for(int i=0;i<n;i++) {
			ans.append('0'==arr[i]?"0":"");
		}
		System.out.println("1"+ans.toString());
	}
}

import java.io.IOException;
import java.util.Scanner;

public class AMinimumBinaryNumber {

    public static void main(String[] args)throws IOException
    {

        Scanner in = new Scanner(System.in);
         int n;
        String s;
        n=in.nextInt();
        s=in.nextLine();
        s=in.nextLine();
        int l=s.length();
        int p=0;
         //System.out.println(l);
        for(int i=0;i<l;i++)
        {
        if(s.charAt(i)=='0')p++;
        }
        System.out.print('1');
        for(int i=0;i<p;i++)
        {
        System.out.print(0);
        }
          System.out.println();
    }

}

import java.util.Scanner;

public class Driver {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		String str = input.next();
		int counter0 = 0, counter1 = 0;
		for (int i = 0; i < str.length(); i++) {
			if (str.charAt(i) == '0') {
				counter0++;
			} else {
				counter1++;
			}
		}

		String out = "1";
		for (int i = 0; i < counter0; i++) {
			out += "0";

		}
	System.out.println(out);
	}
}

import java.util.Scanner;

public class BinaryTo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int n=Integer.parseInt(sc.nextLine());
		String t=sc.nextLine();
		if(t=="0"){
			System.out.println("0");
		}
		String y="";
		for(int i=0;i<t.length();i++){
			if(t.charAt(i)=='0'){
				y+="0";
			}
		}

		System.out.println("1"+y);
	}

}

import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Practice {

		public static void main(String []args)
		{
			Scanner sc=new Scanner(System.in);
			int n=sc.nextInt();
			sc.nextLine();
			String s=sc.nextLine();
			//System.out.println(s);
			char c[]=s.toCharArray();
			ArrayList a =new ArrayList();

			for(int i=0;i<c.length;i++)
			{
				//System.out.println(c[i]);
				a.add(c[i]);
			}

			int x=Collections.frequency(a,'0' );
			int y=Collections.frequency(a,'1');

			//System.out.println(x+ "  "+y );
			if(y==1)
			{
				System.out.println(s);
			}
			else
			{
				if(y>=2)
				{
					String s1="1";
					for(int i=0;i<x;i++)
					{
						s1=s1+"0";
					}
					System.out.println(s1);

				}
			}

	}

}