#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
vector<int> v[MAXN];
vector<pair<int, int> > sol;
string a, b;
int n;
bool bio[27];
void dfs(int a) {
  bio[a] = 1;
  for (auto x : v[a]) {
    if (!bio[x]) {
      sol.push_back(make_pair(x, a));
      dfs(x);
    }
  }
}
int main() {
  cin >> n;
  cin >> a >> b;
  for (int i = 0; i < n; i++) {
    v[a[i] - 'a'].push_back(b[i] - 'a');
    v[b[i] - 'a'].push_back(a[i] - 'a');
  }
  for (int i = 0; i < 26; i++) {
    if (!bio[i]) {
      dfs(i);
    }
  }
  cout << sol.size() << endl;
  for (auto x : sol) {
    char a = x.first + 'a';
    char b = x.second + 'a';
    cout << a << " " << b << endl;
  }
}
