#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cassert>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <set>
#include <map>

using namespace std;

#define mp(a, b) make_pair(a, b)
#define szof(a) ((int)(a).size())
#define all(a) (a).begin(), (a).end()

typedef signed long long int int64;
typedef long double real;
typedef pair<int, int> pii;

const int INF = INT_MAX;
const int64 LINF = LLONG_MAX;
const real EPS = 1e-9;
const int MAXN = 100001;
const int ALPH = 26;

#ifdef DEBUG
  #define _show(a) cerr << #a << " = " << a << endl;
#else
  #define _show(a) (void)42
#endif

int n;
string s;
map<string, bool> used;

string ans;

bool go(string curr, int step) {
  if (used[curr]) {
    return false;
  }
  
  if (step == n) {
    if (curr == s) {
      cout << curr << '\n';
      return true;
    }
    
    return false;
  }
  
  if (step) {
    used[curr] = true;
  }
  
  string next = curr;
  int ind = szof(next) - 1;
  next[ind] = 'A' + ((next[ind] - 'A') ^ 1);
  if (go(next, step + 1)) {
    ans += '1';
    return true;
  }
  
  for (int i = 1; i < szof(next); ++i) {
    if (curr[i] == curr[i - 1]) {
      next[i] = 'B';
    } else {
      next[i] = 'A';
    }
  }
  
  if (go(next, step + 1)) {
    ans += '2';
    return true;
  }
  
  used[curr] = false;
  return false;
}

int main() {
  ios_base::sync_with_stdio(false);
  
  cin >> n;
  
  for (int len = 4; len < 5; ++len) {
    for (int mask = 0; mask < (1 << len); ++mask) {
      s = string(len, 'A');
      for (int i = 1; i < len; ++i) {
        if (mask & (1 << i)) {
          s[i] = 'B';
        }
      }
      
      if (go(s, 0)) {
        reverse(all(ans));
        cout << ans << endl;
        return 0;
      }
    }
  }
}
