#include <bits/stdc++.h>
using namespace std;
int AbsDifference(int a, int b) {
  if (a >= b) return a - b;
  return b - a;
}
long long AbsDifference(long long a, long long b) {
  if (a >= b) return a - b;
  return b - a;
}
const int mod = 1000000007;
const int mod2 = 1000000009;
const int inf = 1 << 30;
const long long infLL = 1ll << 62;
const int impossible = -1;
struct stoyan_point {
  int x, y;
  int id;
};
struct stoyan_pointLL {
  long long x, y;
  int id;
};
struct stoyan_segment {
  stoyan_point first, second;
  int lenght;
  bool type;
  int id;
};
struct stoyan_segmentLL {
  stoyan_pointLL first, second;
  long long lenght;
  bool type;
  int id;
};
string translate(int number, int lenght, int k) {
  string ans;
  while (number) {
    ans += char(('1') + number & 1);
    number >>= 1;
  }
  reverse(ans.begin(), ans.end());
  return ans;
}
vector<int> find_divisors(long long number) {
  vector<int> ans;
  int sq = sqrt(number), j;
  for (j = 1; j <= sq; j++) {
    if (number % j == 0) {
      ans.push_back(j);
      if (j * j != number) ans.push_back(number / j);
    }
  }
  sort(ans.begin(), ans.end());
  return ans;
}
int cnt_divisors(long long number) {
  int ans = 0;
  int sq = sqrt(number), j;
  for (j = 1; j <= sq; j++) {
    if (number % j == 0) {
      ans++;
      if (j * j != number) ans++;
    }
  }
  return ans;
}
int n;
string a, b;
vector<int> v[128];
bool used[128];
int AnswerProblem;
vector<int> city;
void dfs(int start) {
  city.push_back(start);
  used[start] = true;
  for (int j = 0; j < int(v[start].size()); j++)
    if (!used[v[start][j]]) dfs(v[start][j]);
}
vector<pair<int, int> > answer;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cin >> a >> b;
  for (int i = 0; i < n; i++) {
    v[int(a[i])].push_back(int(b[i]));
    v[int(b[i])].push_back(int(a[i]));
  }
  for (int i = 97; i <= 122; i++) {
    if (!used[i]) {
      city.clear();
      dfs(i);
      for (int i = 1; i < int(city.size()); i++)
        answer.push_back(make_pair(city[i], city[0]));
    }
  }
  cout << int(answer.size()) << endl;
  for (int i = 0; i < int(answer.size()); i++)
    cout << char(answer[i].first) << " " << char(answer[i].second) << endl;
  return 0;
}
