<pre>#include &lt;bits/stdc++.h&gt;
using namespace std;
#define rep(i,a,n) for(int i = a;i&lt;n;i++)
#define ll long long

int main(){
    iostream::sync_with_stdio(false);
    int n;
    while(cin&gt;&gt;n){
        int x = 1;
        while(x&lt;=n){
            if((n%(x*10))/x){
                cout &lt;&lt; (n-x) &lt;&lt; endl;
                break;
            }
            x *= 10;
        }
    }
    return 0;
}
</pre>
