Go: // 九九を出すだけ
package main
import (
	"fmt"
	"os"
	"bufio"
)
var out = bufio.NewWriter(os.Stdout)

func main(){
	defer out.Flush()
	for i:=1; i<10; i++{
		for j:=1; j<10; j++{
			fmt.Fprintf(out, "%dx%d=%d\n", i, j, i*j)
		}
	}
}

C++: #include<stdio.h>
int main(void)
{
  int i,j;
  for(i=0;i<9;i++)
  {
    for(j=0;j<9;j++)
    {
      printf("%dx%d=%d\n",i+1,j+1,(i+1)*(j+1));
    }
  }
}

C++: #include<iostream>
using namespace std;

int main(){
    int i,j;
    
    for(i = 0;i < 10;i++){
        for(j = 0;j < 10;j++){
            cout << i << "x" << j << "=" << i*j << endl;
        }
    }  

    return 0;
}

C++: #include<stdio.h>
main(){int j=1,i=1;for(;++i<=9;)for(j=1;j<=9;)printf("%dx%d=%d\n",i,j++,i*j);}

C++: #include<cstdio>
#include<algorithm>
#include<cstring>
#include <iostream>
#define M 400010
using namespace std ;
int wa[M], wb[M], WS[M], wv[M];
int rk[M], sa[M], height[M];
int RMQ[21][M], mp[M], vis[M];
char r[M], s[M];
int a[M];
long long sum[M];

int min(int x, int y)
{
    return x < y? x: y;
}

bool cmp(int *r, int i, int j, int len)
{
    return r[i] == r[j] && r[i+len] == r[j+len];
}

void suffix(int *r, int n, int m)
{
    int *x = wa, *y = wb, *t;
    int i, j, p;
    for(i = 0; i < m; i++) WS[i] = 0;
    for(i = 0; i < n; i++) WS[x[i] = r[i]]++;
    for(i = 1; i < m; i++) WS[i] += WS[i-1];
    for(i = n - 1; i >= 0; i--) sa[--WS[x[i]]] = i;

    for(j = 1, p = 0; p < n; j <<= 1, m = p){
        p = 0;
        for(i = n-j; i < n; i++) y[p++] = i;
        for(i = 0; i < n; i++) if(sa[i] >= j) y[p++] = sa[i] - j;
        for(i = 0; i < m; i++) WS[i] = 0;
        for(i = 0; i < n; i++) WS[wv[i] = x[y[i]]]++;
        for(i = 1; i < m; i++) WS[i] += WS[i-1];
        for(i = n-1; i >= 0; i--) sa[--WS[wv[i]]] = y[i];

        t = x; x = y; y = t; x[sa[0]] = 0;
        for(i = 1, p = 1; i < n; i++)
            x[sa[i]] = cmp(y, sa[i], sa[i-1], j) ? p - 1: p++;
    }
}

void setHeight(int *r, int n)
{
    int i, j, k;
    for(i = 0; i <= n; i++)
        rk[sa[i]] = i;
    for(i=0, k=0; i < n; height[rk[i++]] = k)
        for(k = k?k-1: 0, j = sa[rk[i]-1]; r[i+k] == r[j+k]; k++);
}

void setRMQ(int n)
{
    mp[0] = -1;
    int i, j, a, b;
    for(i = 1; i <= n; i++)
        if((i&(i-1)) == 0) mp[i] = mp[i-1] + 1;
        else mp[i] = mp[i-1];
    for(i = 0; i <= n; i++) RMQ[0][i] = height[i];
    for(j = 1; j <= mp[n]; j++)
        for(i = 0; i+(1<<j)-1<=n; i++){
            a = RMQ[j-1][i];
            b = RMQ[j-1][i+(1<<(j-1))];
            RMQ[j][i] = min(a, b);
        }
}

int find(int a, int b)
{
	if( a == b ) return M;
    if(b < a){int t = a; a = b; b = t;}
    a++;
    int j = mp[b-a+1];
    int x = RMQ[j][a];
     b -= (1<<j) - 1;
    int y = RMQ[j][b];
    return min(x, y);
}
char maxn[M] ;
int nxt[M];
void getNext( char *a )
{
	for( int i = 0 ;a[i] ;i ++ ) maxn[i] = min( a[i+1] ,a[0] ) ;
	int i = 0, j = -1;
	nxt[i] = j;
	while( a[i] ){
		if( j == -1 || a[i] == a[j] ){
			++i, ++j;
			if( a[i] == a[j] ){
				nxt[i] = nxt[j];
				if( j != -1 ) maxn[i] = min( maxn[j] ,a[i+1] ) ;
				else maxn[i] = min( a[i+1] ,a[0] ) ;
				maxn[i] = min( a[0] ,maxn[i] ) ;
			}
			else nxt[i] = j;
		}
		else j = nxt[j];
	}
}
char str[M];

int judge( char *s, char *str ){ //s大
	getNext( str );
	int i = 0, j = 0, cnt = 0;
	int hehe = 0 ;
	int len = strlen( str );
	if( s[0] > str[0] ) return 0x3f3f3f3f ;
	while( s[i] ){
		if( j == -1 || s[i] == str[j] ){
	//		putchar(s[i]) ;
			if( j != -1 ){
				if( s[i+1] > maxn[j] ){ 
	//				putchar(' ') ;
					if( s[i+1] > str[0] ) return 0x3f3f3f3f ;
					hehe++ ;j = -1 ;
				}
			}
			i++; j++;
		}
		else j = nxt[j];
		if( j == len ) cnt++, j = nxt[j];
	}
	return hehe  + 1 ;
}
bool check( long long mid, int n, int k )
{
	int i = std::lower_bound( sum, sum + n + 1, mid ) - sum;
	int l = sa[i];
	int len = mid - sum[i-1] + height[i];
	for( int j = 0; j < len; ++j ) str[j] = s[l+j];
	str[len] = '\0';
	int ans = judge( s, str );
	return ans <= k;
}
void solve( int n, int k )
{
	sum[0] = 0;
	for( int i = 1; i <= n; ++i ) sum[i] = sum[i-1] + n - sa[i] - height[i];
	long long mid, l = 1, r = sum[n];
	while( r > l ){
		mid = ( l + r ) >> 1;
		if( check( mid, n, k ) ) r = mid;
		else l = mid + 1;
	}
	check( l, n, k );
	printf( "%s\n", str );
}
int main()
{
/*	char ax[30] ,bx[30] ;while( cin >> bx >> ax ){ 

		getNext(ax) ;
		for( int i = 0 ;ax[i] ;i ++ ) cout << maxn[i] << " " ;puts("") ;
		judge(bx,ax) ;
	}*/
	int k, n;
	while( scanf( "%d", &k ) == 1 && k ){
		scanf( "%s", s );
		n = strlen( s );
		for( int i = 0; i < n; ++i ) a[i] = s[i] - 'a' + 1;
		a[n] = 0;
		suffix( a, n + 1, 30 );
		setHeight( a, n );
		setRMQ( n );
		solve( n, k );
	}
}

C++: #include<iostream>
using namespace std;

int main(){

	
	for (int a = 1; a < 9; a++)
	{
		for (int i = 1; i < 9; i++)
		{

			cout << a << "ｘ" << i << "=" << a*i  <<endl;

		}
	}
		return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int main(){
	FOR(i,1,9+1){
		FOR(j,1,9+1){
			printf("%dx%d=%d\n",i,j,i*j);
		}
	}
}

C++: #include <iostream>
using namespace std;

int main() {
  int i, j;
  for(i = 1; i <= 9; i++)
    for(j = 1; j <= 9; j++)
      cout << i << "x" << j << "=" << i * j << endl;
  return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;

int main()
{

	for (int i = 1; i <= 9; i++) {
		for (int j = 1; j <= 9; j++) {
			printf("%dx%d=%d\n", i, j, i * j);
		}
	}
		return (0);
	
}

C++: #include<stdio.h>
main(){int i=1,j;for(;i<10;i++){for(j=1;j<10;j++){printf("%dx%d=%d\n",i,j,i*j);}}}

C++: #include <iostream>
#include <string>
using namespace std;

int main(){
int a = 1,b = 1,c;
while(a != 9 and b != 9){
c=a*b;
cout<<a<<"x"<<b<<"="<<c<<endl;
b++;
if(b == 10){
a++;
b = 1;
}

}
    return 0;
}

C++: #include<iostream>
using namespace std;
 
int main(){
    for(int i=1;i<10;i++){
        cout << i<<"x"<<i<<"="<<i*i<<"\n";
    }
//    cout << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
  for(int i=0; i<10;++i){
    for(int j=0; j<10; ++j){
      printf("%dx%d=%d\n",i,j,i*j);
    }
  }
 
  return 0;
}

C++: #include<iostream>
const int X99 9
const int Y99 9
int main()
{
for(int x=1;x<=X99;x++){
??for(int y=1;y<=Y99;y++){
??????std::cout << x << 'x' << y << '='<< x*y << '\n';
????}
??}
return 0;
}

C++: #include<iostream>

int main(){

    
    for(int i=1;i<10;i++){
        for(int j=1;j<10;j++){
            std::cout << i << "x" << j << "=" << i*j << std::endl;
        }
    }
    return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
	// your code goes here
	int i=0,j=0;
	for(i=1;i<=9;i++){
		for(j=1;j<=9;j++){
			printf("%dx%d=%d\n",i,j,i*j);
		}
	}
	return 0;
}

C++: #include<iostream>
int main() {
	for (int i = 1; i < 10; ++i) {
		for (int j = 1; j < 10; ++j) {
			std::cout << i << "x" << j << "=" << i*j << std::endl;
		}
	}
	return 0;
}