#include using namespace std; using ll = long long; #define rep(i,a,b) for(int i = a; i < b; ++i) #define rrep(i,a,b) for(int i = a; i >= b; --i) #define all(x) (x).begin(),(x).end() int main(){ string s; cin >> s; int n = s.size()-1; if(s[n] == '0') s[n] = '1'; else s[n] = '0'; cout << s << endl; return 0; }