#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string S;
  int k;
  cin >> S >> k;
  int l = S.length();
  if (l == k)
    cout << S << "\n";
  else {
    S = S.substr(0, l - k);
    S += "...";
    cout << S << "\n";
  }
}
