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
    {
        Reader ob=new Reader();
        String s=ob.readLine();
        int a[]=new int[s.length()];
        int g, h, i, j;
        int numone=0;
        for(i=0;i<s.length();i++)
        {
            if(s.charAt(i)=='1')
                numone++;
        }
        j=0;
        int k=0;
        String s1="";
        for(i=0;i<s.length();i++)
        {
            if(s.charAt(i)=='0')
            {
                j++;
            }
            else if(s.charAt(i)=='2')
            {
                a[k]=j;
                j=0;
                k++;
            }
        }
        if(j!=0)
        {
            a[k]=j;
            k++;
        }
        for(i=1;i<=a[0];i++)
            s1=s1+'0';
        for(i=1;i<=numone;i++)
            s1=s1+'1';
        s1=s1+'2';
        for(i=1;i<k;i++)
        {
            for(int jj=1;jj<=a[i];jj++)
            {
                s1=s1+'0';
            }
            if(i!=k-1)
                s1=s1+'2';
            else
            {
                if(j!=0)
                {}
                else
                    s1=s1+'2';
            }
        }
        System.out.println(s1);
    }
}


import java.io.*;
import java.util.*;
public class Solution
{
    public static void main(String[] args)throws IOException
    {
        BufferedReader ob=new BufferedReader(new InputStreamReader(System.in));
        String s=ob.readLine();
        int g, h, i, j;
        String s1="";
        String s3="";
        for(i=0;i<s.length();i++)
        {
            char x=s.charAt(i);
            if(x=='0')
            {
                s1+='0';
            }
            else if(x=='1')
                s3+='1';
            else
            {
                s1+='2';
            }
        }
        i=s1.indexOf('2');
        if(i>=0)
        {
            s1=s1.substring(0,i)+s3+s1.substring(i,s1.length());
        }
        System.out.println(s1);
    }
}


import java.io.*;
import java.util.*;
public class Solution
{
    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;
        }
    }

    public static void main(String[] args)throws IOException
    {
        //BufferedReader ob=new BufferedReader(new InputStreamReader(System.in));
        FastReader ob=new FastReader();
        String s=ob.next();
        int g, h, i, j=0;
        String s1="";
        String s3="";
        for(i=0;i<s.length();i++)
            if(s.charAt(i)=='1')
                s3+='1';
        for(i=0;i<s.length();i++)
        {
            char x=s.charAt(i);
            if(x=='0')
            {
                System.out.print("0");
            }
            else if(x=='2')
            {
                if(j==0)
                {
                    System.out.print(s3);
                    j=1;
                }
                System.out.print("2");
            }
        }
        //i=s1.indexOf('2');
        //if(i>=0)
        //{
        //  s1=s1.substring(0,i)+s3+s1.substring(i,s1.length());
        //}
        //System.out.println(s1.substring(0,i)+s3+s1.substring(i,s1.length()));
    }
}


import java.io.*;
import java.util.*;
public class Solution
{
    public static void main(String[] args)throws IOException
    {
        BufferedReader ob=new BufferedReader(new InputStreamReader(System.in));
        String s=ob.readLine();
        int a[]=new int[s.length()];
        int g, h, i, j;
        int numone=0;
        for(i=0;i<s.length();i++)
        {
            if(s.charAt(i)=='1')
                numone++;
        }
        j=0;
        int k=0;
        String s1="";
        for(i=0;i<s.length();i++)
        {
            if(s.charAt(i)=='0')
            {
                j++;
            }
            else if(s.charAt(i)=='2')
            {
                k=i+1;
                break;
            }
        }
        for(i=1;i<=j;i++)
            s1=s1+'0';
        for(i=1;i<=numone;i++)
            s1=s1+'1';
        s1=s1+'2';
        j=0;
        for(i=k;i<s.length();i++)
        {
            if(s.charAt(i)=='0')
            {
                s1=s1+'0';
                j++;
            }
            else if(s.charAt(i)=='2')
            {
                j=0;
                s1=s1+'2';
            }
        }
        System.out.println(s1);
    }
}


import java.io.*;
import java.util.*;
public class Solution
{
    public static void main(String[] args)throws IOException
    {
        BufferedReader ob=new BufferedReader(new InputStreamReader(System.in));
        String s=ob.readLine();
        int a[]=new int[s.length()];
        int g, h, i, j;
        String s1="";
        String s3="";
        for(i=0;i<s.length();i++)
        {
            if(s.charAt(i)=='0')
            {
                s1=s1+'0';
            }
            else if(s.charAt(i)=='1')
                s3=s3+'1';
            else if(s.charAt(i)=='2')
            {
                s1=s1+'2';
            }
        }
        i=s1.indexOf('2');
        if(i>=0)
        {
            s1=s1.substring(0,i)+s3+s1.substring(i,s1.length());
        }
        System.out.println(s1);
    }
}


import java.util.*;
import java.io.*;
//267630EY
public class Main1009B
{
  static PrintWriter out=new PrintWriter(System.out);

  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    int num_ones=0;
    for(int i=0;i<s.length();i++)
    {
      if(s.charAt(i)=='1')
        num_ones++;
    }
    StringBuilder ans=new StringBuilder();
    boolean first=true;
    int st=0;
    while(ans.length()!=s.length())
    {
      int num_zeros=0;
      boolean two=false;
      for(int i=st;i<s.length();i++)
      {
        if(s.charAt(i)=='2')
        {
          st=i+1;
          two=true;
          break;
        }
        if(s.charAt(i)=='0')
          num_zeros++;
      }
      if(first)
      {
        for(int i=0;i<num_zeros;i++)
          ans.append('0');
        for(int i=0;i<num_ones;i++)
          ans.append('1');
        first=false;
      }
      else
      {
        for(int i=0;i<num_zeros;i++)
          ans.append('0');
      }
      if(two)
        ans.append('2');
    }
    out.println(ans);
    out.flush();

  }

  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
    {
      br=new BufferedReader(new InputStreamReader(is));
    }

    public boolean hasNext()
    {

      boolean result=false;

      try
      {
        result = br.ready();
      }
      catch (IOException e)
      {
        System.err.println(e);
      }
      return result;
    }

    public int nextInt() throws IOException
    {
      if(tk.hasMoreTokens())
        return Integer.parseInt(tk.nextToken());
      tk=new StringTokenizer(br.readLine());
      return nextInt();
    }
    public long nextLong() throws IOException
    {
      if(tk.hasMoreTokens())
        return Long.parseLong(tk.nextToken());
      tk=new StringTokenizer(br.readLine());
      return nextLong();
    }
    public String next() throws IOException
    {
      if(tk.hasMoreTokens())
        return (tk.nextToken());
      tk=new StringTokenizer(br.readLine());
      return next();
    }
    public String nextLine() throws IOException
    {
      tk=new StringTokenizer("");
      return br.readLine();
    }
    public double nextDouble() throws IOException
    {
      if(tk.hasMoreTokens())
        return Double.parseDouble(tk.nextToken());
      tk=new StringTokenizer(br.readLine());
      return nextDouble();
    }
    public char nextChar() throws IOException
    {
      if(tk.hasMoreTokens())
        return (tk.nextToken().charAt(0));
      tk=new StringTokenizer(br.readLine());
      return nextChar();
    }
    public int[] nextIntArray(int n) throws IOException
    {
      int a[]=new int[n];
      for(int i=0;i<n;i++)
        a[i]=nextInt();
      return a;
    }
    public long[] nextLongArray(int n) throws IOException
    {
      long a[]=new long[n];
      for(int i=0;i<n;i++)
        a[i]=nextLong();
      return a;
    }
    public int[] nextIntArrayOneBased(int n) throws IOException
    {
      int a[]=new int[n+1];
      for(int i=1;i<=n;i++)
        a[i]=nextInt();
      return a;
    }
    public long[] nextLongArrayOneBased(int n) throws IOException
    {
      long a[]=new long[n+1];
      for(int i=1;i<=n;i++)
        a[i]=nextLong();
      return a;
    }
  }
}


import java.util.*;
import java.io.*;
public class Main1009B
{
  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    int pos2=0;
    int zero=0;
    int ones=0;
    boolean flag=false;
    for(int i=0;i<s.length();i++)
    {
      if(!flag&&s.charAt(i)=='0')
        zero++;
      if(s.charAt(i)=='2'&&!flag)
      {
        pos2=i;
        flag=true;
      }
      if(s.charAt(i)=='1')
        ones++;
    }
    String ans="";
    for(int i=0;i<(zero);i++)
    {
      ans+="0";
    }
    for(int i=0;i<(ones);i++)
    {
      ans+="1";
    }
    ans+="2";
    int j=pos2+1;
    int k=j;

    for(k=j;k<s.length();k++)
    {
      if(s.charAt(k)=='0')
        ans+="0";
      else if(s.charAt(k)=='2')
        ans+="2";

    }

    System.out.println(ans);
  }
  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
        {
      br=new BufferedReader(new InputStreamReader(is));
    }
        public int nextInt() throws IOException
        {
          if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
          tk=new StringTokenizer(br.readLine());
          return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
              return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
          if(tk.hasMoreTokens())
            return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
          tk=new StringTokenizer("");
          return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
              return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
              return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
          long a[]=new long[n];
            for(int i=0;i<n;i++)
              a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
          int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
          long a[]=new long[n+1];
          for(int i=1;i<=n;i++)
                a[i]=nextLong();
          return a;
        }
  }
}


import java.util.*;
import java.io.*;
public class Main1009B
{
  static PrintWriter out=new PrintWriter(System.out);
  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.nextLine();
    int pos2=0;
    String p="";
    String o="";
    for(int i=0;i<s.length();i++)
    {
      if(s.charAt(i)=='0')
      {
        p+="0";
      }
      if(s.charAt(i)=='2')
      {
        pos2=i;
        break;
      }

      if(s.charAt(i)=='1')
      {
        o+="1";
      }
    }

    String ans="";
    ans="2";
    for(int k=pos2+1;k<s.length();k++)
    {
      if(s.charAt(k)=='0')
        ans+="0";
      else if(s.charAt(k)=='2')
        ans+="2";
      else o+="1";
    }
    String ans2=p+o+ans;
    out.println(ans2);
    out.flush();
  }

  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
        {
      br=new BufferedReader(new InputStreamReader(is));
    }
        public int nextInt() throws IOException
        {
          if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
          tk=new StringTokenizer(br.readLine());
          return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
              return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
          if(tk.hasMoreTokens())
            return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
          tk=new StringTokenizer("");
          return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
              return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
              return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
          long a[]=new long[n];
            for(int i=0;i<n;i++)
              a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
          int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
          long a[]=new long[n+1];
          for(int i=1;i<=n;i++)
                a[i]=nextLong();
          return a;
        }
  }
}


import java.util.*;
import java.io.*;
public class Main1009B2
{
  static PrintWriter out=new PrintWriter(System.out);
  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.nextLine();
    StringBuilder st=new StringBuilder();
    String o="";
    for(int i=0;i<s.length();i++)
    {
      if(s.charAt(i)=='1') o+="1";
      else st.append(s.charAt(i));
    }
    int pos=0;
    if(st.length()!=0){
    for(int i=0;i<s.length();i++)
    {
      if(st.charAt(i)=='2')
      {
        pos=i;
        break;
      }
    }
    }
    st.insert(pos,o);
    out.println(st);
    out.flush();
  }
  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
        {
      br=new BufferedReader(new InputStreamReader(is));
    }
        public int nextInt() throws IOException
        {
          if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
          tk=new StringTokenizer(br.readLine());
          return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
              return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
          if(tk.hasMoreTokens())
            return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
          tk=new StringTokenizer("");
          return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
              return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
              return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
          long a[]=new long[n];
            for(int i=0;i<n;i++)
              a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
          int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
          long a[]=new long[n+1];
          for(int i=1;i<=n;i++)
                a[i]=nextLong();
          return a;
        }
  }
}


import java.util.*;
public class Main1009B
{
  public static void main(String[] args)
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    int pos2=0;
    int zero=0;
    int ones=0;
    boolean flag=false;
    for(int i=0;i<s.length();i++)
    {
      if(!flag&&s.charAt(i)=='0')
        zero++;
      if(s.charAt(i)=='2'&&!flag)
      {
        pos2=i;
        flag=true;
      }
      if(s.charAt(i)=='1')
        ones++;
    }
    String ans="";
    for(int i=0;i<(zero);i++)
    {
      ans+="0";
    }
    for(int i=0;i<(ones);i++)
    {
      ans+="1";
    }
    ans+="2";
    int j=pos2+1;
    int k=j;
    while(j<s.length())
    {
      for(k=j;k<s.length();k++)
      {
        if(s.charAt(k)=='0')
          ans+="0";
        else if(s.charAt(k)=='2') break;

      }
      if(k<s.length()&&s.charAt(k)=='2')
        ans+="2";
      j=k+1;
    }
    System.out.println(ans);
  }
}


import java.util.*;
import java.io.*;
public class Main1009B2
{
  static PrintWriter out=new PrintWriter(System.out);
  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.nextLine();
    StringBuilder st=new StringBuilder();
    String o="";
    for(int i=0;i<s.length();i++)
    {
      if(s.charAt(i)=='1') o+="1";
      else st.append(s.charAt(i));
    }
    int pos=-1;
    if(st.length()!=0){

    while((pos+1)<st.length()&&st.charAt(pos+1)=='0') ++pos;
    }
    st.insert(pos+1,o);
    out.println(st);
    out.flush();
  }
  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
        {
      br=new BufferedReader(new InputStreamReader(is));
    }
        public int nextInt() throws IOException
        {
          if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
          tk=new StringTokenizer(br.readLine());
          return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
              return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
          if(tk.hasMoreTokens())
            return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
          tk=new StringTokenizer("");
          return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
              return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
              return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
          long a[]=new long[n];
            for(int i=0;i<n;i++)
              a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
          int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
          long a[]=new long[n+1];
          for(int i=1;i<=n;i++)
                a[i]=nextLong();
          return a;
        }
  }
}


import java.util.*;
import java.io.*;
public class Main1009B
{
  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    int pos2=0;
    int zero=0;
    String p="";
    int ones=0;
    String o="";
    boolean flag=false;
    for(int i=0;i<s.length();i++)
    {
      if(!flag&&s.charAt(i)=='0')
      {
        p+="0";
      }
      if(s.charAt(i)=='2'&&!flag)
      {
        pos2=i;
        flag=true;
      }
      if(s.charAt(i)=='1')
      {
        ones++;
        o+="1";
      }
    }
    String ans="";
    ans+=(p)+o+"2";
    //ans+="2";
    int j=pos2+1;
    int k=j;

    for(k=j;k<s.length();k++)
    {
      if(s.charAt(k)=='0')
        ans+="0";
      else if(s.charAt(k)=='2')
        ans+="2";

    }

    System.out.println(ans);
  }
  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
        {
      br=new BufferedReader(new InputStreamReader(is));
    }
        public int nextInt() throws IOException
        {
          if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
          tk=new StringTokenizer(br.readLine());
          return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
              return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
          if(tk.hasMoreTokens())
            return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
          tk=new StringTokenizer("");
          return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
              return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
              return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
          long a[]=new long[n];
            for(int i=0;i<n;i++)
              a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
          int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
          long a[]=new long[n+1];
          for(int i=1;i<=n;i++)
                a[i]=nextLong();
          return a;
        }
  }
}


import java.util.*;
import java.io.*;
public class Main1009B2
{
  static PrintWriter out=new PrintWriter(System.out);
  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    StringBuilder st=new StringBuilder();
    String o="";
    for(int i=0;i<s.length();i++)
    {
      if(s.charAt(i)=='1') o+="1";
      else st.append(s.charAt(i));
    }
    int pos=0;
    for(int i=0;i<s.length();i++)
    {
      if(st.charAt(i)=='2')
      {
        pos=i;
        break;
      }
    }
    st.insert(pos,o);
    out.println(st);
    out.flush();
  }
  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
        {
      br=new BufferedReader(new InputStreamReader(is));
    }
        public int nextInt() throws IOException
        {
          if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
          tk=new StringTokenizer(br.readLine());
          return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
              return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
          if(tk.hasMoreTokens())
            return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
          tk=new StringTokenizer("");
          return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
              return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
              return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
          long a[]=new long[n];
            for(int i=0;i<n;i++)
              a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
          int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
          long a[]=new long[n+1];
          for(int i=1;i<=n;i++)
                a[i]=nextLong();
          return a;
        }
  }
}


import java.util.*;
public class Main1009B
{
  public static void main(String[] args)
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    int pos2=0;
    int zero=0;
    int ones=0;
    boolean flag=false;
    for(int i=0;i<s.length();i++)
    {
      if(!flag&&s.charAt(i)=='0')
        zero++;
      if(s.charAt(i)=='2'&&!flag)
      {
        pos2=i;
        flag=true;
      }
      if(s.charAt(i)=='1')
        ones++;
    }
    String ans="";
    for(int i=0;i<(zero);i++)
    {
      ans+="0";
    }
    for(int i=0;i<(ones);i++)
    {
      ans+="1";
    }
    ans+="2";
    int j=pos2+1;
    int k=j;

    for(k=j;k<s.length();k++)
    {
      if(s.charAt(k)=='0')
        ans+="0";
      else if(s.charAt(k)=='2')
        ans+="2";

    }

    System.out.println(ans);
  }
}


import java.util.*;
public class Main1009B2
{
  public static void main(String[] args)
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    StringBuilder st=new StringBuilder();
    String o="";
    for(int i=0;i<s.length();i++)
    {
      if(s.charAt(i)=='1') o+="1";
      else st.append(s.charAt(i));
    }
    int pos=0;
    for(int i=0;i<s.length();i++)
    {
      if(st.charAt(i)=='2')
      {
        pos=i;
        break;
      }
    }
    st.insert(pos,o);
    System.out.println(st);
  }
}


import java.util.*;
import java.io.*;
public class Main1009B
{
  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    int pos2=0;
    int zero=0;
    String p="";
    int ones=0;
    String o="";
    boolean flag=false;
    for(int i=0;i<s.length();i++)
    {
      if(!flag&&s.charAt(i)=='0')
      {
        p+="0";
      }
      if(s.charAt(i)=='2'&&!flag)
      {
        pos2=i;
        flag=true;
        break;
      }
      if(s.charAt(i)=='1')
      {
        ones++;
        o+="1";
      }
    }
    String ans="";
    //ans+=(p)+o+"2";
    //ans+="2";
    int j=pos2+1;
    int k=j;
    //o=new String();
    ans="2";
    for(k=j;k<s.length();k++)
    {
      if(s.charAt(k)=='0')
        ans+="0";
      else if(s.charAt(k)=='2')
        ans+="2";
      else o+="1";

    }
    String ans2=p+o+ans;

    System.out.println(ans2);
  }
  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
        {
      br=new BufferedReader(new InputStreamReader(is));
    }
        public int nextInt() throws IOException
        {
          if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
          tk=new StringTokenizer(br.readLine());
          return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
              return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
          if(tk.hasMoreTokens())
            return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
          tk=new StringTokenizer("");
          return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
              return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
              return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
          long a[]=new long[n];
            for(int i=0;i<n;i++)
              a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
          int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
          long a[]=new long[n+1];
          for(int i=1;i<=n;i++)
                a[i]=nextLong();
          return a;
        }
  }
}


import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
		String s=sc.next();
		int a=0,b=0;
		int ii=s.indexOf("2");

		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='2'){break;}
			else if(ch=='0')a++;
		}
		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='1')b++;
		}
		for(int i=0;i<a;i++)System.out.print('0');
		for(int i=0;i<b;i++)System.out.print('1');
		if(ii!=-1)
			for(int i=ii;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch!='1')System.out.print(ch);
		}
		System.out.println();
	}
	}}


import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
		String s=sc.next();
		int a=0,b=0,c=0;
		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='2')break;
			else if(ch=='0')a++;
		}
		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='1')b++;
			if(ch=='2')c++;
		}
		for(int i=0;i<a;i++)System.out.print('0');
		for(int i=0;i<b;i++)System.out.print('1');
		for(int i=0;i<c;i++)System.out.print('2');
		for(int i=0;i<s.length()-a-b-c;i++)System.out.print('0');
		System.out.println();
	}
	}}


import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		int a=0,b=0,c=0;
		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='2')break;
			else if(ch=='0')a++;
		}
		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='1')b++;
			if(ch=='2')c++;
		}
		String str="";
		for(int i=0;i<a;i++)str+='0';
		for(int i=0;i<b;i++)str+='1';
		for(int i=0;i<c;i++)str+='2';
		for(int i=0;i<s.length()-a-b-c;i++)str+='0';
		System.out.println(str);
	}
	}


import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		int a=0,b=0,c=0;
		int ii=0;
		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='2'){ii=i;break;}
			else if(ch=='0')a++;
		}
		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='1')b++;
			if(ch=='2')c++;
		}
		for(int i=0;i<a;i++)System.out.print('0');
		for(int i=0;i<b;i++)System.out.print('1');
		for(int i=ii;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch!='1')System.out.print(ch);
		}
		System.out.println();
	}
	}


import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
		String s=sc.next();
		int a=0,b=0;
		int ii=s.indexOf("2");

		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='2'){break;}
			else if(ch=='0')a++;
		}
		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='1')b++;
		}
		for(int i=0;i<a;i++)System.out.print('0');
		for(int i=0;i<b;i++)System.out.print('1');
		for(int i=ii;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch!='1')System.out.print(ch);
		}
		System.out.println();
	}
	}}


import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		int a=0,b=0,c=0;
		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='2')break;
			else if(ch=='0')a++;
		}
		for(int i=0;i<s.length();i++){
			char ch=s.charAt(i);
			if(ch=='1')b++;
			if(ch=='2')c++;
		}
		for(int i=0;i<a;i++)System.out.print('0');
		for(int i=0;i<b;i++)System.out.print('1');
		for(int i=0;i<c;i++)System.out.print('2');
		for(int i=0;i<s.length()-a-b-c;i++)System.out.print('0');
		System.out.println();
	}
	}


/*
⣿⣿⣿⣿⣿⣿⡷⣯⢿⣿⣷⣻⢯⣿⡽⣻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠸⣿⣿⣆⠹⣿⣿⢾⣟⣯⣿⣿⣿⣿⣿⣿⣽⣻⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣻⣽⡿⣿⣎⠙⣿⣞⣷⡌⢻⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⡄⠹⣿⣿⡆⠻⣿⣟⣯⡿⣽⡿⣿⣿⣿⣿⣽⡷⣯⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣟⣷⣿⣿⣿⡀⠹⣟⣾⣟⣆⠹⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢠⡘⣿⣿⡄⠉⢿⣿⣽⡷⣿⣻⣿⣿⣿⣿⡝⣷⣯⢿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣯⢿⣾⢿⣿⡄⢄⠘⢿⣞⡿⣧⡈⢷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢸⣧⠘⣿⣷⠈⣦⠙⢿⣽⣷⣻⣽⣿⣿⣿⣿⣌⢿⣯⢿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣟⣯⣿⢿⣿⡆⢸⡷⡈⢻⡽⣷⡷⡄⠻⣽⣿⣿⡿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣏⢰⣯⢷⠈⣿⡆⢹⢷⡌⠻⡾⢋⣱⣯⣿⣿⣿⣿⡆⢻⡿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡎⣿⢾⡿⣿⡆⢸⣽⢻⣄⠹⣷⣟⣿⣄⠹⣟⣿⣿⣟⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⡇⢸⣯⣟⣧⠘⣷⠈⡯⠛⢀⡐⢾⣟⣷⣻⣿⣿⣿⡿⡌⢿⣻⣿⣿
⣿⣿⣿⣿⣿⣿⣧⢸⡿⣟⣿⡇⢸⣯⣟⣮⢧⡈⢿⣞⡿⣦⠘⠏⣹⣿⣽⢿⣿⣿⣿⣿⣯⣿⣿⣿⡇⢸⣿⣿⣾⡆⠹⢀⣠⣾⣟⣷⡈⢿⣞⣯⢿⣿⣿⣿⢷⠘⣯⣿⣿
⣿⣿⣿⣿⣿⣿⣿⡈⣿⢿⣽⡇⠘⠛⠛⠛⠓⠓⠈⠛⠛⠟⠇⢀⢿⣻⣿⣯⢿⣿⣿⣿⣷⢿⣿⣿⠁⣾⣿⣿⣿⣧⡄⠇⣹⣿⣾⣯⣿⡄⠻⣽⣯⢿⣻⣿⣿⡇⢹⣾⣿
⣿⣿⣿⣿⣿⣿⣿⡇⢹⣿⡽⡇⢸⣿⣿⣿⣿⣿⣞⣆⠰⣶⣶⡄⢀⢻⡿⣯⣿⡽⣿⣿⣿⢯⣟⡿⢀⣿⣿⣿⣿⣿⣧⠐⣸⣿⣿⣷⣿⣿⣆⠹⣯⣿⣻⣿⣿⣿⢀⣿⢿
⣿⣿⣿⣿⣿⣿⣿⣿⠘⣯⡿⡇⢸⣿⣿⣿⣿⣿⣿⣿⣧⡈⢿⣳⠘⡄⠻⣿⢾⣽⣟⡿⣿⢯⣿⡇⢸⣿⣿⣿⣿⣿⣿⡀⢾⣿⣿⣿⣿⣿⣿⣆⠹⣾⣷⣻⣿⡿⡇⢸⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡇⢹⣿⠇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠻⡇⢹⣆⠹⣟⣾⣽⣻⣟⣿⣽⠁⣾⣿⣿⣿⣿⣿⣿⣇⣿⣿⠿⠛⠛⠉⠙⠋⢀⠁⢘⣯⣿⣿⣧⠘⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⡈⣿⡃⢼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡙⠌⣿⣆⠘⣿⣞⡿⣞⡿⡞⢠⣿⣿⣿⣿⣿⡿⠛⠉⠁⢀⣀⣠⣤⣤⣶⣶⣶⡆⢻⣽⣞⡿⣷⠈⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠘⠁⠉⠉⠉⠉⠉⠉⠉⠉⠉⠙⠛⠛⢿⣄⢻⣿⣧⠘⢯⣟⡿⣽⠁⣾⣿⣿⣿⣿⣿⡃⢀⢀⠘⠛⠿⢿⣻⣟⣯⣽⣻⣵⡀⢿⣯⣟⣿⢀⣿
⣿⣿⣿⣟⣿⣿⣿⣿⣶⣶⡆⢀⣿⣾⣿⣾⣷⣿⣶⠿⠚⠉⢀⢀⣤⣿⣷⣿⣿⣷⡈⢿⣻⢃⣼⣿⣿⣿⣿⣻⣿⣿⣿⡶⣦⣤⣄⣀⡀⠉⠛⠛⠷⣯⣳⠈⣾⡽⣾⢀⣿
⣿⢿⣿⣿⣻⣿⣿⣿⣿⣿⡿⠐⣿⣿⣿⣿⠿⠋⠁⢀⢀⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣌⣥⣾⡿⣿⣿⣷⣿⣿⢿⣷⣿⣿⣟⣾⣽⣳⢯⣟⣶⣦⣤⡾⣟⣦⠘⣿⢾⡁⢺
⣿⣻⣿⣿⡷⣿⣿⣿⣿⣿⡗⣦⠸⡿⠋⠁⢀⢀⣠⣴⢿⣿⣽⣻⢽⣾⣟⣷⣿⣟⣿⣿⣿⣳⠿⣵⣧⣼⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣽⣳⣯⣿⣿⣿⣽⢀⢷⣻⠄⠘
⣿⢷⣻⣿⣿⣷⣻⣿⣿⣿⡷⠛⣁⢀⣀⣤⣶⣿⣛⡿⣿⣮⣽⡻⣿⣮⣽⣻⢯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⢀⢸⣿⢀⡆
⠸⣟⣯⣿⣿⣷⢿⣽⣿⣿⣷⣿⣷⣆⠹⣿⣶⣯⠿⣿⣶⣟⣻⢿⣷⣽⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢀⣯⣟⢀⡇
⣇⠹⣟⣾⣻⣿⣿⢾⡽⣿⣿⣿⣿⣿⣆⢹⣶⣿⣻⣷⣯⣟⣿⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢀⡿⡇⢸⡇
⣿⣆⠹⣷⡻⣽⣿⣯⢿⣽⣻⣿⣿⣿⣿⣆⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⢸⣿⠇⣼⡇
⡙⠾⣆⠹⣿⣦⠛⣿⢯⣷⢿⡽⣿⣿⣿⣿⣆⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠎⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⢀⣿⣾⣣⡿⡇
⣿⣷⡌⢦⠙⣿⣿⣌⠻⣽⢯⣿⣽⣻⣿⣿⣿⣧⠩⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⢰⢣⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⢀⢀⢿⣞⣷⢿⡇
⣿⣽⣆⠹⣧⠘⣿⣿⡷⣌⠙⢷⣯⡷⣟⣿⣿⣿⣷⡀⡹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣈⠃⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⢀⣴⡧⢀⠸⣿⡽⣿⢀
⢻⣽⣿⡄⢻⣷⡈⢿⣿⣿⢧⢀⠙⢿⣻⡾⣽⣻⣿⣿⣄⠌⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⢁⣰⣾⣟⡿⢀⡄⢿⣟⣿⢀
⡄⢿⣿⣷⢀⠹⣟⣆⠻⣿⣿⣆⢀⣀⠉⠻⣿⡽⣯⣿⣿⣷⣈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⢀⣠⠘⣯⣷⣿⡟⢀⢆⠸⣿⡟⢸
⣷⡈⢿⣿⣇⢱⡘⢿⣷⣬⣙⠿⣧⠘⣆⢀⠈⠻⣷⣟⣾⢿⣿⣆⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⣠⡞⢡⣿⢀⣿⣿⣿⠇⡄⢸⡄⢻⡇⣼
⣿⣷⡈⢿⣿⡆⢣⡀⠙⢾⣟⣿⣿⣷⡈⠂⠘⣦⡈⠿⣯⣿⢾⣿⣆⠙⠻⠿⠿⠿⠿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢋⣠⣾⡟⢠⣿⣿⢀⣿⣿⡟⢠⣿⢈⣧⠘⢠⣿
⣿⣿⣿⣄⠻⣿⡄⢳⡄⢆⡙⠾⣽⣿⣿⣆⡀⢹⡷⣄⠙⢿⣿⡾⣿⣆⢀⡀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⣀⣠⣴⡿⣯⠏⣠⣿⣿⡏⢸⣿⡿⢁⣿⣿⢀⣿⠆⢸⣿
⣿⣿⣿⣿⣦⡙⣿⣆⢻⡌⢿⣶⢤⣉⣙⣿⣷⡀⠙⠽⠷⠄⠹⣿⣟⣿⣆⢙⣋⣤⣤⣤⣄⣀⢀⢀⢀⢀⣾⣿⣟⡷⣯⡿⢃⣼⣿⣿⣿⠇⣼⡟⣡⣿⣿⣿⢀⡿⢠⠈⣿
⣿⣿⣿⣿⣿⣷⣮⣿⣿⣿⡌⠁⢤⣤⣤⣤⣬⣭⣴⣶⣶⣶⣆⠈⢻⣿⣿⣆⢻⣿⣿⣿⣿⣿⣿⣷⣶⣤⣌⣉⡘⠛⠻⠶⣿⣿⣿⣿⡟⣰⣫⣴⣿⣿⣿⣿⠄⣷⣿⣿⣿
*/

import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

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

		char[] arr=s.next().toCharArray();

		int flag=0;
		int z=0,o=0,t=0;
		StringBuilder sb=new StringBuilder();
	     int in=-1;
		for(int i=0;i<arr.length;i++) {
			if(flag==0) {
				if(arr[i]=='0') {
					z++;
				}
			}

			if(arr[i]=='2') {
				in=i;
				flag=1;
				break;
			}
		}
		for(int i=0;i<z;i++) {
			sb.append(0);
		}
		int n=arr.length;
		for(int i=0;i<n;i++) {
			if(arr[i]=='1') {
				sb.append(1);
			}
		}

		if(in!=-1) {
		for(int i=in;i<n;i++) {
			if(arr[i]=='2') {
				sb.append(2);
			}else if(arr[i]=='0') {
				sb.append(0);
			}
		}
		}
		System.out.println(sb);

	}

}


/*
⣿⣿⣿⣿⣿⣿⡷⣯⢿⣿⣷⣻⢯⣿⡽⣻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠸⣿⣿⣆⠹⣿⣿⢾⣟⣯⣿⣿⣿⣿⣿⣿⣽⣻⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣻⣽⡿⣿⣎⠙⣿⣞⣷⡌⢻⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⡄⠹⣿⣿⡆⠻⣿⣟⣯⡿⣽⡿⣿⣿⣿⣿⣽⡷⣯⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣟⣷⣿⣿⣿⡀⠹⣟⣾⣟⣆⠹⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢠⡘⣿⣿⡄⠉⢿⣿⣽⡷⣿⣻⣿⣿⣿⣿⡝⣷⣯⢿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣯⢿⣾⢿⣿⡄⢄⠘⢿⣞⡿⣧⡈⢷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢸⣧⠘⣿⣷⠈⣦⠙⢿⣽⣷⣻⣽⣿⣿⣿⣿⣌⢿⣯⢿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣟⣯⣿⢿⣿⡆⢸⡷⡈⢻⡽⣷⡷⡄⠻⣽⣿⣿⡿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣏⢰⣯⢷⠈⣿⡆⢹⢷⡌⠻⡾⢋⣱⣯⣿⣿⣿⣿⡆⢻⡿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡎⣿⢾⡿⣿⡆⢸⣽⢻⣄⠹⣷⣟⣿⣄⠹⣟⣿⣿⣟⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⡇⢸⣯⣟⣧⠘⣷⠈⡯⠛⢀⡐⢾⣟⣷⣻⣿⣿⣿⡿⡌⢿⣻⣿⣿
⣿⣿⣿⣿⣿⣿⣧⢸⡿⣟⣿⡇⢸⣯⣟⣮⢧⡈⢿⣞⡿⣦⠘⠏⣹⣿⣽⢿⣿⣿⣿⣿⣯⣿⣿⣿⡇⢸⣿⣿⣾⡆⠹⢀⣠⣾⣟⣷⡈⢿⣞⣯⢿⣿⣿⣿⢷⠘⣯⣿⣿
⣿⣿⣿⣿⣿⣿⣿⡈⣿⢿⣽⡇⠘⠛⠛⠛⠓⠓⠈⠛⠛⠟⠇⢀⢿⣻⣿⣯⢿⣿⣿⣿⣷⢿⣿⣿⠁⣾⣿⣿⣿⣧⡄⠇⣹⣿⣾⣯⣿⡄⠻⣽⣯⢿⣻⣿⣿⡇⢹⣾⣿
⣿⣿⣿⣿⣿⣿⣿⡇⢹⣿⡽⡇⢸⣿⣿⣿⣿⣿⣞⣆⠰⣶⣶⡄⢀⢻⡿⣯⣿⡽⣿⣿⣿⢯⣟⡿⢀⣿⣿⣿⣿⣿⣧⠐⣸⣿⣿⣷⣿⣿⣆⠹⣯⣿⣻⣿⣿⣿⢀⣿⢿
⣿⣿⣿⣿⣿⣿⣿⣿⠘⣯⡿⡇⢸⣿⣿⣿⣿⣿⣿⣿⣧⡈⢿⣳⠘⡄⠻⣿⢾⣽⣟⡿⣿⢯⣿⡇⢸⣿⣿⣿⣿⣿⣿⡀⢾⣿⣿⣿⣿⣿⣿⣆⠹⣾⣷⣻⣿⡿⡇⢸⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡇⢹⣿⠇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠻⡇⢹⣆⠹⣟⣾⣽⣻⣟⣿⣽⠁⣾⣿⣿⣿⣿⣿⣿⣇⣿⣿⠿⠛⠛⠉⠙⠋⢀⠁⢘⣯⣿⣿⣧⠘⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⡈⣿⡃⢼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡙⠌⣿⣆⠘⣿⣞⡿⣞⡿⡞⢠⣿⣿⣿⣿⣿⡿⠛⠉⠁⢀⣀⣠⣤⣤⣶⣶⣶⡆⢻⣽⣞⡿⣷⠈⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠘⠁⠉⠉⠉⠉⠉⠉⠉⠉⠉⠙⠛⠛⢿⣄⢻⣿⣧⠘⢯⣟⡿⣽⠁⣾⣿⣿⣿⣿⣿⡃⢀⢀⠘⠛⠿⢿⣻⣟⣯⣽⣻⣵⡀⢿⣯⣟⣿⢀⣿
⣿⣿⣿⣟⣿⣿⣿⣿⣶⣶⡆⢀⣿⣾⣿⣾⣷⣿⣶⠿⠚⠉⢀⢀⣤⣿⣷⣿⣿⣷⡈⢿⣻⢃⣼⣿⣿⣿⣿⣻⣿⣿⣿⡶⣦⣤⣄⣀⡀⠉⠛⠛⠷⣯⣳⠈⣾⡽⣾⢀⣿
⣿⢿⣿⣿⣻⣿⣿⣿⣿⣿⡿⠐⣿⣿⣿⣿⠿⠋⠁⢀⢀⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣌⣥⣾⡿⣿⣿⣷⣿⣿⢿⣷⣿⣿⣟⣾⣽⣳⢯⣟⣶⣦⣤⡾⣟⣦⠘⣿⢾⡁⢺
⣿⣻⣿⣿⡷⣿⣿⣿⣿⣿⡗⣦⠸⡿⠋⠁⢀⢀⣠⣴⢿⣿⣽⣻⢽⣾⣟⣷⣿⣟⣿⣿⣿⣳⠿⣵⣧⣼⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣽⣳⣯⣿⣿⣿⣽⢀⢷⣻⠄⠘
⣿⢷⣻⣿⣿⣷⣻⣿⣿⣿⡷⠛⣁⢀⣀⣤⣶⣿⣛⡿⣿⣮⣽⡻⣿⣮⣽⣻⢯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⢀⢸⣿⢀⡆
⠸⣟⣯⣿⣿⣷⢿⣽⣿⣿⣷⣿⣷⣆⠹⣿⣶⣯⠿⣿⣶⣟⣻⢿⣷⣽⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢀⣯⣟⢀⡇
⣇⠹⣟⣾⣻⣿⣿⢾⡽⣿⣿⣿⣿⣿⣆⢹⣶⣿⣻⣷⣯⣟⣿⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢀⡿⡇⢸⡇
⣿⣆⠹⣷⡻⣽⣿⣯⢿⣽⣻⣿⣿⣿⣿⣆⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⢸⣿⠇⣼⡇
⡙⠾⣆⠹⣿⣦⠛⣿⢯⣷⢿⡽⣿⣿⣿⣿⣆⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠎⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⢀⣿⣾⣣⡿⡇
⣿⣷⡌⢦⠙⣿⣿⣌⠻⣽⢯⣿⣽⣻⣿⣿⣿⣧⠩⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⢰⢣⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⢀⢀⢿⣞⣷⢿⡇
⣿⣽⣆⠹⣧⠘⣿⣿⡷⣌⠙⢷⣯⡷⣟⣿⣿⣿⣷⡀⡹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣈⠃⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⢀⣴⡧⢀⠸⣿⡽⣿⢀
⢻⣽⣿⡄⢻⣷⡈⢿⣿⣿⢧⢀⠙⢿⣻⡾⣽⣻⣿⣿⣄⠌⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⢁⣰⣾⣟⡿⢀⡄⢿⣟⣿⢀
⡄⢿⣿⣷⢀⠹⣟⣆⠻⣿⣿⣆⢀⣀⠉⠻⣿⡽⣯⣿⣿⣷⣈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⢀⣠⠘⣯⣷⣿⡟⢀⢆⠸⣿⡟⢸
⣷⡈⢿⣿⣇⢱⡘⢿⣷⣬⣙⠿⣧⠘⣆⢀⠈⠻⣷⣟⣾⢿⣿⣆⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⣠⡞⢡⣿⢀⣿⣿⣿⠇⡄⢸⡄⢻⡇⣼
⣿⣷⡈⢿⣿⡆⢣⡀⠙⢾⣟⣿⣿⣷⡈⠂⠘⣦⡈⠿⣯⣿⢾⣿⣆⠙⠻⠿⠿⠿⠿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢋⣠⣾⡟⢠⣿⣿⢀⣿⣿⡟⢠⣿⢈⣧⠘⢠⣿
⣿⣿⣿⣄⠻⣿⡄⢳⡄⢆⡙⠾⣽⣿⣿⣆⡀⢹⡷⣄⠙⢿⣿⡾⣿⣆⢀⡀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⣀⣠⣴⡿⣯⠏⣠⣿⣿⡏⢸⣿⡿⢁⣿⣿⢀⣿⠆⢸⣿
⣿⣿⣿⣿⣦⡙⣿⣆⢻⡌⢿⣶⢤⣉⣙⣿⣷⡀⠙⠽⠷⠄⠹⣿⣟⣿⣆⢙⣋⣤⣤⣤⣄⣀⢀⢀⢀⢀⣾⣿⣟⡷⣯⡿⢃⣼⣿⣿⣿⠇⣼⡟⣡⣿⣿⣿⢀⡿⢠⠈⣿
⣿⣿⣿⣿⣿⣷⣮⣿⣿⣿⡌⠁⢤⣤⣤⣤⣬⣭⣴⣶⣶⣶⣆⠈⢻⣿⣿⣆⢻⣿⣿⣿⣿⣿⣿⣷⣶⣤⣌⣉⡘⠛⠻⠶⣿⣿⣿⣿⡟⣰⣫⣴⣿⣿⣿⣿⠄⣷⣿⣿⣿
*/

import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

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

		char[] arr=s.next().toCharArray();

		int flag=0;
		int z=0,o=0,t=0;
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<arr.length;i++) {

			if(flag==0) {
				if(arr[i]=='0') {
					z++;
				}else if(arr[i]=='1') {
					o++;
				}else {
					flag=1;
					t++;
				}
			}else{
				if(arr[i]=='0') {
					flag=0;
					for(int j=0;j<z;j++) {
						sb.append(0);
					}
					for(int j=0;j<o;j++) {
						sb.append(1);
					}
					for(int j=0;j<t;j++) {
						sb.append(2);
					}
					o=0;z=1;t=0;
				}else if(arr[i]=='1') {
					o++;
				}else {
					t++;
				}

			}
		}

		for(int j=0;j<z;j++) {
			sb.append(0);
		}
		for(int j=0;j<o;j++) {
			sb.append(1);
		}
		for(int j=0;j<t;j++) {
			sb.append(2);
		}
		o=0;z=0;t=0;
		System.out.println(sb);

	}
	public static void swap(char[] arr,int a,int b) {
		char temp=arr[a];
		arr[a]=arr[b];
		arr[b]=temp;
	}
}


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

import static java.lang.Math.*;

public class Main implements Runnable {
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        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() {
            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);
        }
    }
    public static void main(String args[]) throws Exception {
        new Thread(null, new Main(),"Main",1<<26).start();
    }

    public void run() {
        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);

        char[] s = sc.next().toCharArray();

        int type1 = -1, type2 = -1;
        ArrayList<Integer> list = new ArrayList<>();

        for(int i = 0; i < s.length; ++i) {
            if(type1 == -1) {
                type1 = s[i];
                list.add(type1);
            }
            else {
                if(s[i] == type1)
                    list.add(type1);
                else if(type2 == -1) {
                    if(abs(s[i] - type1) == 1) {
                        type2 = s[i];
                        list.add(type2);
                    }
                    else {
                        Collections.sort(list);
                        for(int j : list)
                            w.print(j - '0');
                        list = new ArrayList<>();
                        type1 = s[i];
                        list.add(type1);
                        type2 = -1;
                    }
                }
                else if(s[i] == type2) {
                    list.add(type2);
                }
                else {
                    Collections.sort(list);
                    for(int j : list)
                        w.print(j - '0');
                    list = new ArrayList<>();
                    type1 = s[i];
                    list.add(type1);
                    type2 = -1;
                }
            }
        }

        Collections.sort(list);
        for(int i : list)
            w.print(i - '0');
        list = new ArrayList<>();
        type1 = -1;
        type2 = -1;

        w.close();
    }
}


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

import static java.lang.Math.*;

public class Main implements Runnable {
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        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() {
            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);
        }
    }
    public static void main(String args[]) throws Exception {
        new Thread(null, new Main(),"Main",1<<26).start();
    }

    public void run() {
        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);

        char[] s = sc.next().toCharArray();

        int ind = s.length;
        ArrayList<Integer> list = new ArrayList<>();
        for(int i = 0; i < s.length; ++i) {
            if(s[i] == '2') {
                ind = i;
                break;
            }
            list.add((int)s[i]);
        }

        Collections.sort(list);
        for(int i : list)
            w.print(i - '0');

        int freq1 = 0;
        for(int i = ind; i < s.length; ++i) {
            if(s[i] == '1')
                freq1++;
        }

        for(int i = 0; i < freq1; ++i)
            w.print('1');
        for(int i = ind; i < s.length; ++i) {
            if(s[i] != '1')
                w.print(s[i]);
        }

        w.close();
    }
}
class Edge {
    int u, v;
    Edge(int a, int b) {
        u = a;
        v = b;
    }
}


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

import static java.lang.Math.*;

public class Main implements Runnable {
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        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() {
            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);
        }
    }
    public static void main(String args[]) throws Exception {
        new Thread(null, new Main(),"Main",1<<26).start();
    }

    public void run() {
        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);

        char[] s = sc.next().toCharArray();

        int flag = 0;
        ArrayList<Character> list = new ArrayList<>();
        ArrayList<Character> a = new ArrayList<>();
        for(int i = 0; i < s.length; ++i) {
            if(s[i] == '2') {
                if(flag == 0)
                    Collections.sort(list);
                else
                    Collections.sort(list, Collections.reverseOrder());

                for(char j : list)
                    a.add(j);

                list = new ArrayList<>();

                a.add(s[i]);

                flag = 1;
            }
            else
                list.add(s[i]);
        }

        if(flag == 0)
            Collections.sort(list);
        else
            Collections.sort(list, Collections.reverseOrder());
        for(char j : list)
            a.add(j);

        list = new ArrayList<>();
        ArrayList<Character> ans = new ArrayList<>();
        for(int i = 0; i < s.length; ++i) {
            if(a.get(i) == '0') {
                Collections.sort(list);

                for(char j : list)
                    ans.add(j);

                list = new ArrayList<>();

                ans.add(a.get(i));

                flag = 1;
            }
            else
                list.add(a.get(i));
        }

        Collections.sort(list);

        for(char j : list)
            ans.add(j);

        for(char i : ans)
            w.print(i);

        w.close();
    }
}
class Edge {
    int u, v;
    Edge(int a, int b) {
        u = a;
        v = b;
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.TreeMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

/**
 * 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;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            String S = in.next();
            Map<Character, Integer> map = new TreeMap<>();
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < S.length(); i++)
            {
                char c = S.charAt(i);
                if (isValid(map, c))
                {
                    map.put(c, map.getOrDefault(c, 0) + 1);
                } else
                {
                    buildFrom(map, sb);
                    map.clear();
                    map.put(c, map.getOrDefault(c, 0) + 1);
                }
            }
            buildFrom(map, sb);
            out.println(sb.toString());
        }

        private void buildFrom(Map<Character, Integer> map, StringBuilder sb)
        {
            if (map.size() == 0) return;

            Iterator<Character> it = map.keySet().iterator();
            while (it.hasNext())
            {
                char k = it.next();
                char[] chars = new char[map.get(k)];
                Arrays.fill(chars, k);
                sb.append(chars);
            }
        }

        private boolean isValid(Map<Character, Integer> map, char c)
        {
            if (map.size() == 0) return true;
            if (map.size() == 1 && map.keySet().contains('1') && (c == '0' || c == '1')) return true;
            if (map.size() == 1 && map.keySet().contains('0') && (c == '0' || c == '1')) return true;
            if (map.size() == 2 && map.keySet().contains('0') && map.keySet().contains('1') && (c == '0' || c == '1'))
                return true;

            if (map.size() == 1 && map.keySet().contains('1') && (c == '1' || c == '2')) return true;
            if (map.size() == 1 && map.keySet().contains('2') && (c == '1' || c == '2')) return true;
            if (map.size() == 2 && map.keySet().contains('2') && map.keySet().contains('1') && (c == '1' || c == '2'))
                return true;

            return false;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * 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;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            String S = in.next();
            StringBuilder ans = new StringBuilder();

            int cnt = 0;
            for (char c : S.toCharArray())
            {
                if (c == '1') ++cnt;
                else ans.append(c);
            }

            int n = ans.length();
            int pos = -1;
            while (pos + 1 < n && ans.charAt(pos + 1) == '0') ++pos;
            if (cnt > 0)
            {
                char[] ones = new char[cnt];
                Arrays.fill(ones, '1');
                ans.insert(pos + 1, ones);
            }
            out.println(ans);
        }

    }
}


import java.util.Scanner;
import java.util.Stack;

public class MinimumTernaryString {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        Stack<Character> stack = new Stack<>();
        boolean twoFlag = false, xFlag = false;
        char[] newChar = new char[s.length()];
        int point = 0;
        char cur = '0';
        for (int i = 0; i < s.length(); i++) {
            cur = s.charAt(i);
            if (cur == '2') {
                twoFlag = true;
            }
            if (stack.empty()) {
                stack.push(cur);
            } else if (cur == '0' && twoFlag) {
                // 遇到0且栈内有2的情况
                while (stack.peek() != '2') {
                    newChar[point++] = stack.pop();
                }
                stack.pop();
                stack.push('x');
                twoFlag = false;
                xFlag = true;
            } else if (cur == '1' && xFlag) {
                newChar[point++] = '1';
//            } else if (cur == '0' && xFlag == true) {
//                //X数据要逆向输出
//                Stack<Character> xStack = new Stack<>();
//                while (!stack.isEmpty()) {
//                    xStack.push(stack.pop());
//                }
//                while (!xStack.isEmpty()) {
//                    char next = xStack.pop();
//                    if (next == 'x') {
//                        newChar[point++] = '2';
//                        newChar[point++] = '0';
//                    } else {
//                        newChar[point++] = next;
//                    }
//                }
//                xFlag = false;
//                stack.push(cur);
            } else if (cur > stack.peek() && !xFlag) {
                //遇到当前比栈顶元素大的时候(2>1,1>0,2>0),出栈至不大于为止
                while (!stack.isEmpty() && stack.peek() < cur) {
                    newChar[point++] = stack.pop();
                }
                stack.push(cur);
            } else {
                //估计只剩cur==stack.peek() || ( stack.peek()=='x' && cur==1 )的情况了
                stack.push(cur);
            }
            System.out.println(stack);
        }
        if (!xFlag) {
            while (!stack.empty()) {
                newChar[point++] = stack.pop();
            }
        } else {
            Stack<Character> xStack = new Stack<>();
            while (!stack.isEmpty()) {
                xStack.push(stack.pop());
            }
            while (!xStack.isEmpty()) {
                char next = xStack.pop();
                if (next == 'x') {
                    newChar[point++] = '2';
                    newChar[point++] = '0';
                } else {
                    newChar[point++] = next;
                }
            }
        }
//        System.out.println(new String(newChar));
    }
}


import java.util.Scanner;
import java.util.Stack;

public class MinimumTernaryString {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        Stack<Character> stack = new Stack<>();
        boolean twoFlag = false, xFlag = false;
        char[] newChar = new char[s.length()];
        int point = 0;
        char cur = '0';
        for (int i = 0; i < s.length(); i++) {
            cur = s.charAt(i);
            if (cur == '2') {
                twoFlag = true;
            }
            if (stack.empty()) {
                stack.push(cur);
            } else if (cur == '0' && twoFlag) {
                // 遇到0且栈内有2的情况
                while (stack.peek() != '2') {
                    newChar[point++] = stack.pop();
                }
                stack.pop();
                stack.push('x');
                twoFlag = false;
                xFlag = true;
            } else if (cur == '1' && xFlag == true) {
                newChar[point++] = '1';
            } else if (cur == '0' && xFlag == true) {
                //X数据要逆向输出
                Stack<Character> xStack = new Stack<>();
                while (!stack.isEmpty()) {
                    xStack.push(stack.pop());
                }
                while (!xStack.isEmpty()) {
                    char next = xStack.pop();
                    if (next == 'x') {
                        newChar[point++] = '2';
                        newChar[point++] = '0';
                    } else {
                        newChar[point++] = next;
                    }
                }
                xFlag = false;
                stack.push(cur);
            } else if (cur > stack.peek()) {
                //遇到当前比栈顶元素大的时候(2>1,1>0,2>0),出栈至不大于为止
                while (!stack.isEmpty() && stack.peek() < cur) {
                    newChar[point++] = stack.pop();
                }
                stack.push(cur);
            } else {
                //估计只剩cur==stack.peek() || ( stack.peek()=='x' && cur==1 )的情况了
                stack.push(cur);
            }
//            System.out.println(stack);
        }
        if (!xFlag) {
            while (!stack.empty()) {
                newChar[point++] = stack.pop();
            }
        } else {
            Stack<Character> xStack = new Stack<>();
            while (!stack.isEmpty()) {
                xStack.push(stack.pop());
            }
            while (!xStack.isEmpty()) {
                char next = xStack.pop();
                if (next == 'x') {
                    newChar[point++] = '2';
                    newChar[point++] = '0';
                } else {
                    newChar[point++] = next;
                }
            }
        }
        System.out.println(new String(newChar));
    }

}


import java.util.Scanner;
import java.util.Stack;

public class MinimumTernaryString {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        Stack<Character> stack = new Stack<>();
        boolean twoFlag = false, xFlag = false;
        char[] newChar = new char[s.length()];
        int point = 0;
        char cur = '0';
        for (int i = 0; i < s.length(); i++) {
            cur = s.charAt(i);
            if (cur == '2') {
                twoFlag = true;
            }
            if (stack.empty()) {
                stack.push(cur);
            } else if (cur == '0' && twoFlag) {
                // 遇到0且栈内有2的情况
                while (stack.peek() != '2') {
                    newChar[point++] = stack.pop();
                }
                stack.pop();
                stack.push('x');
                twoFlag = false;
                xFlag = true;
            } else if (cur == '1' && xFlag) {
                newChar[point++] = '1';
//            } else if (cur == '0' && xFlag == true) {
//                //X数据要逆向输出
//                Stack<Character> xStack = new Stack<>();
//                while (!stack.isEmpty()) {
//                    xStack.push(stack.pop());
//                }
//                while (!xStack.isEmpty()) {
//                    char next = xStack.pop();
//                    if (next == 'x') {
//                        newChar[point++] = '2';
//                        newChar[point++] = '0';
//                    } else {
//                        newChar[point++] = next;
//                    }
//                }
//                xFlag = false;
//                stack.push(cur);
            } else if (cur > stack.peek() && !xFlag) {
                //遇到当前比栈顶元素大的时候(2>1,1>0,2>0),出栈至不大于为止
                while (!stack.isEmpty() && stack.peek() < cur) {
                    newChar[point++] = stack.pop();
                }
                stack.push(cur);
            } else {
                //估计只剩cur==stack.peek() || ( stack.peek()=='x' && cur==1 )的情况了
                stack.push(cur);
            }
            System.out.println(stack);
        }
        if (!xFlag) {
            while (!stack.empty()) {
                newChar[point++] = stack.pop();
            }
        } else {
            Stack<Character> xStack = new Stack<>();
            while (!stack.isEmpty()) {
                xStack.push(stack.pop());
            }
            while (!xStack.isEmpty()) {
                char next = xStack.pop();
                if (next == 'x') {
                    newChar[point++] = '2';
                    newChar[point++] = '0';
                } else {
                    newChar[point++] = next;
                }
            }
        }
        System.out.println(new String(newChar));
    }
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    int cnt=1;
    for(int i=1;i<=n;i++)
    {
        ans[i].push_back(pii(cnt,i));
        cnt++;
        for(int j=i+1;j<=n;j++)
        {
            if(con[i][j])
            {
                ans[i].push_back(pii(cnt,i));
                ans[i].push_back(pii(cnt,j));
                cnt++;
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int cnt[200];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
    {
        ans[i].push_back(pii(++cnt,i));
        for(int j=i+1;j<=n;j++)
        {
            if(con[i][j])
            {
                ans[i].push_back(pii(++cnt,i));
                ans[j].push_back(pii(cnt,j));
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int cnt[200];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    cnt[1]=1;
    for(int i=2;i<=100;i++) cnt[i]=cnt[i-1]+200;
    for(int i=1;i<=100;i++)
    {
        for(int j=(i-1)*200+1;j<=i*200;j++)
        {
            ans[i].push_back(pii(i,j));
        }
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<i;j++)
        {
            if(con[i][j])
            {
                ans[i].push_back(pii(i,cnt[j]++));
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int cnt[200];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    cnt[1]=1;
    for(int i=2;i<=100;i++) cnt[i]=cnt[i-1]+200;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=i;j++)
        {
            if(con[i][j])
            {
                ans[i].push_back(pii(i,cnt[j]++));
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
const int maxn = 105;
int con[maxn][maxn];
vector<int> v[maxn];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    int cnt=1;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=i;j++)
        {
            if(con[i][j]) v[cnt++].push_back(j);
        }
    }
    for(int i=1;i<cnt;i++)
    {
        printf("%d\n",v[i].size());
        for(int j=0;j<v[i].size();j++)
        {
            printf("%d %d\n",i,v[i][j]);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int cnt[105];
int ned[105];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) ned[i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
        if(x<y) ned[x]++;
        else ned[y]++;
    }
    cnt[1]=1;
    for(int i=2;i<=100;i++) cnt[i]=cnt[i-1]+ned[i-1];
    for(int i=1;i<=99;i++)
    {
        for(int j=cnt[i];j<cnt[i+1];j++)
        {
            ans[i].push_back(pii(i,j));
        }
    }
    ans[100].push_back(pii(100,cnt[100]));
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<i;j++)
        {
            if(con[i][j])
            {
                ans[i].push_back(pii(i,cnt[j]++));
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int cnt[105];
int ned[105];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) ned[i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
        if(x<y) ned[x]++;
        else ned[y]++;
    }
    cnt[1]=1;
    for(int i=2;i<=100;i++) cnt[i]=cnt[i-1]+ned[i-1];
    for(int i=1;i<=99;i++)
    {
        for(int j=cnt[i];j<cnt[i+1];j++)
        {
            ans[i].push_back(pii(i,j));
        }
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<i;j++)
        {
            if(con[i][j])
            {
                ans[i].push_back(pii(i,cnt[j]++));
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int cnt[200];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
    {
        ans[i].push_back(pii(++cnt,i));
        for(int j=i+1;j<=n;j++)
        {
            if(con[i][j])
            {
                ans[i].push_back(pii(++cnt,i));
                ans[i].push_back(pii(cnt,j));
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int cnt[105];
int ned[105];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
        if(x<y) ned[x]++;
        else ned[y]++;
    }
    cnt[1]=1;
    for(int i=2;i<=100;i++) cnt[i]=cnt[i-1]+ned[i-1];
    for(int i=1;i<=99;i++)
    {
        for(int j=cnt[i];j<cnt[i+1];j++)
        {
            ans[i].push_back(pii(i,j));
        }
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<i;j++)
        {
            if(con[i][j])
            {
                ans[i].push_back(pii(i,cnt[j]++));
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=i;j++)
        {
            if(con[i][j])
            {
                if(i%2==1) ans[i].push_back(pii(i,j));
                else ans[i].push_back(pii(j,i));
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    int cnt=1;
    for(int i=1;i<=n;i++)
    {
        ans[i].push_back(pii(i,cnt));
        cnt++;
        for(int j=i+1;j<=n;j++)
        {
            if(con[i][j])
            {
                ans[i].push_back(pii(i,cnt));
                ans[i].push_back(pii(j,cnt));
                cnt++;
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
const int maxn = 105;
int con[maxn][maxn];
vector<int> v[maxn];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=i;j++)
        {
            if(con[i][j]) v[i].push_back(j);
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",v[i].size());
        for(int j=0;j<v[i].size();j++)
        {
            printf("%d %d\n",i,v[i][j]);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 105;
int con[maxn][maxn];
vector<pii> ans[maxn];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    int cnt=1;
    for(int i=1;i<=n;i++)
    {
        ans[i].push_back(pii(i,cnt));
        cnt++;
        for(int j=i+1;j<=n;j++)
        {
            if(con[i][j])
            {
                ans[i].push_back(pii(i,cnt));
                ans[i].push_back(pii(i,cnt));
                cnt++;
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i].size());
        for(int j=0;j<ans[i].size();j++)
        {
            printf("%d %d\n",ans[i][j].first,ans[i][j].second);
        }
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<<x<<endl
typedef long long ll;
const int maxn = 105;
int con[maxn][maxn];
vector<int> v[maxn];
int main()
{
    int n,m,x,y;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) con[i][i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        con[x][y]=1;
        con[y][x]=1;
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=i;j++)
        {
            if(con[i][j])
            {
                if(i%2==1) v[i].push_back(j);
                else v[j].push_back(i);
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        printf("%d\n",v[i].size());
        for(int j=0;j<v[i].size();j++)
        {
            printf("%d %d\n",i,v[i][j]);
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define for1(i,a,b) for (int i=(a);i<=(b);i++)
#define for0(i,a,b) for (int i=(a);i<(b);i++)
#define rof1(i,a,b) for (int i=(a);i>=(b);i--)
#define rof0(i,a,b) for (int i=(a);i>(b);i--)
#define fi first
#define se second
#define pb push_back
#define duozu int __T;scanf("%d",&__T);for1(ica,1,__T)
void _r(const int&x){scanf("%d",&x);}
void _r(const ll&x){scanf("%I64d",&x);}
void _r(const char*x){scanf("%s",x);}
void R(){}
template<class T,class... U>void R(const T&head,const U&...tail){_r(head);R(tail...);}
void _w(const char x){putchar(x);}
void _w(const char*x){printf("%s",x);}
void _w(const int x){printf("%d",x);}
void _w(const ll x){printf("%I64d",x);}
void _w(const double x){printf("%.6f",x);}
void W(){}
template<class T,class...U>void W(const T&head,const U&...tail){_w(head);putchar(sizeof...(tail)?' ':'\n');W(tail...);}
const ll mod = 1e9+7;
ll fp1(ll a,ll b){ll ans=1;while (b){if(b&1)ans*=a;b>>=1;a*=a;}return ans;}
ll fp2(ll a,ll b){ll ans=1;while (b){if(b&1)ans=ans*a%mod;b>>=1;a=a*a%mod;}return ans;}
ll Read(){
    ll res=0,flag=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if (ch=='-')flag = -1;ch = getchar();}
    while (ch>='0' && ch<='9'){res = res*10+ch-'0';ch = getchar();}
    return res*flag;
}
#define CL(x) memset(x,0,sizeof x)

const int N = 2e5+5;

vector<int>v[N];
int pos[N];

int main()
{
    int n,m,a,b;
    R(n,m);
    for1(i,1,m){
        R(a,b);
        v[a].pb(b);
    }
    pos[1] = 1;
    for1(i,2,n) pos[i] = pos[i-1]+v[i-1].size()-1;

    int tot = 1;
    for1(i,1,n){
        W((int)(2*v[i].size()) );
        for (auto it:v[i]) {
            W(tot,tot);
            W(tot,pos[it]);
            tot++;
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define for1(i,a,b) for (int i=(a);i<=(b);i++)
#define for0(i,a,b) for (int i=(a);i<(b);i++)
#define rof1(i,a,b) for (int i=(a);i>=(b);i--)
#define rof0(i,a,b) for (int i=(a);i>(b);i--)
#define fi first
#define se second
#define pb push_back
#define duozu int __T;scanf("%d",&__T);for1(ica,1,__T)
void _r(const int&x){scanf("%d",&x);}
void _r(const ll&x){scanf("%I64d",&x);}
void _r(const char*x){scanf("%s",x);}
void R(){}
template<class T,class... U>void R(const T&head,const U&...tail){_r(head);R(tail...);}
void _w(const char x){putchar(x);}
void _w(const char*x){printf("%s",x);}
void _w(const int x){printf("%d",x);}
void _w(const ll x){printf("%I64d",x);}
void _w(const double x){printf("%.6f",x);}
void W(){}
template<class T,class...U>void W(const T&head,const U&...tail){_w(head);putchar(sizeof...(tail)?' ':'\n');W(tail...);}
const ll mod = 1e9+7;
ll fp1(ll a,ll b){ll ans=1;while (b){if(b&1)ans*=a;b>>=1;a*=a;}return ans;}
ll fp2(ll a,ll b){ll ans=1;while (b){if(b&1)ans=ans*a%mod;b>>=1;a=a*a%mod;}return ans;}
ll Read(){
    ll res=0,flag=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if (ch=='-')flag = -1;ch = getchar();}
    while (ch>='0' && ch<='9'){res = res*10+ch-'0';ch = getchar();}
    return res*flag;
}
#define CL(x) memset(x,0,sizeof x)

const int N = 2e5+5;

vector<int>v[N];
vector<int>ans[N];
int tot;

int main()
{
    int n,m,a,b;
    R(n,m);
    for1(i,1,m){
        R(a,b);
        v[a].pb(b);
    }

    tot = 1;

    for1(i,1,n){
        if (v[i].size()==0){
            ans[i].pb(tot);
            tot++;
        }
        for (auto it:v[i]){
            ans[i].pb(tot);tot++;
            ans[it].pb(tot);tot++;
        }
    }
    for1(i,1,n){
        W((int)ans[i].size());
        for (auto it:ans[i]) W(i,it);
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define for1(i,a,b) for (int i=(a);i<=(b);i++)
#define for0(i,a,b) for (int i=(a);i<(b);i++)
#define rof1(i,a,b) for (int i=(a);i>=(b);i--)
#define rof0(i,a,b) for (int i=(a);i>(b);i--)
#define fi first
#define se second
#define pb push_back
#define duozu int __T;scanf("%d",&__T);for1(ica,1,__T)
void _r(const int&x){scanf("%d",&x);}
void _r(const ll&x){scanf("%I64d",&x);}
void _r(const char*x){scanf("%s",x);}
void R(){}
template<class T,class... U>void R(const T&head,const U&...tail){_r(head);R(tail...);}
void _w(const char x){putchar(x);}
void _w(const char*x){printf("%s",x);}
void _w(const int x){printf("%d",x);}
void _w(const ll x){printf("%I64d",x);}
void _w(const double x){printf("%.6f",x);}
void W(){}
template<class T,class...U>void W(const T&head,const U&...tail){_w(head);putchar(sizeof...(tail)?' ':'\n');W(tail...);}
const ll mod = 1e9+7;
ll fp1(ll a,ll b){ll ans=1;while (b){if(b&1)ans*=a;b>>=1;a*=a;}return ans;}
ll fp2(ll a,ll b){ll ans=1;while (b){if(b&1)ans=ans*a%mod;b>>=1;a=a*a%mod;}return ans;}
ll Read(){
    ll res=0,flag=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if (ch=='-')flag = -1;ch = getchar();}
    while (ch>='0' && ch<='9'){res = res*10+ch-'0';ch = getchar();}
    return res*flag;
}
#define CL(x) memset(x,0,sizeof x)

const int N = 2e5+5;

vector<int>v[N];
vector<int>ans[N];
int tot;

int main()
{
    int n,m,a,b;
    R(n,m);
    for1(i,1,m){
        R(a,b);
        v[a].pb(b);
    }

    tot = 1;

    for1(i,1,n){
        if (v[i].size()==0){
            ans[i].pb(tot);tot++;
            continue;
        }
        for (auto it:v[i]){
            ans[i].pb(tot);
            ans[it].pb(tot);tot++;
        }
    }
    for1(i,1,n){
        W((int)ans[i].size());
        for (auto it:ans[i]) W(i,it);
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define for1(i,a,b) for (int i=(a);i<=(b);i++)
#define for0(i,a,b) for (int i=(a);i<(b);i++)
#define rof1(i,a,b) for (int i=(a);i>=(b);i--)
#define rof0(i,a,b) for (int i=(a);i>(b);i--)
#define fi first
#define se second
#define pb push_back
#define duozu int __T;scanf("%d",&__T);for1(ica,1,__T)
void _r(const int&x){scanf("%d",&x);}
void _r(const ll&x){scanf("%I64d",&x);}
void _r(const char*x){scanf("%s",x);}
void R(){}
template<class T,class... U>void R(const T&head,const U&...tail){_r(head);R(tail...);}
void _w(const char x){putchar(x);}
void _w(const char*x){printf("%s",x);}
void _w(const int x){printf("%d",x);}
void _w(const ll x){printf("%I64d",x);}
void _w(const double x){printf("%.6f",x);}
void W(){}
template<class T,class...U>void W(const T&head,const U&...tail){_w(head);putchar(sizeof...(tail)?' ':'\n');W(tail...);}
const ll mod = 1e9+7;
ll fp1(ll a,ll b){ll ans=1;while (b){if(b&1)ans*=a;b>>=1;a*=a;}return ans;}
ll fp2(ll a,ll b){ll ans=1;while (b){if(b&1)ans=ans*a%mod;b>>=1;a=a*a%mod;}return ans;}
ll Read(){
    ll res=0,flag=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if (ch=='-')flag = -1;ch = getchar();}
    while (ch>='0' && ch<='9'){res = res*10+ch-'0';ch = getchar();}
    return res*flag;
}
#define CL(x) memset(x,0,sizeof x)

const int N = 2e5+5;

vector<int>v[N];
int pos[N];

int main()
{
    int n,m,a,b;
    R(n,m);
    for1(i,1,m){
        R(a,b);
        v[a].pb(b);
    }
    pos[1] = 1;
    for1(i,2,n) pos[i] = pos[i-1]+max(1,(int)v[i-1].size());

    int tot = 1;
    for1(i,1,n){
        if (v[i].size()==0){
            W(1);
            W(tot,tot);
            tot++;
            continue;
        }
        W((int)(2*v[i].size()) );
        for (auto it:v[i]) {
            W(tot,tot);
            W(tot,pos[it]);
            tot++;
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define for1(i,a,b) for (int i=(a);i<=(b);i++)
#define for0(i,a,b) for (int i=(a);i<(b);i++)
#define rof1(i,a,b) for (int i=(a);i>=(b);i--)
#define rof0(i,a,b) for (int i=(a);i>(b);i--)
#define fi first
#define se second
#define pb push_back
#define duozu int __T;scanf("%d",&__T);for1(ica,1,__T)
void _r(const int&x){scanf("%d",&x);}
void _r(const ll&x){scanf("%I64d",&x);}
void _r(const char*x){scanf("%s",x);}
void R(){}
template<class T,class... U>void R(const T&head,const U&...tail){_r(head);R(tail...);}
void _w(const char x){putchar(x);}
void _w(const char*x){printf("%s",x);}
void _w(const int x){printf("%d",x);}
void _w(const ll x){printf("%I64d",x);}
void _w(const double x){printf("%.6f",x);}
void W(){}
template<class T,class...U>void W(const T&head,const U&...tail){_w(head);putchar(sizeof...(tail)?' ':'\n');W(tail...);}
const ll mod = 1e9+7;
ll fp1(ll a,ll b){ll ans=1;while (b){if(b&1)ans*=a;b>>=1;a*=a;}return ans;}
ll fp2(ll a,ll b){ll ans=1;while (b){if(b&1)ans=ans*a%mod;b>>=1;a=a*a%mod;}return ans;}
ll Read(){
    ll res=0,flag=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if (ch=='-')flag = -1;ch = getchar();}
    while (ch>='0' && ch<='9'){res = res*10+ch-'0';ch = getchar();}
    return res*flag;
}
#define CL(x) memset(x,0,sizeof x)

const int N = 2e5+5;

vector<int>v[N];
int pos[N];

int main()
{
    int n,m,a,b;
    R(n,m);
    for1(i,1,m){
        R(a,b);
        v[a].pb(b);
    }
    pos[1] = 1;
    for1(i,2,n) pos[i] = pos[i-1]+max(1,(int)v[i-1].size())-1;

    int tot = 1;
    for1(i,1,n){
        if (v[i].size()==0){
            W(1);
            W(tot,tot);
            tot++;
            continue;
        }
        W((int)(2*v[i].size()) );
        for (auto it:v[i]) {
            W(tot,tot);
            W(tot,pos[it]);
            tot++;
        }
    }
    return 0;
}