#include <bits/stdc++.h>
using namespace std;
char s[100010], l[100010];
int main() {
  cin >> s;
  int j = 0;
  for (int i = strlen(s) - 1; i >= 0; i--) {
    if (s[i] == 'p') l[j] = 'b';
    if (s[i] == 'b') l[j] = 'p';
    j++;
  }
  cout << l << endl;
  cout << l << endl << s << endl;
  return 0;
}
