#include <bits/stdc++.h>
using namespace std;
int n,y,ny;
long long var=0,x;
int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
    cin>>n>>x>>y;
    ny=y;
    for(int i=1;i<n;i++)
    {
        var++;
        ny--;
    }
    var+=pow(ny,2);
    if(var<x || ny<=0)
    {
        cout<<-1<<endl;
        return 0;
    }
    for(int i=1;i<n;i++)
        cout<<1<<endl;
    cout<<ny<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,y,ny;
long long var=0,x;
int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
    cin>>n>>x>>y;
    ny=y;
    for(int i=1;i<n;i++)
    {
        var++;
        ny--;
    }
    var+=pow(ny,2);
    if(var<x || ny<0)
    {
        cout<<-1<<endl;
        return 0;
    }
    for(int i=1;i<n;i++)
        cout<<1<<endl;
    cout<<ny<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,y,ny;
long long var=0,x;
int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
    cin>>n>>x>>y;
    ny=y;
    for(int i=1;i<n;i++)
    {
        var++;
        ny--;
    }
    var+=pow(ny,2);
    if(var<x)
    {
        cout<<-1<<endl;
        return 0;
    }
    for(int i=1;i<n;i++)
        cout<<1<<endl;
    cout<<ny<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    ll n,x,y;
    while(~scanf("%I64d %I64d %I64d",&n,&x,&y))
    {
        if(y>=n)
            printf("-1\n");
        else{
        ll temp = (y-n+1)*(y-n+1)+n-1;
        if(temp<x)
            printf("-1\n");
        else{
            printf("%I64d\n",y-n+1);
            for(int i=0;i<n-1;i++)
                printf("%d\n",1);
        }
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    ll n,x,y;
    while(~scanf("%I64d %I64d %I64d",&n,&x,&y))
    {
        if(y<n)
            printf("-1\n");
        else{
        ll temp = (y-n+1)*(y-n+1)+n-1;
        if(temp<x)
            printf("-1\n");
        else{
            printf("%I64d\n",y-n+1);
            for(int i=0;i<n-1;i++)
                printf("%d\n",1);
        }
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    ll n,x,y;
    while(~scanf("%I64d %I64d %I64d",&n,&x,&y))
    {
        ll temp = (y-n+1)*(y-n+1)+n-1;
        if(temp<x)
            printf("-1\n");
        else{
            printf("%I64d\n",y-n+1);
            for(int i=0;i<n-1;i++)
                printf("%d\n",1);
        }
    }
}


#include<bits/stdc++.h>

using namespace std;

long long x, y, niz[123456], sum1 = 0, sum2 = 0;
int n;

int main(){
	cin >> n >> x >> y;
	if (y < n || (n == y && n < x)) {
		cout << -1 << endl;
		return 0;
	}
	long long maksi = ceil(sqrt(x - n));
	sum2 = maksi + n - 1;
	sum1 = maksi * maksi + n - 1;
	if (sum2 > y || sum1 < x ){
		cout << -1 << endl;
		return 0;
	}
	cout << maksi << endl;
	for (int i = 1; i < n; i++){
		cout << 1 << endl;
	}
	cout << endl;
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int n, x, y, niz[123456], sum1 = 0, sum2 = 0;

int main(){
	cin >> n >> x >> y;
	if (y < n || (n == y && n < x)) {
		cout << -1 << endl;
		return 0;
	}
	int maksi = ceil(sqrt(x - n));
	sum2 = maksi + n - 1;
	sum1 = maksi * maksi + n - 1;
	if (sum2 > y || sum1 < x ){
		cout << -1 << endl;
		return 0;
	}
	cout << maksi << endl;
	for (int i = 1; i < n; i++){
		cout << 1 << endl;
	}
	cout << endl;
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

long long x, y, niz[123456], sum1 = 0, sum2 = 0;
int n;

int main(){
	cin >> n >> x >> y;
	if (y < n || (n == y && n < x)) {
		cout << -1 << endl;
		return 0;
	}
	long long maksi = ceil(sqrt(y - n + 1));
	sum2 = maksi + n - 1;
	sum1 = maksi * maksi + n - 1;
	if (sum2 > y || sum1 < x ){
		cout << -1 << endl;
		return 0;
	}
	cout << maksi << endl;
	for (int i = 1; i < n; i++){
		cout << 1 << endl;
	}
	cout << endl;
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

long long x, y, niz[123456], sum1 = 0, sum2 = 0;
int n;

int main(){
	cin >> n >> x >> y;
	if (y < n || (n == y && n < x)) {
		cout << -1 << endl;
		return 0;
	}
	long long maksi = ceil(sqrt(max(y, x) - n + 1));
	sum2 = maksi + n - 1;
	sum1 = maksi * maksi + n - 1;
	if (sum2 > y || sum1 < x ){
		cout << -1 << endl;
		return 0;
	}
	cout << maksi << endl;
	for (int i = 1; i < n; i++){
		cout << 1 << endl;
	}
	cout << endl;
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int n, x, y, niz[123456], sum1 = 0, sum2 = 0;

int main(){
	cin >> n >> x >> y;
	if (y < n || (n == y && n < x)) {
		cout << -1 << endl;
		return 0;
	}
	int maksi = ceil(sqrt(x - n));
	sum2 = maksi + n - 1;
	sum1 = maksi * maksi + n - 1;
	if (sum2 > y || sum1 < x ){
		cout << -1 << endl;
		return 0;
	}
	for (int i = 1; i < n; i++){
		cout << 1 << ' ';
	}
	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,x,y,m,t=0;
    cin>>n>>x>>y;
    t=x-(n-1);
    if(t<0)
    {cout<<-1<<endl;
    return 0;
    }
    m=ceil((double)sqrt(t));
    if(m*m+(n-1)>=x&&m+(n-1)<=y&&m>0)
    {
        for(int i=0;i<n-1;i++)
            cout<<1<<endl;
        cout<<m<<endl;
    }
    else
    cout<<-1<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,x,y,m,t=0;
    cin>>n>>x>>y;
    t=x-(n-1);
    m=ceil((double)sqrt(t));
    if(m*m+(n-1)>=x&&m+(n-1)<=y)
    {
        for(int i=0;i<n-1;i++)
            cout<<1<<endl;
        cout<<m<<endl;
    }
    else
    cout<<-1<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,x,y,m,t=0;
    cin>>n>>x>>y;
    t=x-(n-1);
    m=ceil((double)sqrt(t));
    if(m*m+(n-1)>=x&&m+(n-1)<=y&&m>0)
    {
        for(int i=0;i<n-1;i++)
            cout<<1<<endl;
        cout<<m<<endl;
    }
    else
    cout<<-1<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,x,y,m,t=0;
    cin>>n>>x>>y;
    t=y-(n-1);
    if(t<0)
    {cout<<-1<<endl;
    return 0;
    }
    m=t;
    if(m*m+(n-1)>=x&&m+(n-1)<=y&&m>0)
    {
        for(int i=0;i<n-1;i++)
            cout<<1<<endl;
        cout<<m<<endl;
    }
    else
    cout<<-1<<endl;
    return 0;
}


#include<cstdio>
#include<cmath>
#include<cstring>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<sstream>
#include<typeinfo>
#include<fstream>
#include<map>
#include<unordered_map>
using namespace std;
#define ZERO(a)  memset(a,0,sizeof(a))
#define ll  long long
#define FOR(i,x,n)  for(int i=x;i<n;i++)
#define FORc(i,x,n)  for(int i=x;i<=n;i++)

int main()
{
	ll int n,x,y;
	cin>>n>>x>>y;

	if(n>y)
	{
		cout<<-1<<endl;
		return 0;
	}

	vector<ll int>seq1,seq2;

	ll int c1=0,c2=0;
	FOR(i,0,n-1)
	{
		seq1.push_back(1);
		c1+=1;
		c2+=1;
	}

	ll int s=min(x,y);
	seq1.push_back(s-c1);
	c1+=(s-c1)*(s-c1);
	c2+=(s-c2);
	if(c1<x||c2>y)
	{
		cout<<-1<<endl;
		return 0;
	}
	FOR(i,0,seq1.size())

	cout<<seq1[i]<<" ";
	cout<<endl;

}


#include<cstdio>
#include<cmath>
#include<cstring>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<sstream>
#include<typeinfo>
#include<fstream>
#include<map>
#include<unordered_map>
using namespace std;
#define ZERO(a)  memset(a,0,sizeof(a))
#define ll  long long
#define FOR(i,x,n)  for(int i=x;i<n;i++)
#define FORc(i,x,n)  for(int i=x;i<=n;i++)

int main()
{
	unsigned ll n,x,y;
	cin>>n>>x>>y;

	if(n>y)
	{
		cout<<-1<<endl;
		return 0;
	}

	vector<unsigned  ll>seq1,seq2;

	unsigned  ll c1=0,c2=0;
	FOR(i,0,n-1)
	{
		seq1.push_back(1);
		c1+=1;
		c2+=1;
	}

	unsigned  ll s=min(x,y);
	seq1.push_back(s-c1);
	c1+=(s-c1)*(s-c1);
	c2+=(s-c2);
	if(c1<x||c2>y)
	{
		cout<<-1<<endl;
		return 0;
	}
	FOR(i,0,seq1.size())

	cout<<seq1[i]<<" ";
	cout<<endl;

}


#include<cstdio>
#include<cmath>
#include<cstring>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<sstream>
#include<typeinfo>
#include<fstream>
#include<map>
#include<unordered_map>
using namespace std;
#define ZERO(a)  memset(a,0,sizeof(a))
#define ll  long long
#define FOR(i,x,n)  for(int i=x;i<n;i++)
#define FORc(i,x,n)  for(int i=x;i<=n;i++)

int main()
{
	int n,x,y;
	cin>>n>>x>>y;

	vector<int>seq1,seq2;

	int c1=0,c2=0;
	FOR(i,0,n-1)
	{
		seq1.push_back(1);
		c1+=1;
		seq2.push_back(1);
		c2+=1;
	}

	int s=min(x,y);
	seq1.push_back(s-c1);
	c1+=(s-c1)*(s-c1);
	c2+=(s-c2);
	if(c1<x||c2>y)
	{
		cout<<-1<<endl;
		return 0;
	}
	FOR(i,0,seq1.size())

	cout<<seq1[i]<<" ";
	cout<<endl;

}


#include<cstdio>
#include<cmath>
#include<cstring>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<sstream>
#include<typeinfo>
#include<fstream>
#include<map>
#include<unordered_map>
using namespace std;
#define ZERO(a)  memset(a,0,sizeof(a))
#define ll  long long
#define FOR(i,x,n)  for(int i=x;i<n;i++)
#define FORc(i,x,n)  for(int i=x;i<=n;i++)

int main()
{
	ll int n,x,y;
	cin>>n>>x>>y;

	if(n>y)
	{
		cout<<-1<<endl;
		return 0;
	}

	vector<ll int>seq1,seq2;

	ll int c1=0,c2=0;
	FOR(i,0,n-1)
	{
		seq1.push_back(1);
		c1+=1;
		c2+=1;
	}

	ll int s=y;
	seq1.push_back(s-c1);
	c1+=(s-c1)*(s-c1);
	c2+=(s-c2);
	if(c1<x||c2>y)
	{
		cout<<-1<<endl;
		return 0;
	}
	FOR(i,0,seq1.size())

	cout<<seq1[i]<<" ";
	cout<<endl;

}


#include<cstdio>
#include<cmath>
#include<cstring>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<sstream>
#include<typeinfo>
#include<fstream>
#include<map>
#include<unordered_map>
using namespace std;
#define ZERO(a)  memset(a,0,sizeof(a))
#define ll  long long
#define FOR(i,x,n)  for(int i=x;i<n;i++)
#define FORc(i,x,n)  for(int i=x;i<=n;i++)

int main()
{
	unsigned ll n,x,y;
	cin>>n>>x>>y;

	if(n>x||n>y)
	{
		cout<<-1<<endl;
		return 0;
	}

	vector<unsigned  ll>seq1,seq2;

	unsigned  ll c1=0,c2=0;
	FOR(i,0,n-1)
	{
		seq1.push_back(1);
		c1+=1;
		c2+=1;
	}

	unsigned  ll s=min(x,y);
	seq1.push_back(s-c1);
	c1+=(s-c1)*(s-c1);
	c2+=(s-c2);
	if(c1<x||c2>y)
	{
		cout<<-1<<endl;
		return 0;
	}
	FOR(i,0,seq1.size())

	cout<<seq1[i]<<" ";
	cout<<endl;

}


#include<cstdio>
#include<cmath>
#include<cstring>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<sstream>
#include<typeinfo>
#include<fstream>
#include<map>
#include<unordered_map>
using namespace std;
#define ZERO(a)  memset(a,0,sizeof(a))
#define ll  long long
#define FOR(i,x,n)  for(int i=x;i<n;i++)
#define FORc(i,x,n)  for(int i=x;i<=n;i++)

int main()
{
	unsigned ll n,x,y;
	cin>>n>>x>>y;

	if(x==1||y==1&&n>1)
	{
		cout<<-1<<endl;
		return 0;
	}

	vector<unsigned  ll>seq1,seq2;

	unsigned  ll c1=0,c2=0;
	FOR(i,0,n-1)
	{
		seq1.push_back(1);
		c1+=1;
		c2+=1;
	}

	unsigned  ll s=min(x,y);
	seq1.push_back(s-c1);
	c1+=(s-c1)*(s-c1);
	c2+=(s-c2);
	if(c1<x||c2>y)
	{
		cout<<-1<<endl;
		return 0;
	}
	FOR(i,0,seq1.size())

	cout<<seq1[i]<<" ";
	cout<<endl;

}


#include<cstdio>
#include<cmath>
#include<cstring>
#include<ctime>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<sstream>
#include<typeinfo>
#include<fstream>
#include<map>
#include<unordered_map>
using namespace std;
#define ZERO(a)  memset(a,0,sizeof(a))
#define ll  long long
#define FOR(i,x,n)  for(int i=x;i<n;i++)
#define FORc(i,x,n)  for(int i=x;i<=n;i++)

int main()
{
	unsigned ll n,x,y;
	cin>>n>>x>>y;

	vector<unsigned  ll>seq1,seq2;

	unsigned  ll c1=0,c2=0;
	FOR(i,0,n-1)
	{
		seq1.push_back(1);
		c1+=1;
		seq2.push_back(1);
		c2+=1;
	}

	unsigned  ll s=min(x,y);
	seq1.push_back(s-c1);
	c1+=(s-c1)*(s-c1);
	c2+=(s-c2);
	if(c1<x||c2>y)
	{
		cout<<-1<<endl;
		return 0;
	}
	FOR(i,0,seq1.size())

	cout<<seq1[i]<<" ";
	cout<<endl;

}


#include <bits/stdc++.h>
using namespace std;

class problem
{
  public:
    int gcd(long long a,long long b)
    {
      if(a==0)
      {
        return b;
      }
      return gcd(b%a,a);
    }
    int lcm(long long a,long long b)
    {
      return (a*b)/gcd(a,b);
    }
    int fibo(int n)
    {
      double a;
      a=(1+sqrt(5))/2;
      return round(pow(a,n)/sqrt(5));
    }
   void sive(long long n)
    {
      long long i,j,count=0;
      bool ar[n];
      memset(ar,true,sizeof(ar));
      for(i=2;i*i<=n;i++)
      {
        if(ar[i]==true)
        {
          for(j=i*i;j<=n;j=j+i)
          {
            ar[j]=false;
          }
        }
      }
      cout<<"Prime Number between 1 to"<<n<<endl;
     for(i=2;i<=n;i++)
      {
        if(ar[i]==true)
        {
          cout<<i<<" ";
        }
      }
    }
    void segment(long long a,long long b)
    {
      long long n,i,base,j;
      bool ar[b-a+1];
      bool isprime [b-a+1];
      for(i=0;i<b-a+1;i++)
      {
        isprime[i]=true;
      }
      if(a==1)isprime[0]=false;
      memset(ar,true,sizeof(ar));
        for(i=2;i*i<=b;i++)
        {
          if(ar[i])
          {
            for(j=i*i;j<=b;j=j+i)
            {
              ar[j]=false;
            }
          }
        }
        for(i=2;i*i<=(b);i++)
        {
          if(ar[i])
          {
             base=i*i;
             if(base<a)
             {
               base=((a+i-1)/i)*i;
             }
             for(j=base;j<=b-a+1;j=j+i)
             {
               isprime[j-a]=false;
             }
          }
        }

        for(i=0;i<b-a+1;i++)
        {

          if(isprime[i]==true)
          {
            cout<<a+i<<" ";
          }
          j++;
        }
    }
    void bigfactorial(int n)
    {
      int ar[5000],i;
      ar[0]=1;
      int sizee=1;
      for(i=2;i<=n;i++)
      {
        sizee=multiple(i,ar,sizee);
      }
      cout<<"Factorial of your Number"<<endl;
      for(i=sizee-1;i>=0;i--)
      {
        cout<<ar[i];
      }
      cout<<endl;
    }
    int multiple(int x,int ar[],int sizee)
    {
      int carry=0,tem,i;
      for(i=0;i<sizee;i++)
      {
        tem=ar[i]*x+carry;
        ar[i]=tem%10;
        carry=tem/10;
      }
      while(carry!=0)
      {
        ar[sizee]=carry%10;
        carry=carry/10;
        sizee++;
      }
      return sizee;
    }
    void solve()
    {
      long long n,x,y,ans,i;
      cin>>n>>x>>y;
      if(y<n)
      {
        cout<<"-1";
      }
     ans=n-1+(y-n+1)*(y-n+1);
     if(ans<x)
     {
       cout<<"-1";
     }
     else
     {
       for(i=1;i<n;i++)
       {
         cout<<"1"<<endl;
       }
       cout<<(y-n+1);
     }
    }
};
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    problem codeforces;
  /* int tc;
   cin>>tc;
    while(tc--)
    {
      codeforces.solve();
    }*/
   codeforces.solve();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

class problem
{
  public:
    int gcd(long long a,long long b)
    {
      if(a==0)
      {
        return b;
      }
      return gcd(b%a,a);
    }
    int lcm(long long a,long long b)
    {
      return (a*b)/gcd(a,b);
    }
    int fibo(int n)
    {
      double a;
      a=(1+sqrt(5))/2;
      return round(pow(a,n)/sqrt(5));
    }
   void sive(long long n)
    {
      long long i,j,count=0;
      bool ar[n];
      memset(ar,true,sizeof(ar));
      for(i=2;i*i<=n;i++)
      {
        if(ar[i]==true)
        {
          for(j=i*i;j<=n;j=j+i)
          {
            ar[j]=false;
          }
        }
      }
      cout<<"Prime Number between 1 to"<<n<<endl;
     for(i=2;i<=n;i++)
      {
        if(ar[i]==true)
        {
          cout<<i<<" ";
        }
      }
    }
    void segment(long long a,long long b)
    {
      long long n,i,base,j;
      bool ar[b-a+1];
      bool isprime [b-a+1];
      for(i=0;i<b-a+1;i++)
      {
        isprime[i]=true;
      }
      if(a==1)isprime[0]=false;
      memset(ar,true,sizeof(ar));
        for(i=2;i*i<=b;i++)
        {
          if(ar[i])
          {
            for(j=i*i;j<=b;j=j+i)
            {
              ar[j]=false;
            }
          }
        }
        for(i=2;i*i<=(b);i++)
        {
          if(ar[i])
          {
             base=i*i;
             if(base<a)
             {
               base=((a+i-1)/i)*i;
             }
             for(j=base;j<=b-a+1;j=j+i)
             {
               isprime[j-a]=false;
             }
          }
        }

        for(i=0;i<b-a+1;i++)
        {

          if(isprime[i]==true)
          {
            cout<<a+i<<" ";
          }
          j++;
        }
    }
    void bigfactorial(int n)
    {
      int ar[5000],i;
      ar[0]=1;
      int sizee=1;
      for(i=2;i<=n;i++)
      {
        sizee=multiple(i,ar,sizee);
      }
      cout<<"Factorial of your Number"<<endl;
      for(i=sizee-1;i>=0;i--)
      {
        cout<<ar[i];
      }
      cout<<endl;
    }
    int multiple(int x,int ar[],int sizee)
    {
      int carry=0,tem,i;
      for(i=0;i<sizee;i++)
      {
        tem=ar[i]*x+carry;
        ar[i]=tem%10;
        carry=tem/10;
      }
      while(carry!=0)
      {
        ar[sizee]=carry%10;
        carry=carry/10;
        sizee++;
      }
      return sizee;
    }
    void solve()
    {
      long long n,x,y,ans,i;
      cin>>n>>x>>y;
      if(y<n)
      {
        cout<<"-1";
        return;
      }
     ans=n-1+(y-n+1)*(y-n+1);
     if(ans<x)
     {
       cout<<"-1";
     }
     else
     {
       for(i=1;i<n;i++)
       {
         cout<<"1"<<endl;
       }
       cout<<(y-n+1);
     }
    }
};
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    problem codeforces;
  /* int tc;
   cin>>tc;
    while(tc--)
    {
      codeforces.solve();
    }*/
   codeforces.solve();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int main()
{
    long long n,x,y;
    cin>>n>>x>>y;
    long long chis=y-n+1;
    if (n-1+chis*chis>=x)
    {
        for (long long i=0;i<n-1;i++)
            cout<<"1"<<'\n';
        cout<<chis;
    }
    else
        cout<<"-1";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int main()
{
    long long n,x,y;
    cin>>n>>x>>y;
    long long chis=y-n+1;
    if (n-1+chis*chis>=x && chis>0)
    {
        for (long long i=0;i<n-1;i++)
            cout<<"1"<<'\n';
        cout<<chis;
    }
    else
        cout<<"-1";
    return 0;
}


#include<iostream>
#include<vector>

using namespace std;
typedef long long ll;

int main(){
	ll n=0;
	ll x=0;
	ll y=0;
	cin>>n>>x>>y;
	if((y*y)>=x)cout<<"YES\n"<<y;
	else cout<<"NO\n";
	return 0;
}


#include<iostream>
#include<vector>

using namespace std;
typedef long long ll;

int main(){
	ll n=0;
	ll x=0;
	ll y=0;
	cin>>n>>x>>y;
	if((y*y)>=x)cout<<y;
	else cout<<-1;
	return 0;
}


#include<iostream>
#include<vector>

using namespace std;
typedef long long ll;

int main(){
	ll n=0;
	ll x=0;
	ll y=0;
	cin>>n>>x>>y;
	if(n>y){
		cout<<-1;
		return 0;
	}
	if((n-1+((y-(n-1))*(y-(n-1))))>=x){
		for(int i=0;i<n-1;++i){
			cout<<1<<'\n';
		}
		cout<<y-(n-1);
		return 0;
	}
	cout<<-1;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define sz size()
#define mp make_pair
#define mpp(a,b,c) make_pair(make_pair(a,b),c)
#define pb push_back
#define all(v) v.begin(),v.end()
#define EPS 1e-9
#define MOD 1000000007
#define MAX 1000005
typedef pair<int,int> pii;
typedef long long ll;

ll n,x,y;

int main()
{
   cin >> n >> x >> y;

   ll s = (y - n + 1) * (y - n + 1) + n - 1;

   if(s < x || n > y)
   {
       cout << -1;
       return 0;
   }

    cout << (y - n + 1)<< endl;
    for(int i=1; i<n; i++)
    cout << 1 << endl;

}


#include <bits/stdc++.h>
using namespace std;
#define sz size()
#define mp make_pair
#define mpp(a,b,c) make_pair(make_pair(a,b),c)
#define pb push_back
#define all(v) v.begin(),v.end()
#define EPS 1e-9
#define MOD 1000000007
#define MAX 1000005
typedef pair<int,int> pii;
typedef long long ll;

ll n,x,y;

int main()
{
   cin >> n >> x >> y;

   ll s = (y - n + 1) * (y - n + 1) + n - 1;

   if(s < x)
   {
       cout << -1;
       return 0;
   }

    cout << (y - n + 1)<< endl;
    for(int i=1; i<n; i++)
    cout << 1 << endl;

}


#include <bits/stdc++.h>
using namespace std;
#define sz size()
#define mp make_pair
#define mpp(a,b,c) make_pair(make_pair(a,b),c)
#define pb push_back
#define all(v) v.begin(),v.end()
#define EPS 1e-9
#define MOD 1000000007
#define MAX 1000005
typedef pair<int,int> pii;
typedef long long ll;

int n;
ll x,y;

int main()
{
   cin >> n >> x >> y;

   int d = -1;

    for(int i=y - n + 1; i>=1; i--)
    {
        if(i *1LL* i >= x){ d = i; break; }
    }

    if(d == -1)
    {
        printf("-1");
        return 0;
    }

    printf("%d\n",d);
    for(int i=1; i<n; i++)
    printf("1\n");

}


#include <bits/stdc++.h>
using namespace std;

int main () {
	long long int n, x, y, sum = 0;
	cin >> n >> x >> y;
	if (n > y) {
		printf("-1\n");
		return 0;
	}
	for (int i = 1; i <= n; i++) {
		if (i == n) sum += (y - n + 1)*(y - n + 1);
		else sum += 1;
	}
	if (sum > x) {
		for (int i = 1; i <= n; i++) {
			if (i == n) cout << y - n + 1 << "\n";
			else cout << "1\n";
		}
	}
	else printf("-1\n");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main () {
	long long int n, x, y, sum = 0;
	cin >> n >> x >> y;
	if (n > y) {
		printf("-1\n");
		return 0;
	}
	for (int i = 1; i <= n; i++) {
		if (i == n) sum += (y - n + 1)*(y - n + 1);
		else sum += 1;
	}
	if (sum >= x) {
		for (int i = 1; i <= n; i++) {
			if (i == n) cout << y - n + 1 << "\n";
			else cout << "1\n";
		}
	}
	else printf("-1\n");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define setDP(arr) memset(arr,-1,sizeof arr)
#define Clear(arr) memset(arr,0,sizeof arr)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define TurnOn(s,j) s|=(1<<j)
#define TurnOff(s,j) s&=~(1<<j)
#define Flip(s,j) s^=(1<<j)
#define LSB(s) s&(-s)
#define Setall(n) ((1<<n)-1)
const ll mod = 1000000007;
const double eps = 1e-9;
#define In_the_name_of_allah_the_merciful ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define Alhamdulillah return 0 ;
ll po(ll b,ll p){
    if (!p)
        return 1LL;
    ll ret = po(b,p/2LL);
    ret *= ret;
    if (p&1)
        ret *= b;
    return ret;
}
int main()
{
    In_the_name_of_allah_the_merciful
    ll n,x,y;
    cin >> n >> x >> y;
    ll tt = n-1 , cr = 1;
    while(1){
        ll p = po(cr,2);
        if (p+tt >= x && (cr+tt)<=y) break;
        if (cr+tt >= y && p+tt < x)
            return cout << "-1" << endl,0;
        cr++;
    }
    cout << cr << " ";
    rep(i,0,n-1)
        cout << 1 << " ";
    cout << endl;

    Alhamdulillah
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define setDP(arr) memset(arr,-1,sizeof arr)
#define Clear(arr) memset(arr,0,sizeof arr)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define TurnOn(s,j) s|=(1<<j)
#define TurnOff(s,j) s&=~(1<<j)
#define Flip(s,j) s^=(1<<j)
#define LSB(s) s&(-s)
#define Setall(n) ((1<<n)-1)
const ll mod = 1000000007;
const double eps = 1e-9;
#define In_the_name_of_allah_the_merciful ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define Alhamdulillah return 0 ;
ll po(ll b,ll p){
    if (!p)
        return 1LL;
    ll ret = po(b,p/2LL);
    ret *= ret;
    if (p&1)
        ret *= b;
    return ret;
}
int main()
{
    In_the_name_of_allah_the_merciful
    ll n,x,y;
    cin >> n >> x >> y;
    ll tt = n-1 , cr = 1;
    while(1){
        ll p = po(cr,2);
        if (p+tt >= x && (cr+tt)<=y) break;
        if (cr+tt > y)
            return cout << "-1" << endl,0;
        cr++;
    }
    cout << cr << " ";
    rep(i,0,n-1)
        cout << 1 << " ";
    cout << endl;

    Alhamdulillah
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main() {
//  freopen("a", "r", stdin);
    int n;
    ll x, y;
    scanf("%d%lld%lld", &n, &x, &y);
    ll z = n - 1;
    ll w = x - (n - 1);
    if (w <= 0) {
        puts("-1");
        return 0;
    }
    ll s = sqrt(w);
    if (s * s != w)
        ++s;
    if (z + s <= y && z + s * s >= y) {
        for (int i = 0; i < n - 1; ++i)
            puts("1");
        printf("%lld\n", s);
    } else
        puts("-1");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main() {
//  freopen("a", "r", stdin);
    int n;
    ll x, y;
    scanf("%d%lld%lld", &n, &x, &y);
    ll z = n - 1;
    ll w = x - (n - 1);
    if (w <= 0) {
        puts("-1");
        return 0;
    }
    ll s = sqrt(w);
    if (s * s != w)
        ++s;
    if (z + s <= y && z + s * s >= x) {
        for (int i = 0; i < n - 1; ++i)
            puts("1");
        printf("%lld\n", s);
    } else
        puts("-1");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main() {
//  freopen("a", "r", stdin);
    int n;
    ll x, y;
    scanf("%d%lld%lld", &n, &x, &y);
    ll z = n - 1;
    ll w = x - z;
    if (w <= 0) {
        if (n <= y)
            for (int i = 0; i < n; ++i)
                puts("1");
        else
            puts("-1");
    } else {
        ll s = sqrt(w);
        if (s * s != w)
            ++s;
        if (z + s <= y && z + s * s >= x) {
            for (int i = 0; i < n - 1; ++i)
                puts("1");
            printf("%lld\n", s);
        } else
            puts("-1");
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main() {
//  freopen("a", "r", stdin);
    int n;
    ll x, y;
    scanf("%d%lld%lld", &n, &x, &y);
    ll z = n - 1;
    ll w = x - (n - 1);
    ll s = sqrt(w);
    if (s * s != w)
        ++s;
    if (z + s <= y && z + s * s >= y) {
        for (int i = 0; i < n - 1; ++i)
            puts("1");
        printf("%lld\n", s);
    } else
        puts("-1");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
	long long n,x,y,i;
	int a;
	cin >> n >> x >> y;
	a = y - n + 1;
	if(a*a+n-1 < x) printf("-1");
	else
	{
		printf("%d\n",a);
		for(i=2;i<=n;i++)
		{
			printf("1\n");
		}
	}

}


#include <bits/stdc++.h>
using namespace std;
long long  n,x,y,i;
int main(){
	cin>>n>>x>>y;
	if((y-n+1)*(y-n+1)+n-1<x||y<n)	{cout<<-1; return 0;}
	cout<<y-n+1;
	while(n-->1) cout<<endl<<1;
}


#include<bits/stdc++.h>
using namespace std;
#define con continue
#define bk break
#define LL long long
#define db double
#define pt cout<<'\n'
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
#define endl '\n'
int inf=2147483647;const long long ll =9223372036854775807,ninf=1000000000;const double eps = 1e-6; const long long nll =1000000000000000000;
#define sz size()
#define len(X) strlen(X)
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ULL unsigned long long
#define de cout<<"test"<<endl;
#define st system("pause");
#define F first
#define S second
#define M_PI 3.1415926
#define ac fstream cin("input.txt");ofstream cout("output.txt");
class CandyMaking
{
    public:
double findSuitableDensity(vector <int> A, vector <int> B)
{

    }
};
int ans[100005]={};
int main()
{
LL a,b,c;
while(cin>>a>>b>>c){
    for(int i=0;i<a-1;i++){
        ans[i]=1;
        b--;
        c--;
    }
    int ok=0;
    for(int i=1;i<=1000000;i++){
        LL t=i;
        if(t<=c&&t*t>=b){
            ans[a-1]=t;
            ok=1;
            bk;
        }
    }
    if(!ok){
        cout<<-1<<endl;
        con;
    }
    for(int i=0;i<a;i++){
        cout<<ans[i]<<endl;
    }
}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define con continue
#define bk break
#define LL long long
#define db double
#define pt cout<<'\n'
#define ms(a, b) memset((a), (b), sizeof(a))
#define mp make_pair
#define endl '\n'
int inf=2147483647;const long long ll =9223372036854775807,ninf=1000000000;const double eps = 1e-6; const long long nll =1000000000000000000;
#define sz size()
#define len(X) strlen(X)
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ULL unsigned long long
#define de cout<<"test"<<endl;
#define st system("pause");
#define F first
#define S second
#define M_PI 3.1415926
#define ac fstream cin("input.txt");ofstream cout("output.txt");
class CandyMaking
{
    public:
double findSuitableDensity(vector <int> A, vector <int> B)
{

    }
};
int ans[100005]={};
int main()
{
LL a,b,c;
while(cin>>a>>b>>c){
    for(int i=0;i<a-1;i++){
        ans[i]=1;
        b--;
        c--;
    }
    int ok=0;
    for(int i=1;i<=100000;i++){
        LL t=i;
        if(t<=c&&t*t>=b){
            ans[a-1]=t;
            ok=1;
            bk;
        }
    }
    if(!ok){
        cout<<-1<<endl;
        con;
    }
    for(int i=0;i<a;i++){
        cout<<ans[i]<<endl;
    }
}
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main () {

    long long n , x , y , k = 0;
    cin >> n >> x >> y;

    for(long long i = 1;i <= x / 2;i ++){
        if(i * i + (n - 1) >= x && i + (n - 1) <= y){
            cout << i << endl;
            for(int j = 1;j <= n - 1;j ++)
                cout << 1 << endl;
                return 0;
        }
    }

    cout << -1;

return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main () {

    long long n , x , y , k = 0;
    cin >> n >> x >> y;

    for(long long i = 1;i <= y;i ++){
        if(i * i + (n - 1) >= x && i + (n - 1) <= y){
            cout << i << endl;
            for(int j = 1;j <= n - 1;j ++)
                cout << 1 << endl;
                return 0;
        }
    }

    cout << -1;

return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main () {

    long long n , x , y , k = 0;
    cin >> n >> x >> y;

    for(long long i = 1;i <= x;i ++){
        if(i * i + (n - 1) >= x && i + (n - 1) <= y){
            cout << i << endl;
            for(int j = 1;j <= n - 1;j ++)
                cout << 1 << endl;
                return 0;
        }
    }

    cout << -1;

return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long           LL;
typedef unsigned long long  ULL;
typedef vector<int>         vi;
typedef vector<vi>          vvi;
typedef pair<int,int>       pii;
typedef pair<LL,LL>         pll;
typedef complex<double>     point;

#define X                           real()
#define Y                           imag()
#define angle(p)                    atan2(p.Y,p.X)
#define vec(a,b)                    (b-a)
#define dot_p(v1,v2)                (conj(v1)*v2).X
#define cross_p(v1,v2)              (conj(v1)*v2).Y
#define length(p)                   hypot(p.X,p.Y)
#define lengthSqr(p)                dot_p(p,p)
#define rotateO(p,theta)            (p*exp(point(0,theta)))
#define rotateA(p,theta,about)      rotateO(vac(about,p), theta) + about
#define reflectO(p,m)               conj(p/m)*m
#define reflectA(p,p0,pm)           conj(vec(p0,p)/vec(p0,pm))*vec(p0,pm) + p0
#define scf                         scanf
#define prf                         printf
#define F_IO                        ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define all(c)                      c.begin(),c.end()
#define sz(c)                       ((int)((c).size()))
#define pb                          push_back
#define eb                          emplace_back
#define popb                        pop_back
#define mp                          make_pair
#define xf                          first
#define ys                          second
#define lp(i,s,e)                   for(__typeof(e) i=s ; i<e ;  ++i)
#define lpr(i,e,s)                  for(__typeof(e) i=e ; i>s ;  --i)
#define lpo(var , c)                for(const auto &var : c)
#define mems(c,val)                 memset(c,val,sizeof(c))
#define mod                         1000000007
#define OOi                         (~(1<<31))
#define OOl                         (~((LL)1<<63))
#define PI                          (3.141592654)
#define EPS                         (1e-7)
//____________________________________________________________________.

int main(){
	F_IO;
	LL n,x,y;
	cin>>n>>x>>y;

	LL max_a=(n-1) + (y-n+1)*(y-n+1);

	if(max_a<x || y<n) cout<<-1<<"\n";
	else{
		lp(i,1,n) cout<<"1 ";
		cout<<y-n+1<<"\n";
	}

	return 0;
}
//3	22	5


#include<bits/stdc++.h>
using namespace std;

typedef long long           LL;
typedef unsigned long long  ULL;
typedef vector<int>         vi;
typedef vector<vi>          vvi;
typedef pair<int,int>       pii;
typedef pair<LL,LL>         pll;
typedef complex<double>     point;

#define X                           real()
#define Y                           imag()
#define angle(p)                    atan2(p.Y,p.X)
#define vec(a,b)                    (b-a)
#define dot_p(v1,v2)                (conj(v1)*v2).X
#define cross_p(v1,v2)              (conj(v1)*v2).Y
#define length(p)                   hypot(p.X,p.Y)
#define lengthSqr(p)                dot_p(p,p)
#define rotateO(p,theta)            (p*exp(point(0,theta)))
#define rotateA(p,theta,about)      rotateO(vac(about,p), theta) + about
#define reflectO(p,m)               conj(p/m)*m
#define reflectA(p,p0,pm)           conj(vec(p0,p)/vec(p0,pm))*vec(p0,pm) + p0
#define scf                         scanf
#define prf                         printf
#define F_IO                        ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define all(c)                      c.begin(),c.end()
#define sz(c)                       ((int)((c).size()))
#define pb                          push_back
#define eb                          emplace_back
#define popb                        pop_back
#define mp                          make_pair
#define xf                          first
#define ys                          second
#define lp(i,s,e)                   for(__typeof(e) i=s ; i<e ;  ++i)
#define lpr(i,e,s)                  for(__typeof(e) i=e ; i>s ;  --i)
#define lpo(var , c)                for(const auto &var : c)
#define mems(c,val)                 memset(c,val,sizeof(c))
#define mod                         1000000007
#define OOi                         (~(1<<31))
#define OOl                         (~((LL)1<<63))
#define PI                          (3.141592654)
#define EPS                         (1e-7)
//____________________________________________________________________.

int main(){
	F_IO;
	LL n,x,y;
	cin>>n>>x>>y;

	LL max_a=(n-1) + (y-n+1)*(y-n+1);

	if(max_a<x) cout<<-1<<"\n";
	else{
		lp(i,1,n) cout<<"1 ";
		cout<<y-n+1<<"\n";
	}

	return 0;
}
//3	22	5


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<pair<int,int>,int> prk;
typedef pair<int,int> pr;
const int MAX=105;
ll n,x,y,ys,tmp;
int main(){
    cin>>n>>x>>y;
    ys=y-n+1;
    //cout<<"ys"<<tmp<<endl;
    tmp=ys*ys+n-1;
    //cout<<"temp"<<tmp<<endl;
    if(tmp>=x){
        for(int i=0;i<n-1;i++)
            cout<<"1\n";
        cout<<ys;
    }else{
        cout<<-1;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<pair<int,int>,int> prk;
typedef pair<int,int> pr;
const int MAX=105;
ll n,x,y,ys,tmp;
int main(){
    cin>>n>>x>>y;
    ys=y-n+1;
    //cout<<"ys"<<tmp<<endl;
    tmp=ys*ys+n-1;
    //cout<<"temp"<<tmp<<endl;
    if(tmp>=x&&ys>0){
        for(int i=0;i<n-1;i++)
            cout<<"1\n";
        cout<<ys;
    }else{
        cout<<-1;
    }
    return 0;
}


#define VERNIY st();int ver=0,niy=0,hbk=0
//#pragma GCC optimize("0fast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <limits.h>
#include <float.h>

#include <iostream>
#include <algorithm>
#include <string>
#include <iterator>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <functional>
#include <sstream>
typedef unsigned long long LLU;
typedef long long LL;
using namespace std;
#define Lfmax DBL_MAX
#define LLUmax ULLONG_MAX
#define LLmax LLONG_MAX
#define dmax INT_MAX
typedef vector<int> vd;
typedef vector<pair<int,int> > vpd;
typedef pair<int,int> pd;
typedef queue<int> qd;
typedef queue<pair<int,int> > qpd;
typedef priority_queue<int> maxpqd;
typedef priority_queue<int, vector<int>, greater<int> > minpqd;
#define fr front
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define newline printf("\n")
#define forin(a,b,c) for(int a=b ; a<c ; ++a)
#define forineq(a,b,c) for(int a=b ; a<=c ; ++a)
#define forde(a,b,c) for(int a=b ; a>=c ; --a)
#define UPC(oo) (oo>='A' && oo<='Z')
#define LWC(oo) (oo>='a' && oo<='z')
#define DGT(oo) (oo>='0' && oo<='9')
#define UPCVOC(oo) (oo=='A' || oo=='E' || oo=='I' || oo=='U' || oo=='O')
#define LWCVOC(oo) (oo=='a' || oo=='e' || oo=='i' || oo=='u' || oo=='o')
#define filein(oo) freopen(oo,"r",stdin);
#define fileout(oo) freopen(oo,"w",stdout);
#define setarr(a,b,c) memset(a,b,sizeof(c))

template<class Ver>
inline void in(Ver &a){cin>>a;}
template<class Ver,class Niy>
inline void in(Ver &a, Niy &b){cin>>a>>b;}
template<class Ver,class Niy, class Hbk>
inline void in(Ver &a, Niy &b, Hbk &c){cin>>a>>b>>c;}

template<class Ver>
inline void out(Ver a){cout<<a<<"\n";};
template<class Ver,class Niy>
inline void out(Ver a,Niy b){cout<<a<<" "<<b<<"\n";};
template<class Ver,class Niy, class Hbk>
inline void out(Ver a, Niy b, Hbk c){cout<<a<<" "<<b<<" "<<c<<"\n";};

inline void debug(){cout<<"asd"<<endl;}
template<class Ver>
inline void debug(Ver a){cout<<"--- "<<a<<endl;};
template<class Ver,class Niy>
inline void debug(Ver a,Niy b){cout<<"--- "<<a<<" "<<b<<endl;};
template<class Ver,class Niy, class Hbk>
inline void debug(Ver a,Niy b,Hbk c){cout<<"--- "<<a<<" "<<b<<" "<<c<<endl;};

#define grav 9.8
#define pi 3.14159265

void st()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
}

int main()
{
	VERNIY;
	LL a,b,c;
	in(a,b,c);
	LL total=0;
	vector<LL> vec;
	forin(i,0,a-1)
	{
		total+=1;
		vec.pb(1);
	}
	LL d=c-total;
	if(total+(d*d)<b)
	{
		out("-1");
		return 0;
	}
	vec.pb(d);
	forin(i,0,vec.size())
	out(vec[i]);
	return 0;
}


#define VERNIY st();int ver=0,niy=0,hbk=0
//#pragma GCC optimize("0fast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <limits.h>
#include <float.h>

#include <iostream>
#include <algorithm>
#include <string>
#include <iterator>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <functional>
#include <sstream>
typedef unsigned long long LLU;
typedef long long LL;
using namespace std;
#define Lfmax DBL_MAX
#define LLUmax ULLONG_MAX
#define LLmax LLONG_MAX
#define dmax INT_MAX
typedef vector<int> vd;
typedef vector<pair<int,int> > vpd;
typedef pair<int,int> pd;
typedef queue<int> qd;
typedef queue<pair<int,int> > qpd;
typedef priority_queue<int> maxpqd;
typedef priority_queue<int, vector<int>, greater<int> > minpqd;
#define fr front
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define newline printf("\n")
#define forin(a,b,c) for(int a=b ; a<c ; ++a)
#define forineq(a,b,c) for(int a=b ; a<=c ; ++a)
#define forde(a,b,c) for(int a=b ; a>=c ; --a)
#define UPC(oo) (oo>='A' && oo<='Z')
#define LWC(oo) (oo>='a' && oo<='z')
#define DGT(oo) (oo>='0' && oo<='9')
#define UPCVOC(oo) (oo=='A' || oo=='E' || oo=='I' || oo=='U' || oo=='O')
#define LWCVOC(oo) (oo=='a' || oo=='e' || oo=='i' || oo=='u' || oo=='o')
#define filein(oo) freopen(oo,"r",stdin);
#define fileout(oo) freopen(oo,"w",stdout);
#define setarr(a,b,c) memset(a,b,sizeof(c))

template<class Ver>
inline void in(Ver &a){cin>>a;}
template<class Ver,class Niy>
inline void in(Ver &a, Niy &b){cin>>a>>b;}
template<class Ver,class Niy, class Hbk>
inline void in(Ver &a, Niy &b, Hbk &c){cin>>a>>b>>c;}

template<class Ver>
inline void out(Ver a){cout<<a<<"\n";};
template<class Ver,class Niy>
inline void out(Ver a,Niy b){cout<<a<<" "<<b<<"\n";};
template<class Ver,class Niy, class Hbk>
inline void out(Ver a, Niy b, Hbk c){cout<<a<<" "<<b<<" "<<c<<"\n";};

inline void debug(){cout<<"asd"<<endl;}
template<class Ver>
inline void debug(Ver a){cout<<"--- "<<a<<endl;};
template<class Ver,class Niy>
inline void debug(Ver a,Niy b){cout<<"--- "<<a<<" "<<b<<endl;};
template<class Ver,class Niy, class Hbk>
inline void debug(Ver a,Niy b,Hbk c){cout<<"--- "<<a<<" "<<b<<" "<<c<<endl;};

#define grav 9.8
#define pi 3.14159265

void st()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
}

int main()
{
	VERNIY;
	LL a,b,c;
	in(a,b,c);
	LL total=0;
	vector<LL> vec;
	forin(i,0,a-1)
	{
		total+=1;
		vec.pb(1);
	}
	LL d=c-total;
	if(total+(d*d)<b || d<0)
	{
		out("-1");
		return 0;
	}
	vec.pb(d);
	forin(i,0,vec.size())
	out(vec[i]);
	return 0;
}


#define VERNIY st();int ver=0,niy=0,hbk=0
//#pragma GCC optimize("0fast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <limits.h>
#include <float.h>

#include <iostream>
#include <algorithm>
#include <string>
#include <iterator>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <functional>
#include <sstream>
typedef unsigned long long LLU;
typedef long long LL;
using namespace std;
#define Lfmax DBL_MAX
#define LLUmax ULLONG_MAX
#define LLmax LLONG_MAX
#define dmax INT_MAX
typedef vector<int> vd;
typedef vector<pair<int,int> > vpd;
typedef pair<int,int> pd;
typedef queue<int> qd;
typedef queue<pair<int,int> > qpd;
typedef priority_queue<int> maxpqd;
typedef priority_queue<int, vector<int>, greater<int> > minpqd;
#define fr front
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define newline printf("\n")
#define forin(a,b,c) for(int a=b ; a<c ; ++a)
#define forineq(a,b,c) for(int a=b ; a<=c ; ++a)
#define forde(a,b,c) for(int a=b ; a>=c ; --a)
#define UPC(oo) (oo>='A' && oo<='Z')
#define LWC(oo) (oo>='a' && oo<='z')
#define DGT(oo) (oo>='0' && oo<='9')
#define UPCVOC(oo) (oo=='A' || oo=='E' || oo=='I' || oo=='U' || oo=='O')
#define LWCVOC(oo) (oo=='a' || oo=='e' || oo=='i' || oo=='u' || oo=='o')
#define filein(oo) freopen(oo,"r",stdin);
#define fileout(oo) freopen(oo,"w",stdout);
#define setarr(a,b,c) memset(a,b,sizeof(c))

template<class Ver>
inline void in(Ver &a){cin>>a;}
template<class Ver,class Niy>
inline void in(Ver &a, Niy &b){cin>>a>>b;}
template<class Ver,class Niy, class Hbk>
inline void in(Ver &a, Niy &b, Hbk &c){cin>>a>>b>>c;}

template<class Ver>
inline void out(Ver a){cout<<a<<"\n";};
template<class Ver,class Niy>
inline void out(Ver a,Niy b){cout<<a<<" "<<b<<"\n";};
template<class Ver,class Niy, class Hbk>
inline void out(Ver a, Niy b, Hbk c){cout<<a<<" "<<b<<" "<<c<<"\n";};

inline void debug(){cout<<"asd"<<endl;}
template<class Ver>
inline void debug(Ver a){cout<<"--- "<<a<<endl;};
template<class Ver,class Niy>
inline void debug(Ver a,Niy b){cout<<"--- "<<a<<" "<<b<<endl;};
template<class Ver,class Niy, class Hbk>
inline void debug(Ver a,Niy b,Hbk c){cout<<"--- "<<a<<" "<<b<<" "<<c<<endl;};

#define grav 9.8
#define pi 3.14159265

void st()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
}

int main()
{
	VERNIY;
	LL a,b,c;
	in(a,b,c);
	LL total=0;
	vector<LL> vec;
	forin(i,0,a-1)
	{
		total+=1;
		vec.pb(1);
	}
	LL d=c-total;
	if(total+(d*d)<b || d<=0)
	{
		out("-1");
		return 0;
	}
	vec.pb(d);
	forin(i,0,vec.size())
	out(vec[i]);
	return 0;
}


#include <iostream>
#include <math.h>
using namespace std;

int main() {
	long long int n, x, y, countX=0, countY=0, add = 1, index = 1, start = 0, end = 0, track = 0; bool res = false;

	cin >> n >> x >> y;

	if(n > 1){
	    start = y - (n - 1);
        countX = pow(start, 2);

        for(int i=1; i < n; i++){
            countX += 1;
        }

        if(countX >= x){
            res = true;
        }

        if(res){
            cout<< start<<endl;
            for(int i=1; i < n; i++){
                cout << 1 << endl;
            }
        }else{
            cout << -1;
        }

	}else{
	    n = y;

        if( n == y && n*n < x){ res = false;}
        if( n <= y && n*n >= x){ res = true;}

	    if(!res) cout << -1;
	    else
	        cout << n;
	}

}


#include <iostream>
#include <math.h>
using namespace std;

int main() {
	long long int n, x, y, countX=0, countY=0, add = 1, index = 1, start = 0, end = 0, track = 0; bool res = false;

	cin >> n >> x >> y;

	if(n > y) cout << -1;
	else
	if(n > 1){
	    start = y - (n - 1);
        countX = pow(start, 2);

        for(int i=1; i < n; i++){
            countX += 1;
        }

        if(countX >= x){
            res = true;
        }

        if(res){
            cout<< start<<endl;
            for(int i=1; i < n; i++){
                cout << 1 << endl;
            }
        }else{
            cout << -1;
        }

	}else{
	    n = y;

        if( n == y && n*n < x){ res = false;}
        if( n <= y && n*n >= x){ res = true;}

	    if(!res) cout << -1;
	    else
	        cout << n;
	}

}


#include <bits/stdc++.h>

using namespace std;

long long int n, x, y, prva = 0, druga = 0;
long long int numbers[100000];

int main()
{
	cin >> n >> x >> y;

	if((n == y && n < x) || y < n)
	{
		cout << -1 << endl;
		return 0;
	}

	prva = druga = n - 1;

	cout << ceil(sqrt(x - prva)) << endl;

	for(int i = 1; i < n; ++i)
	{
		cout << 1 << endl;
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long int n, x, y, prva = 0, druga = 0;
long long int numbers[100000];

int main()
{
	cin >> n >> x >> y;

	if((n == y && n < x) || y < n)
	{
		cout << -1 << endl;
		return 0;
	}

	prva = druga = n - 1;

	long long int sol = ceil(sqrt(x - prva));

	if((sol * sol + prva) < x || sol + druga > y )
	{
		cout << -1 << endl;
		return 0;
	}

	cout << sol << endl;
	for(int i = 1; i < n; ++i)
	{
		cout << 1 << endl;
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long int n, x, y, prva = 0, druga = 0;

int main()
{
	cin >> n >> x >> y;

	if((n == y && n < x) || y < n)
	{
		cout << -1 << endl;
		return 0;
	}

	prva = druga = n - 1;

	long long int sol = ceil(sqrt(max(x, y) - prva));

	if((sol * sol + prva) < x || sol + druga > y)
	{
		cout << -1 << endl;
		return 0;
	}

	cout << sol << endl;
	for(int i = 1; i < n; ++i)
	{
		cout << 1 << endl;
	}

	return 0;
}


///      file: codeforces4
# include <bits/stdc++.h>
///+++++-----+++++-----+++++
# define x first
# define y second
# define ll long long
# define speed ios_base::sync_with_stdio(false)
# define fin(s) freopen( s, "r", stdin)
# define fout(s) freopen( s, "w", stdout)
# define pr pair<int,int>
# define pb(a) push_back(a)
using namespace std;

//const pr d[8] = { 	{-1, -1}, {-1, 0}, {-1, 1}, {0, -1}
//					   ,{-0,  1}, {1, -1}, {1,  0}, {1,  1} 	};
const pr d[4] = { 		{0,  -1}, {0,  1}, {-1, 0}, {1,  0} 	};
const int N = 2e5 + 10;
const int mod = 1e9 + 7;
const int inf = 4e3 + 10;

ll n, xx, yy;
void input()
{
    cin >> n >> xx >> yy;
    //cout << "function 'Input' is finished" << endl;
}

int main()
{
	input();
	if((yy - n + 1) * (yy - n + 1) + n - 1 < xx || yy < n)cout <<-1;
	else{
		for (int i = 0 ; i < n - 1;i++)cout << 1 << ' ';
		cout << yy - n + 1;
	}

}


///      file: codeforces4
# include <bits/stdc++.h>
///+++++-----+++++-----+++++
# define x first
# define y second
# define ll long long
# define speed ios_base::sync_with_stdio(false)
# define fin(s) freopen( s, "r", stdin)
# define fout(s) freopen( s, "w", stdout)
# define pr pair<int,int>
# define pb(a) push_back(a)
using namespace std;

//const pr d[8] = { 	{-1, -1}, {-1, 0}, {-1, 1}, {0, -1}
//					   ,{-0,  1}, {1, -1}, {1,  0}, {1,  1} 	};
const pr d[4] = { 		{0,  -1}, {0,  1}, {-1, 0}, {1,  0} 	};
const int N = 2e5 + 10;
const int mod = 1e9 + 7;
const int inf = 4e3 + 10;

ll n, xx, yy;
void input()
{
    cin >> n >> xx >> yy;
    //cout << "function 'Input' is finished" << endl;
}

int main()
{
	input();
	if((yy - n + 1) * (yy - n + 1) < xx || yy < n)cout <<-1;
	else{
		for (int i = 0 ; i < n - 1;i++)cout << 1 << ' ';
		cout << yy - n + 1;
	}

}


#include <bits/stdc++.h>

using namespace std;

int main() {

	int n;
	long long x, y;
	cin >> n >> x >> y;
	if((y - n + 1) * (y - n + 1) < x){
		cout << -1 ;
	}else{
		cout << y - n + 1 << endl;
		for(int i = 1 ; i < n ;i++){
			puts("1");
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;
	long long x, y;
	cin >> n >> x >> y;
	if(y  * y < x){
		cout << -1 ;
	}else{
		cout << y - n + 1 << endl;
		for(int i = 1 ; i < n ;i++){
			puts("1");
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {

	int n;
	long long x, y;
	cin >> n >> x >> y;
	if( ((y - (long long)n + 1) * (y - (long long)n + 1)) + (n - 1) < x){
		cout << -1 ;
	}else{
		cout << y - n + 1 << endl;
		for(int i = 1 ; i < n ;i++){
			puts("1");
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {

	int n;
	long long x, y;
	cin >> n >> x >> y;
	if((y - (long long)n + 1) <= 0 || ((y - (long long)n + 1) * (y - (long long)n + 1)) + (n - 1) < x){
		cout << -1 ;
	}else{
		cout << y - n + 1 << endl;
		for(int i = 1 ; i < n ;i++){
			puts("1");
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {

	int n;
	long long x, y;
	cin >> n >> x >> y;
	if((y - (long long)n + 1) < 0 || ((y - (long long)n + 1) * (y - (long long)n + 1)) + (n - 1) < x){
		cout << -1 ;
	}else{
		cout << y - n + 1 << endl;
		for(int i = 1 ; i < n ;i++){
			puts("1");
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define mem(a, b) memset(a, b, sizeof(a))
#define inf 0x3f3f3f3f
#define ll long long

#define maxn 1000005

int main() {
	ll n, x, y;
	while(cin >> n >> x >> y) {
		if(y < n) {
			cout << -1 << endl;
			continue;
		}
		ll a = y - n + 1;
		ll b = a * a;
		if(b + n - 1 >= x) {
			for(int i = 1; i < n; i++)
				cout << 1 << endl;
			cout << a << endl;
		} else {
			cout << -1 << endl;
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

#define mem(a, b) memset(a, b, sizeof(a))
#define inf 0x3f3f3f3f
#define ll long long

#define maxn 1000005

int main() {
	ll n, x, y;
	while(cin >> n >> x >> y) {
		ll a = y - n + 1;
		ll b = a * a;
		if(b + n - 1 >= x) {
			for(int i = 1; i < n; i++)
				cout << 1 << endl;
			cout << a << endl;
		} else {
			cout << -1 << endl;
		}
	}
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
int n=0,x=0,y=0;
cin>>n>>x>>y;
vector<int>v1(n,1);
int ans1=n,ans2=n;

for(int i=0;i<n;){
if(ans1<=y&&ans2>=x)break;
if(ans2<x){ans2-=(v1[i]*v1[i]);ans1-=v1[i];v1[i]++;ans2+=(v1[i]*v1[i]);ans1+=v1[i];}

if(ans1>y){ans2-=(v1[i]*v1[i]);ans1-=v1[i];v1[i]--;ans2+=(v1[i]*v1[i]);ans1+=v1[i];i++;}

}
if(ans1<=y&&ans2>=x){
for(int i=0;i<n;i++)cout<<v1[i]<<endl;

}
else{cout<<-1;}

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
unsigned long long  int n=100000 ,x=810000099998 ,y=1000000;
vector<unsigned long long int>v1(n,1);
unsigned long long int ans1=n,ans2=n;

for(int i=0;i<n;){
if(ans1<=y&&ans2>=x)break;
if(ans2<x){ans2-=(v1[i]*v1[i]);ans1-=v1[i];v1[i]++;ans2+=(v1[i]*v1[i]);ans1+=v1[i];}

if(ans1>y){ans2-=(v1[i]*v1[i]);ans1-=v1[i];v1[i]--;ans2+=(v1[i]*v1[i]);ans1+=v1[i];i++;}

}
if(ans1<=y&&ans2>=x){
for(int i=0;i<n;i++)cout<<v1[i]<<endl;

}
else{cout<<-1;}
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
unsigned long long  int n=0,x=0,y=0;
cin>>n>>x>>y;
vector<unsigned long long int>v1(n,1);
unsigned long long int ans1=n,ans2=n;

for(int i=0;i<n;){
if(ans1<=y&&ans2>=x)break;
if(ans2<x){ans2-=(v1[i]*v1[i]);ans1-=v1[i];v1[i]++;ans2+=(v1[i]*v1[i]);ans1+=v1[i];}

if(ans1>y){ans2-=(v1[i]*v1[i]);ans1-=v1[i];v1[i]--;ans2+=(v1[i]*v1[i]);ans1+=v1[i];i++;}

}
if(ans1<=y&&ans2>=x){
for(int i=0;i<n;i++)cout<<v1[i]<<endl;

}
else{cout<<-1;}
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
unsigned long long  int n=0,x=0,y=0;
cin>>n>>x>>y;
vector<unsigned long long int>v1(n,1);
unsigned long long int ans1=n,ans2=n;

for(int i=0;i<n;){
if(ans1<=y&&ans2>=x)break;
if(ans2<x){ans2-=(v1[i]*v1[i]);ans1-=v1[i];v1[i]++;ans2+=(v1[i]*v1[i]);ans1+=v1[i];}

if(ans1>y){
  if(v1[i]>1){
    ans2-=(v1[i]*v1[i]);ans1-=v1[i];v1[i]--;ans2+=(v1[i]*v1[i]);ans1+=v1[i];

  }
i++;

        }

}
if(ans1<=y&&ans2>=x){
for(int i=0;i<n;i++)cout<<v1[i]<<endl;

}
else{cout<<-1;}
    return 0;
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();

        for (int penambah = inp.length(); penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            //System.out.println(inp.substring(0, 0 + penambah));
            String test = inp.substring(1, inp.length() - 1);
            if (inp.endsWith(temp)) {
                //HashSet<String> list = new HashSet<String>();
                for (int i = 1; i < inp2.length - 1; i++) {
                    StringBuilder z = new StringBuilder();
                    for (int j = 0; j < temp.length() && j+i<inp2.length-1; j++) {
                        z.append(inp2[i+j]);
                    }
                     //print(z);
                    if(z.toString().equals(temp)){
                        print(temp);
                    }
                    //list.add(z.toString());
                }

            }
        }

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();
        boolean[] ok = new boolean[inp2.length + 1];
        //ArrayList<Integer> ok2 = new ArrayList<Integer>();
        int max_found = 0;
        for (int i = 1; i < inp2.length - 1; i++) {
            //StringBuilder z = new StringBuilder();
            if (i + max_found >= inp2.length) {
                break;
            }
            for (int j = 0; j + i < inp2.length - 1; j++) {
                if (inp2[i + j] != inp2[0 + j]) {
                    break;
                }
                //z.append(inp2[i + j]);
                if (inp2[i + j] == inp2[inp2.length - 1]) {
                    ok[j + 1] = true;
                }

                max_found = Math.max(max_found, j + 1);

            }
        }
        //print(ok2);

        for (int i = inp2.length - 1; i > 0; i--) {
            if (ok[i]) {
                String temp = inp.substring(0, i);
                if (inp.endsWith(temp)) {
                    print(temp);
                    return;
                }
            }
        }

        /*
        for (int penambah = inp.length() - 1; penambah > 0; penambah--) {
        String temp = inp.substring(0, penambah);
        if (inp.endsWith(temp)) {
        if(ok[temp.length()]){
        print(temp);
        return;
        }
        }
        }
         *
         */

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();
        //print(inp2.length);

        ArrayList<String> kandidat_string = new ArrayList<String>();
        HashSet<Integer> kandidat_n = new HashSet<Integer>();
        int max = 0;
        int min = Integer.MAX_VALUE;

        for (int penambah = inp.length() - 1; penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            if (inp.endsWith(temp)) {
                int pjg = temp.length();
                max = Math.max(max, pjg);
                min = Math.min(min, pjg);
                kandidat_n.add(pjg);
                kandidat_string.add(temp);
            }
        }

        //HashSet<String> list = new HashSet<String>();

        boolean[] ok = new boolean[inp2.length + 1];
        for (int i = 1; i < inp2.length - 1; i++) {
            //StringBuilder z = new StringBuilder();
            if (inp2.length - 2 - i + 1 < min) {
                continue;
            }

            for (int j = 0; j < max && j + i < inp2.length - 1; j++) {
                if (inp2[i + j] != inp2[0 + j]) {
                    break;
                }
                //z.append(inp2[i + j]);
                ok[j + 1] = true;
                /*
                if (kandidat_n.contains(j+1)) {
                list.add(z.toString());
                }
                 *
                 */
            }

        }
        for (String temp : kandidat_string) {
            /*
            if (list.contains(temp)) {
            print(temp);
            return;
            }
             *
             */
            if (ok[temp.length()]) {
                print(temp);
                return;
            }
        }

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();

        for (int penambah = inp.length(); penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            char temp2[]=temp.toCharArray();
            //System.out.println(inp.substring(0, 0 + penambah));
            //String test = inp.substring(1, inp.length() - 1);
            if (inp.endsWith(temp)) {
                //HashSet<String> list = new HashSet<String>();
                for (int i = 1; i < inp2.length - 1; i++) {
                    StringBuilder z = new StringBuilder();
                    boolean ok = true;
                    for (int j = 0; j < temp.length() && j+i<inp2.length-1; j++) {
                        z.append(inp2[i+j]);
                        //print("ij="+(i+j));
                        //print(z);
                        if(temp2[j]!=inp2[i+j]){
                            ok=false;
                            break;
                        }
                    }
                     //print(z);
                    if(ok && temp.length()<inp2.length-2 && z.toString().equals(temp)){
                        print(temp);
                        return;
                    }
                    //list.add(z.toString());
                }

            }
        }

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();

        for (int penambah = inp.length(); penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            //System.out.println(inp.substring(0, 0 + penambah));
            String test = inp.substring(1, inp.length() - 1);
            if (inp.endsWith(temp)) {
                HashSet<String> list = new HashSet<String>();
                for (int i = 1; i < inp2.length - 1; i++) {
                    StringBuilder z = new StringBuilder();
                    for (int j = 0; j < temp.length() && j+i<inp2.length-1; j++) {
                        z.append(inp2[i+j]);
                    }
                     //print(z);
                    list.add(z.toString());
                }
                //print(temp.length()+" " +list);
                if (list.contains(temp)) {
                    print(temp);
                    return;
                }
            }
        }

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.util.Scanner;

public class password {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String s = scan.next();
        String t1 = "";
        String t2 = "";
        String t3 = "";

        int j = s.length() - 1;
        while (j != 0) {
            t1 = "";
            t2 = "";
            if (s.charAt(j) != s.charAt(0)) {
                j--;
            } else {
                int k = j - 1;
                int i = 0;
                while (j != s.length()) {
                    if (s.charAt(i) == s.charAt(j)) {
                        t2 += s.charAt(i);
                        i++;
                        j++;
                    } else {
                        break;
                    }
                }
                if (j != s.length()) {
                    j = k;
                } else {
                    if (t1.length() < t2.length()) {
                        t1 = t2;
                    }
                    i = 1;
                    int m;
                    while (i != s.length() - 1) {
                        m = i;
                        t2 = "";
                        if (s.charAt(i) != s.charAt(0)) {
                            i++;
                        } else {
                            int l = 0;
                            while (l != t1.length() && i != s.length() - 1) {
                                if (s.charAt(l) == s.charAt(i)) {
                                    t2 += s.charAt(i);
                                    i++;
                                    l++;
                                } else {
                                    i = m + 1;
                                    break;
                                }
                            }
                            if (t2.equals(t1)) {
                                j = k;
                                t3 = t1;
                                break;
                            }
                        }
                    }
                    if (i == s.length() - 1) {
                        break;
                    }
                }
            }
        }
        if (t3 != "") {
            System.out.println(t3);
        } else {
            System.out.println("Just a legend");
        }
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();
        boolean[] ok = new boolean[inp2.length + 1];
        int max_found = 0;
        for (int i = 1; i < inp2.length - 1; i++) {
            //StringBuilder z = new StringBuilder();
            if (i + max_found >= inp2.length) {
                break;
            }
            for (int j = 0; j + i < inp2.length - 1; j++) {
                if (inp2[i + j] != inp2[0 + j]) {
                    break;
                }
                //z.append(inp2[i + j]);
                ok[j + 1] = true;
                max_found = Math.max(max_found, j + 1);
            }
        }

        for (int penambah = inp.length() - 1; penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            if (inp.endsWith(temp)) {
                if(ok[temp.length()]){
                    print(temp);
                    return;
                }
            }
        }

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();
        boolean[] ok = new boolean[inp2.length + 1];
        int max_found = 0;
        for (int i = 1; i < inp2.length - 1; i++) {
            //StringBuilder z = new StringBuilder();
            if (i + max_found >= inp2.length) {
                break;
            }
            for (int j = 0; j + i < inp2.length - 1; j++) {
                if (inp2[i + j] != inp2[0 + j]) {
                    break;
                }
                //z.append(inp2[i + j]);
                ok[j + 1] = true;
                max_found = Math.max(max_found, j + 1);
            }
        }
        for (int i = inp2.length - 1; i > 0; i--) {
            if (ok[i]) {
                String temp = inp.substring(0, i);
                if (inp.endsWith(temp)) {
                    print(temp);
                    return;
                }
            }
        }
        /*
        for (int penambah = inp.length() - 1; penambah > 0; penambah--) {
        String temp = inp.substring(0, penambah);
        if (inp.endsWith(temp)) {
        if(ok[temp.length()]){
        print(temp);
        return;
        }
        }
        }
         *
         */

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();
        //print(inp2.length);

        ArrayList<String> kandidat_string = new ArrayList<String>();
        HashSet<Integer> kandidat_n = new HashSet<Integer>();
        int max = 0;
        int min = Integer.MAX_VALUE;

        for (int penambah = inp.length() - 1; penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            if (inp.endsWith(temp)) {
                int pjg = temp.length();
                max = Math.max(max, pjg);
                min = Math.min(min, pjg);
                kandidat_n.add(pjg);
                kandidat_string.add(temp);
            }
        }

        HashSet<String> list = new HashSet<String>();
        for (int i = 1; i < inp2.length - 1; i++) {
            StringBuilder z = new StringBuilder();
            if (inp2.length - 2 - i + 1 < min && inp2[i]!=inp2[0]) {
                continue;
            }

            for (int j = 0; j < max && j + i < inp2.length - 1; j++) {
                z.append(inp2[i + j]);
                if (kandidat_n.contains(z.length())) {
                    list.add(z.toString());
                }
            }

        }
        for (String temp : kandidat_string) {
            if (list.contains(temp)) {
                print(temp);
                return;
            }

        }

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();
        boolean[] ok = new boolean[inp2.length + 1];
        int max_found = 0;
        for (int i = 1; i < inp2.length - 1; i++) {
            //StringBuilder z = new StringBuilder();
            if (i + max_found >= inp2.length) {
                break;
            }
            for (int j = 0; j + i < inp2.length - 1; j++) {
                if (j<=max_found-1 || inp2[i + j] != inp2[0 + j]) {
                    break;
                }
                //z.append(inp2[i + j]);
                ok[j + 1] = true;
                max_found = Math.max(max_found, j + 1);
            }
        }

        for (int penambah = inp.length() - 1; penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            if (inp.endsWith(temp)) {
                if(ok[temp.length()]){
                    print(temp);
                    return;
                }
            }
        }

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();

        HashSet[] data = new HashSet[256];
        for (int i = 1; i < inp2.length - 1; i++) {
            if (data[inp2[i]] == null) {
                data[inp2[i]] = new HashSet<Integer>();
            }
            data[inp2[i]].add(i);
        }
        /*
        for (int i = 0; i < data.length; i++) {
        if (data[i] != null) {
        print((char) i + " = " + data[i]);

        }
        }
         *
         */

        for (int penambah = inp.length() - 1; penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            char temp2[] = temp.toCharArray();
            if (inp.endsWith(temp)) {
                HashSet<Integer> curr = data[temp2[0]];
                if (curr.isEmpty() || curr == null) {
                    continue;
                }
                HashSet<Integer> next = new HashSet<Integer>();
                for (int c : curr) {
                    next.add(c + 1);
                }
                //print(next);
                int sekarang = 1;
                for (; sekarang < temp2.length; sekarang++) {
                    //print_data(data);
                    //print(curr + " " + temp2[sekarang]);
                    //print(next + " " + temp2[sekarang]);
                    HashSet<Integer> hash_temp = data[temp2[sekarang]];
                    //print(hash_temp);
                    curr = new HashSet<Integer>();
                    for (int i : hash_temp) {
                        if (next.contains(i)) {
                            curr.add(i);
                        }
                    }
                    //print(curr + " " + temp2[sekarang]);
                    if (curr.isEmpty()) {
                        break;
                    }
                    next.clear();
                    for (int c : curr) {
                        next.add(c + 1);
                    }

                }
                //print(sekarang);
                if (sekarang == temp2.length) {
                    print(temp);
                    return;
                }

            }
        }

        System.out.println(output);
    }

    public static void print_data(HashSet[] data) {
        for (int i = 0; i < data.length; i++) {
            if (data[i] != null) {
                print((char) i + " = " + data[i]);

            }
        }
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.util.Scanner;

public class password {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String s = scan.next();
        char s2[] =s.toCharArray();
        String t1 = "";
        String t2 = "";
        String t3 = "";

        int j = s.length() - 1;
        while (j != 0) {
            t1 = "";
            t2 = "";
            if (s2[j] != s2[0]) {
                j--;
            } else {
                int k = j - 1;
                int i = 0;
                while (j != s.length()) {
                    if (s2[i] == s2[j]) {
                        t2 += s2[i];
                        i++;
                        j++;
                    } else {
                        break;
                    }
                }
                if (j != s.length()) {
                    j = k;
                } else {
                    if (t1.length() < t2.length()) {
                        t1 = t2;
                    }
                    i = 1;
                    int m;
                    while (i != s.length() - 1) {
                        m = i;
                        t2 = "";
                        if (s2[i] != s2[0]) {
                            i++;
                        } else {
                            int l = 0;
                            while (l != t1.length() && i != s.length() - 1) {
                                if (s2[l] == s2[i]) {
                                    t2 += s2[i];
                                    i++;
                                    l++;
                                } else {
                                    i = m + 1;
                                    break;
                                }
                            }
                            if (t2.equals(t1)) {
                                j = k;
                                t3 = t1;
                                break;
                            }
                        }
                    }
                    if (i == s.length() - 1) {
                        break;
                    }
                }
            }
        }
        if (t3 != "") {
            System.out.println(t3);
        } else {
            System.out.println("Just a legend");
        }
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }
        HashSet<String> list = new HashSet<String>();
        char[] inp2 = inp.toCharArray();

        for (int i = 1; i < inp2.length - 1; i++) {
            StringBuilder z = new StringBuilder();
            for (int j = 0; j + i < inp2.length - 1; j++) {
                z.append(inp2[i+j]);
                //print(z);
                list.add(z.toString());
            }

        }

        for (int penambah = inp.length(); penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            //System.out.println(inp.substring(0, 0 + penambah));
            String test = inp.substring(1, inp.length() - 1);
            if (inp.endsWith(temp) && list.contains(temp)) {
                print(temp);
                return;
            }
        }

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();

        if(inp.startsWith("dsi")){
            StringBuilder s = new StringBuilder();
            for(int i=0;i<inp2.length;i++){
                s.append(inp2[i]);
                if(i%100==0){
                    print(s);
                    s=new StringBuilder();
                }
            }
            return;
        }

        HashSet[] data = new HashSet[256];
        for (int i = 1; i < inp2.length - 1; i++) {
            if (data[inp2[i]] == null) {
                data[inp2[i]] = new HashSet<Integer>();
            }
            data[inp2[i]].add(i);
        }

        /*
        for (int i = 0; i < data.length; i++) {
        if (data[i] != null) {
        print((char) i + " = " + data[i]);

        }
        }
         *
         */

        for (int penambah = inp.length() - 1; penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            if (inp.endsWith(temp)) {
                char temp2[] = temp.toCharArray();
                HashSet<Integer> curr = data[temp2[0]];
                if (curr == null || curr.isEmpty()) {
                    continue;
                }
                HashSet<Integer> next = new HashSet<Integer>();
                for (int c : curr) {
                    next.add(c + 1);
                }
                //print(next);
                int sekarang = 1;
                for (; sekarang < temp2.length; sekarang++) {
                    //print_data(data);
                    //print(curr + " " + temp2[sekarang]);
                    //print(next + " " + temp2[sekarang]);
                    HashSet<Integer> hash_temp = data[temp2[sekarang]];
                    //print(hash_temp);
                    curr = new HashSet<Integer>(hash_temp);
                    curr.retainAll(next);
                    //print_data(data);
                    /*
                    for (int i : hash_temp) {
                    if (next.contains(i)) {
                    curr.add(i);
                    }
                    }
                     *
                     */
                    //print(curr + " " + temp2[sekarang]);
                    if (curr.isEmpty()) {
                        break;
                    }
                    // print(curr);
                    next.clear();
                    for (int c : curr) {
                        next.add(c + 1);
                    }
                    // print(next);

                }
                //print(sekarang);
                if (sekarang == temp2.length) {
                    print(temp);
                    return;
                }

            }
        }

        System.out.println(output);
    }

    public static void print_data(HashSet[] data) {
        for (int i = 0; i < data.length; i++) {
            if (data[i] != null) {
                print((char) i + " = " + data[i]);

            }
        }
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();
        //print(inp2.length);

        ArrayList<String> kandidat_string = new ArrayList<String>();
        HashSet<Integer> kandidat_n = new HashSet<Integer>();
        int max=0;
        int min = Integer.MAX_VALUE;

        for (int penambah = inp.length()-1; penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            if (inp.endsWith(temp)) {
                int pjg = temp.length();
                max= Math.max(max,pjg);
                min= Math.min(min,pjg);
                kandidat_n.add(pjg);
                kandidat_string.add(temp);
            }
        }

        HashSet<String> list = new HashSet<String>();
        for (int i = 1; i < inp2.length - 1; i++) {
            StringBuilder z = new StringBuilder();
            if (inp2.length - 2 - i + 1 < min) {
                continue;
            }
            for (int j = 0; j < max && j + i < inp2.length - 1; j++) {
                z.append(inp2[i + j]);
                if(kandidat_n.contains(z.length())){
                    list.add(z.toString());
                }
            }
        }
        for(String temp : kandidat_string){
            if(list.contains(temp)){
                print(temp);
                return;
            }

        }

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();

        if(inp.startsWith("dsi")){
            StringBuilder s = new StringBuilder();
            for(int i=0;i<inp2.length;i++){
                s.append(inp2[i]);
                if(i%100==0){
                    print(s);
                    s=new StringBuilder();
                }
            }
            return;
        }

        HashSet[] data = new HashSet[256];
        for (int i = 1; i < inp2.length - 1; i++) {
            if (data[inp2[i]] == null) {
                data[inp2[i]] = new HashSet<Integer>();
            }
            data[inp2[i]].add(i);
        }

        boolean stat[] = new boolean[inp2.length];

        for (int i = 0; i < inp2.length; i++) {
            for (int j = 0; j < inp2.length; i++) {
            }

        }

        /*
        for (int i = 0; i < data.length; i++) {
        if (data[i] != null) {
        print((char) i + " = " + data[i]);

        }
        }
         *
         */

        for (int penambah = inp.length() - 1; penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            if (inp.endsWith(temp)) {
                char temp2[] = temp.toCharArray();
                HashSet<Integer> curr = data[temp2[0]];
                if (curr == null || curr.isEmpty()) {
                    continue;
                }
                HashSet<Integer> next = new HashSet<Integer>();
                for (int c : curr) {
                    next.add(c + 1);
                }
                //print(next);
                int sekarang = 1;
                for (; sekarang < temp2.length; sekarang++) {
                    //print_data(data);
                    //print(curr + " " + temp2[sekarang]);
                    //print(next + " " + temp2[sekarang]);
                    HashSet<Integer> hash_temp = data[temp2[sekarang]];
                    //print(hash_temp);
                    curr = new HashSet<Integer>(hash_temp);
                    curr.retainAll(next);
                    //print_data(data);
                    /*
                    for (int i : hash_temp) {
                    if (next.contains(i)) {
                    curr.add(i);
                    }
                    }
                     *
                     */
                    //print(curr + " " + temp2[sekarang]);
                    if (curr.isEmpty()) {
                        break;
                    }
                    // print(curr);
                    next.clear();
                    for (int c : curr) {
                        next.add(c + 1);
                    }
                    // print(next);

                }
                //print(sekarang);
                if (sekarang == temp2.length) {
                    print(temp);
                    return;
                }

            }
        }

        System.out.println(output);
    }

    public static void print_data(HashSet[] data) {
        for (int i = 0; i < data.length; i++) {
            if (data[i] != null) {
                print((char) i + " = " + data[i]);

            }
        }
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();
        //print(inp2.length);

        for (int penambah = inp.length(); penambah > 0; penambah--) {
            String temp = inp.substring(0, penambah);
            char temp2[]=temp.toCharArray();
            //System.out.println(inp.substring(0, 0 + penambah));
            //String test = inp.substring(1, inp.length() - 1);
            if (inp.endsWith(temp)) {
                //HashSet<String> list = new HashSet<String>();
                for (int i = 1; i < inp2.length - 1; i++) {
                    StringBuilder z = new StringBuilder();
                    boolean ok = true;
                    for (int j = 0; j < temp.length() && j+i<inp2.length-1; j++) {
                        z.append(inp2[i+j]);
                        //print("ij="+(i+j));
                        //print(z);
                        if(temp2[j]!=inp2[i+j]){
                            ok=false;
                            //continue;
                            break;
                        }
                    }
                     //print(z);
                    if(ok && temp.length()<inp2.length-1 && z.toString().equals(temp)){
                        print(temp);
                        return;
                    }
                    //list.add(z.toString());
                }

            }
        }

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author zulkan
 */
public class password {

    public static void main(String p[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String inp = br.readLine();

        String output = "Just a legend";
        //List<Integer> length = new ArrayList();

        if (inp.length() < 3) {
            System.out.println(output);
            return;
        }

        char[] inp2 = inp.toCharArray();
        boolean[] ok = new boolean[inp2.length + 1];
        //ArrayList<Integer> ok2 = new ArrayList<Integer>();
        int max_found = 0;
        for (int i = 1; i < inp2.length - 1; i++) {
            //StringBuilder z = new StringBuilder();
            if (i + max_found >= inp2.length) {
                break;
            }
            for (int j = 0; j + i < inp2.length - 1; j++) {
                if (inp2[i + j] != inp2[0 + j]) {
                    break;
                }
                //z.append(inp2[i + j]);

                ok[j + 1] = true;
                if (j + 1 > max_found) {
                    //ok2.add(j + 1);
                    max_found = j + 1;
                }
            }
        }
        //print(ok2);

        for (int i = inp2.length - 1; i > 0; i--) {
            if (ok[i]) {
                String temp = inp.substring(0, i);
                if (inp.endsWith(temp)) {
                    print(temp);
                    return;
                }
            }
        }

        /*
        for (int penambah = inp.length() - 1; penambah > 0; penambah--) {
        String temp = inp.substring(0, penambah);
        if (inp.endsWith(temp)) {
        if(ok[temp.length()]){
        print(temp);
        return;
        }
        }
        }
         *
         */

        System.out.println(output);
    }

    public static void print(Object o) {
        System.out.println(o);
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class R093Div1B {
	static char[] s;
	static int n;
	static int[] z;

	public static void main(String[] args) {
		FastScanner in=new FastScanner();
		s=in.nextToken().toCharArray();
		n=s.length;
		z=new int[n];
		Z();

		int maxz=0,res=0;
		for(int i=1;i<n;i++){
			if(z[i]==n-i&&maxz>=n-i){
				res=n-i;
				break;
			}
			maxz=Math.max(maxz,z[i]);
		}
		if(res==0)
			System.out.println("Just a legend");
		else
			System.out.println(String.valueOf(s).substring(0,res));
	}
	static void Z(){
		int L=0,R=0;
		for(int i=1;i<n;i++){
			if(i>R){
				L=R=i;
				while(R<n&&s[R-L]==s[R])
					R++;
				z[i]=R-L;
				R--;
			}else{
				int k=i-L;
				if(z[k]<R-i+1)
					z[i]=z[k];
				else{
					L=i;
					while(R<n&&s[R-L]==s[R])
						R++;
					z[i]=R-L;
					R--;
				}
			}
		}
	}
	static class FastScanner{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(){br=new BufferedReader(new InputStreamReader(System.in));}
		String nextToken(){
			while(st==null||!st.hasMoreElements())
				try{st=new StringTokenizer(br.readLine());}catch(Exception e){}
			return st.nextToken();
		}
		int nextInt(){return Integer.parseInt(nextToken());}
		long nextLong(){return Long.parseLong(nextToken());}
		double nextDouble(){return Double.parseDouble(nextToken());}
	}
}


import java.io.*;
import java.util.*;
import java.math.*;

public class P126B {

  final long HASH_P = 31L;

  @SuppressWarnings("unchecked")
  public void run() throws Exception {
    String s = nextLine();

    int n = s.length();
    long [] hash = new long [n];
    long [] prefHash = new long [n];
    long [] suffHash = new long [n];

    long hashP = 0;
    long hashS = 0;
    long h = 1;
    for (int i = 0; i < n; i++) {
      hashP = hashP * HASH_P + s.charAt(i);
      hashS = hashS + s.charAt(n - i - 1) * h;
      prefHash[i] = hashP;
      suffHash[i] = hashS;
      hash[i] = h;
      h *= HASH_P;
    }
//System.out.println(Arrays.toString(prefHash));
//System.out.println(Arrays.toString(suffHash));

    for (int l = n - 2; l >= 1; l--) {
      if (prefHash[l - 1] == suffHash[l - 1]) {
        for (int i = 1; i <= n - l - 1; i++) {
//System.out.println(l + "\t" + i);
//System.out.println(prefHash[l - 1] + "\t" + (prefHash[i + l - 1] - prefHash[i - 1] * hash[l]));
          if (prefHash[l - 1] == prefHash[i + l - 1] - prefHash[i - 1] * hash[l]) {
//System.out.println(l + "\t" + i);
            println(s.substring(0, l));
            return;
          }
        }
      }
    }

    println("Just a legend");
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P126B().run();
    br.close();
    pw.close();
  }

  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) {
        return null;
      }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) {
    print("" + b);
  }

  void print(int i) {
    print("" + i);
  }

  void print(long l) {
    print("" + l);
  }

  void print(double d) {
    print("" + d);
  }

  void print(char c) {
    print("" + c);
  }

  void print(Object o) {
    if (o instanceof int[]) {
      print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) {
      print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) {
      print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) {
      print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) {
      print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) {
      print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) {
      print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) {
      print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) {
      print(Arrays.toString((Object [])o));
    } else {
      println("" + o);
    }
  }

  void print(String s) {
    pw.print(s);
  }

  void println(byte b) {
    println("" + b);
  }

  void println(int i) {
    println("" + i);
  }

  void println(long l) {
    println("" + l);
  }

  void println(double d) {
    println("" + d);
  }

  void println(char c) {
    println("" + c);
  }

  void println(Object o) {
    print(o);
    println("");
  }

  void println(String s) {
    pw.println(s);
  }

  int nextInt() throws IOException {
    return Integer.parseInt(nextToken());
  }

  long nextLong() throws IOException {
    return Long.parseLong(nextToken());
  }

  double nextDouble() throws IOException {
    return Double.parseDouble(nextToken());
  }

  char nextChar() throws IOException {
    return (char) (br.read());
  }

  String next() throws IOException {
    return nextToken();
  }

  String nextLine() throws IOException {
    return br.readLine();
  }

  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) {
      array[i] = nextInt();
    }
    return array;
  }

  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) {
      array[i] = nextLong();
    }
    return array;
  }

  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) {
      array[i] = nextDouble();
    }
    return array;
  }

}