#include <iostream>
using namespace std;
void digit(long long n, int i);
int main()
{
long long n;
int i;
cin >> n >> i;
digit(n, i);
return 0;
}
void digit(long long n, int i)
{
int arr[100] = { 0 };
int k = 0;
while (n != 0)
{
arr[k] = n % 10;
k++;
n = n / 10;
}
for (int j = k - i; j < k; j++)
{
cout << arr[k-j-1];
}
}
using namespace std;
void digit(long long n, int i);
int main()
{
long long n;
int i;
cin >> n >> i;
digit(n, i);
return 0;
}
void digit(long long n, int i)
{
int arr[100] = { 0 };
int k = 0;
while (n != 0)
{
arr[k] = n % 10;
k++;
n = n / 10;
}
for (int j = k - i; j < k; j++)
{
cout << arr[k-j-1];
}
}