#include <bits/stdc++.h>
using namespace std;
template <class S, class T>
ostream &operator<<(ostream &out, const pair<S, T> p) {
  return out << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << "{";
  for (int i = (0); i < (v.size()); i++) out << v[i] << ", ";
  return out << "}" << endl;
}
int main() {
  string s, t;
  cin >> s;
  t = s;
  reverse(t.begin(), t.end());
  for (int i = (0); i < (t.length()); i++) {
    char c = '_';
    switch (t[i]) {
      case 'b':
        c = 'd';
        break;
      case 'd':
        c = 'b';
        break;
      case 'p':
        c = 'q';
        break;
      case 'q':
        c = 'p';
        break;
      default:
        break;
    }
    t[i] = c;
  }
  cout << t << endl;
  return 0;
}
