#include <set>
#include <map>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <cctype>
#include <cstdio>
#include <iomanip>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <complex>
#include <numeric>
#include <valarray>
#include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;

#define inf 1061109567
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define mem(x,a) memset(x,a,sizeof(x))
#define rep(i,n) for(int i(0),_n(n);i<_n;++i)
#define repi(i,a,b) for(int i(a),_b(b);i<_b;++i)
#define repe(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define len(x) ((int)(x.size()))

#define DEBUG 1
#if DEBUG && !ONLINE_JUDGE
	#define debug(args...) (Debugger()) , args
	class Debugger { public: Debugger(const std::string& _separator = ", ") : first(true), separator(_separator){} template<typename ObjectType> Debugger& operator , (const ObjectType& v) { if(!first) std::cerr << separator; std::cerr << v; first = false; return *this; } ~Debugger() { std::cerr << endl;} private: bool first; std::string separator; }; template <typename T1, typename T2> inline std::ostream& operator << (std::ostream& os, const std::pair<T1, T2>& p) { return os << "(" << p.first << ", " << p.second << ")"; } template<typename T> inline std::ostream &operator << (std::ostream & os,const std::vector<T>& v) { bool first = true; os << "["; for(unsigned int i = 0; i < v.size(); i++) { if(!first) os << ", "; os << v[i]; first = false; } return os << "]"; } template<typename T> inline std::ostream &operator << (std::ostream & os,const std::set<T>& v) { bool first = true; os << "["; for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii) { if(!first) os << ", "; os << *ii; first = false; } return os << "]"; } template<typename T1, typename T2> inline std::ostream &operator << (std::ostream & os,const std::map<T1, T2>& v) { bool first = true; os << "["; for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii) { if(!first) os << ", "; os << *ii ; first = false; } return os << "]"; }
#else
		#define debug(args...)
#endif

ll n,m;

vi v;
ll t1,t2,pos,val;

int main(){
	ios_base::sync_with_stdio(0);

	cin>>n>>m;
	rep(i,n){
		cin>>t1;
		v.pb(t1);
	}

	rep(i,n)v.pb(v[i]);

	m--;

	t2=n+m;

	val=inf;

	for (int i = t2; i > m ; i--)
	{
		if(v[i]<val){
			val=v[i];
			pos=i;
		}
	}

	pos%=n;
	//cout<<pos<<endl;

	if(pos==m){

		v[pos]=n*val;
		rep(i,n)if(i!=pos)v[i]-=val;

	}

	else if(pos<m){

		v[pos]=val*n;

		rep(i,n)if(i!=pos)v[i]-=val;

		repi(i,pos+1,m+1){
			v[i]-=1;
			assert(v[i]>=0);
			v[pos]++;
		}
	}
	else {

		v[pos]=val*n;

		rep(i,n)if(i!=pos)v[i]-=val;

		repi(i,pos+1,n){
			v[i]-=1;
			assert(v[i]>=0);
			v[pos]++;
		}
		rep(i,m+1){
			v[i]-=1;
			assert(v[i]>=0);
			v[pos]++;
		}

	}

	rep(i,n)cout<<v[i]<<" ";

}

//~ 10 3
//~ 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000


// in the name of god
#include <iostream>
using namespace std;

int main(){
	int n,x;
	cin>>n>>x;
	int A[100005];
	int min[2];
	int index1 = 0;
	for (int i=0;i<n;i++){
		cin>>A[i];
		if (i==0){
			min[0]=i;min[1]=A[i];
		}
		if(A[i]<=min[1]){
			if (i<=x-1)
				index1 = i;
			min[0]=i;min[1]=A[i];
		}
	}
	if (A[index1]<=min[1])
		min[0]=index1;
	//cout<<min[0]<<endl;
	if (n==1)
		cout<<A[0];
	/*else if (min[0]==x-1){
		for (int i=0;i<n;i++){
			if (i==x-1)
				cout<<(n-1)*min[1];
			else
				cout<<A[i]-min[1];
			cout<<" ";
		}
	}*/
	else if (min[0] <= x-1 )
		for (int i=0;i<n;i++){
			if (i<min[0])
				cout<<A[i]-min[1];
			else if(i==min[0])
				cout<<(x-1-i)*(min[1]+1)+(n-x+i+1)*min[1];
			else if( i>min[0] && i<=x-1)
				cout <<A[i]-min[1]-1;
			else
				cout<<A[i]-min[1];
			cout<<" ";
		}
	else if (min[0]>x-1)
		for (int i=0;i<n;i++){
			if (i>min[0])
				cout<<A[i]-min[1]-1;
			else if(i==min[0])
				cout<<(min[0]-x+1)*(min[1])+(n-min[0]+x-1)*(min[1]+1);
			else if(i<=x-1)
				cout <<A[i]-min[1]-1;
			else if(i>x-1 && i<min[0])
				cout<<A[i]-min[1];
			cout<<" ";
		}
	return 0;
}


// in the name of god
#include <iostream>
using namespace std;

int main(){
	int n,x;
	cin>>n>>x;
	int A[100005];
	int min[2];
	int index1 = 0;
	for (int i=0;i<n;i++){
		cin>>A[i];
		if (i==0){
			min[0]=i;min[1]=A[i];
		}
		if(A[i]<=min[1]){
			if (i<=x-1)
				index1 = i;
			min[0]=i;min[1]=A[i];
		}
	}
	if (A[index1]<=min[1])
		min[0]=index1;
	if (min[0] < x-1 )
		for (int i=0;i<n;i++){
			if (i<min[0])
				cout<<A[i]-min[1];
			else if(i==min[0])
				cout<<(x-1-i)*(min[1]+1)+(n-x+i)*min[1]+1;
			else if( i>min[0] && i<=x-1)
				cout <<A[i]-min[1]-1;
			else
				cout<<A[i]-min[1];
			cout<<" ";
		}
	else if (min[0]>x-1)
		for (int i=0;i<n;i++){
			if (i>min[0])
				cout<<A[i]-min[1]-1;
			else if(i==min[0])
				cout<<(min[0]-x+1)*(min[1])+(n-min[0]+x-1)*(min[1]+1);
			else if(i<=x-1)
				cout <<A[i]-min[1]-1;
			else if(i>x-1 && i<min[0])
				cout<<A[i]-min[1];
			cout<<" ";
		}
	return 0;
}


// in the name of god
#include <iostream>
using namespace std;

int main(){
	int n,x;
	cin>>n>>x;
	int A[100005];
	int min[2];
	int index1 = 0;
	for (int i=0;i<n;i++){
		cin>>A[i];
		if (i==0){
			min[0]=i;min[1]=A[i];
		}
		if(A[i]<=min[1]){
			if (i<=x-1)
				index1 = i;
			min[0]=i;min[1]=A[i];
		}
	}
	if (A[index1]<=min[1])
		min[0]=index1;
	if (min[0] <= x-1 )
		for (int i=0;i<n;i++){
			if (i<min[0])
				cout<<A[i]-min[1];
			else if(i==min[0])
				cout<<(x-1-i)*(min[1]+1)+(n-x+i)*min[1]+1;
			else if( i>min[0] && i<=x-1)
				cout <<A[i]-min[1]-1;
			else
				cout<<A[i]-min[1];
			cout<<" ";
		}
	else if (min[0]>x-1)
		for (int i=0;i<n;i++){
			if (i>min[0])
				cout<<A[i]-min[1]-1;
			else if(i==min[0])
				cout<<(min[0]-x+1)*(min[1])+(n-min[0]+x-1)*(min[1]+1);
			else if(i<=x-1)
				cout <<A[i]-min[1]-1;
			else if(i>x-1 && i<min[0])
				cout<<A[i]-min[1];
			cout<<" ";
		}
	return 0;
}


// in the name of god
#include <iostream>
using namespace std;

int main(){
	int n,x;
	cin>>n>>x;
	int A[100005];
	int min[2];
	int index1 = 0;
	for (int i=0;i<n;i++){
		cin>>A[i];
		if (i==0){
			min[0]=i;min[1]=A[i];
		}
		if(A[i]<=min[1]){
			if (i<=x-1)
				index1 = i;
			min[0]=i;min[1]=A[i];
		}
	}
	if (A[index1]<=min[1])
		min[0]=index1;
	cout<<min[0]<<endl;
	if (n==1)
		cout<<A[0];
	else if (min[0]==x-1){
		for (int i=0;i<n;i++){
			if (i==x-1)
				cout<<(n-1)*min[1];
			else
				cout<<A[i]-min[1];
			cout<<" ";
		}
	}
	else if (min[0] < x-1 )
		for (int i=0;i<n;i++){
			if (i<min[0])
				cout<<A[i]-min[1];
			else if(i==min[0])
				cout<<(x-1-i)*(min[1]+1)+(n-x+i+1)*min[1];
			else if( i>min[0] && i<=x-1)
				cout <<A[i]-min[1]-1;
			else
				cout<<A[i]-min[1];
			cout<<" ";
		}
	else if (min[0]>x-1)
		for (int i=0;i<n;i++){
			if (i>min[0])
				cout<<A[i]-min[1]-1;
			else if(i==min[0])
				cout<<(min[0]-x+1)*(min[1])+(n-min[0]+x-1)*(min[1]+1);
			else if(i<=x-1)
				cout <<A[i]-min[1]-1;
			else if(i>x-1 && i<min[0])
				cout<<A[i]-min[1];
			cout<<" ";
		}
	return 0;
}


// in the name of god
#include <iostream>
using namespace std;

int main(){
	int n,x;
	cin>>n>>x;
	int A[100005];
	int min[2];
	int index1 = 0;
	for (int i=0;i<n;i++){
		cin>>A[i];
		if (i==0){
			min[0]=i;min[1]=A[i];
		}
		if(A[i]<=min[1]){
			if (i<=x-1)
				index1 = i;
			min[0]=i;min[1]=A[i];
		}
	}
	if (A[index1]<=min[1])
		min[0]=index1;
	cout<<min[0]<<endl;
	if (n==1)
		cout<<A[0];
	/*else if (min[0]==x-1){
		for (int i=0;i<n;i++){
			if (i==x-1)
				cout<<(n-1)*min[1];
			else
				cout<<A[i]-min[1];
			cout<<" ";
		}
	}*/
	else if (min[0] <= x-1 )
		for (int i=0;i<n;i++){
			if (i<min[0])
				cout<<A[i]-min[1];
			else if(i==min[0])
				cout<<(x-1-i)*(min[1]+1)+(n-x+i+1)*min[1];
			else if( i>min[0] && i<=x-1)
				cout <<A[i]-min[1]-1;
			else
				cout<<A[i]-min[1];
			cout<<" ";
		}
	else if (min[0]>x-1)
		for (int i=0;i<n;i++){
			if (i>min[0])
				cout<<A[i]-min[1]-1;
			else if(i==min[0])
				cout<<(min[0]-x+1)*(min[1])+(n-min[0]+x-1)*(min[1]+1);
			else if(i<=x-1)
				cout <<A[i]-min[1]-1;
			else if(i>x-1 && i<min[0])
				cout<<A[i]-min[1];
			cout<<" ";
		}
	return 0;
}


// in the name of god
#include <iostream>
using namespace std;

int main(){
	long long n,x;
	cin>>n>>x;
	long long A[100005];
	long long min[2];
	long long index1 = 0;
	for (long long i=0;i<n;i++){
		cin>>A[i];
		if (i==0){
			min[0]=i;min[1]=A[i];
		}
		if(A[i]<=min[1]){
			if (i<=x-1)
				index1 = i;
			min[0]=i;min[1]=A[i];
		}
	}
	if (A[index1]<=min[1])
		min[0]=index1;
	//cout<<min[0]<<endl;
	if (n==1)
		cout<<A[0];
	/*else if (min[0]==x-1){
		for (int i=0;i<n;i++){
			if (i==x-1)
				cout<<(n-1)*min[1];
			else
				cout<<A[i]-min[1];
			cout<<" ";
		}
	}*/
	else if (min[0] <= x-1 )
		for (long long i=0;i<n;i++){
			if (i<min[0])
				cout<<A[i]-min[1];
			else if(i==min[0])
				cout<<(x-1-i)*(min[1]+1)+(n-x+i+1)*min[1];
			else if( i>min[0] && i<=x-1)
				cout <<A[i]-min[1]-1;
			else
				cout<<A[i]-min[1];
			cout<<" ";
		}
	else if (min[0]>x-1)
		for (long long i=0;i<n;i++){
			if (i>min[0])
				cout<<A[i]-min[1]-1;
			else if(i==min[0])
				cout<<(min[0]-x+1)*(min[1])+(n-min[0]+x-1)*(min[1]+1);
			else if(i<=x-1)
				cout <<A[i]-min[1]-1;
			else if(i>x-1 && i<min[0])
				cout<<A[i]-min[1];
			cout<<" ";
		}
	return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
    int n,x; cin>>n>>x;
    long long a[100005];
    long long m=1000000009;
    for (int i=1;i<=n;i++) {cin>>a[i]; m=min(m,a[i]);}
    for (int i=1;i<=n;i++) a[i]-=m;
    long long s=1LL*n*m;
    while (a[x]){a[x]--;
        x--;s++;
        if (x==0) x=n;
    }
    a[x]=s;
    for (int i=1;i<=n;i++) {cout<<a[i]<<" ";}puts("");
    return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int INF = 1000000007;

long long a[100005],tmp=INF,low=INF;
long long l[100005],r[100005];

int main(){
    int n,x,t;
    scanf("%d%d",&n,&x); x--;
    for(int i=0;i<n;i++){
        scanf("%I64d",a+i);
        low=min(low,a[i]);
    }
    l[0]=r[n-1]=INF;
    for(int i=1;i<n;i++) l[i]=min(l[i-1],a[i-1]);
    for(int i=n-1;i;i--) r[i-1]=min(r[i],a[i]);
    for(t=x;;t=(t+n-1)%n){
        if(a[t]<=low && a[t]+1<=tmp) break;
        tmp=min(tmp,a[t]);
    }
    long long cnt=a[t];
    for(int i=0;i<n;i++) a[i]-=cnt;
    if(x!=t) for(int i=(t+1)%n;i!=x;i=(i+1)%n) a[i]--,a[t]++;
    if(x!=t) a[x]--,a[t]++;
    a[t]+=cnt*n;
    for(int i=0;i<n;i++) printf("%I64d ",a[i]);
}


// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#define dibs reserve
#define OVER9000 1234567890
#define tisic 47
#define soclose 10e-7
// mylittlepony
using namespace std;

int main() {
	int N,x;
	scanf(" %d %d",&N,&x);
	vector<int> v(N);
	for(int i =0; i < N; i++) {
		int j =i-x;
		if(j < 0) j +=N;
		scanf(" %d",&v[j]);}

	vector<int> A(N);
	A[0] =v[0];
	for(int i =0; i < N-1; i++) A[i+1] =min(A[i],v[i+1]);
	vector<int> B(N+1,OVER9000);
	B[N-1] =v[N-1];
	for(int i =N-1; i > 0; i--) B[i-1] =min(B[i],v[i-1]);

	for(int i =0; i < N; i++) {
		// the first box
		// v[i] turns
		// all boxes: -v[i], boxes v[i+1]..v[N-1]: -v[i]-1
		// min(v[0..i])=v[i], min(v[i+1..N-1])>= v[i]+1
		if(A[i] >= v[i] && B[i+1] >= v[i]+1) {
			// print
			long long orig =(long long)N*(long long)v[i]+(N-1-i);
			for(int j =N-x; j < N; j++) {
				if(j > N-x) printf(" ");
				int y =v[j]-v[i];
				if(j > i) y--;
				if(j == i) printf("%I64d",orig);
				else printf("%d",y);}
			for(int j =0; j < N-x; j++) {
				printf(" ");
				int y =v[j]-v[i];
				if(j > i) y--;
				if(j == i) printf("%I64d",orig);
				else printf("%d",y);}
			printf("\n");
			return 0;}}
	return 0;}

// look at my code
// my code is amazing


#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <utility>
#include <cassert>
#include <numeric>
#include <sstream>
using namespace std;

#define REQUIRE(cond, message) \
    do { \
        if (!(cond)) { \
            std::cerr << message << std::endl; \
            assert(false); \
        } \
    } while (false)

#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define forv(i, v) forn(i, (v).size())
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef long double ld;

const int INF = std::numeric_limits<int>::max();
const char* IN_FILE = ".in";
const char* OUT_FILE = ".out";
void restore(const vector<ll>& a, int i, int x, vector<ll>* result)
{
    *result = a;
    forv(j, *result) result->at(j) -= a[i];
    int j = i;
    while (j != x) {
        ++j;
        if (j >= a.size()) j -= a.size();
        --result->at(j);
        ++result->at(i);
    }
    result->at(i) += a[i] * a.size();
}
void solve()
{
    int n, x; cin >> n >> x; --x;
    vector<ll> a(n); forn(i, n) cin >> a[i];
    int i = x;
    ll min_to_x = std::numeric_limits<ll>::max();
    ll mine = *min_element(all(a));
    vector<ll> ans(n);
    do {
        if (i < 0) i += n;
        int r = (x - i + n) % n;
        ll aa = a[i] * n + r;
        if (aa > 0 && mine >= a[i] && min_to_x >= a[i] + 1) {
            restore(a, i, x, &ans);
            break;
        }
        min_to_x = min(min_to_x, a[i]);
    } while (--i != x);
    forv(i, ans) {
        if (i) cout << " ";
        cout << ans[i];
    }
    cout << endl;
}

void init()
{
    freopen(IN_FILE, "rt", stdin);
    freopen(OUT_FILE, "wt", stdout);
}

int main()
{
    ios_base::sync_with_stdio(false);
//    init();
    solve();
    return 0;
}


#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

#define all(x) x.begin(), x.end()
#define f(i,a,b) for(int i = (a); i <= (b); i++)
#define fd(i,a,b) for(int i = (a); i >= (b); i--)
#define iter(it,x) for(auto it = (x).begin(); it != (x).end(); it++)
#define mii map<int,int>
#define msi map<string,int>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define vc vector<char>
#define vi vector<int>
#define vii vector<pair<int,int>>
#define vll vector<ll>
#define vs vector<string>

const int INF = 2000000005;
const ll INFLL = 1000000000000000009;
const ll MOD = 1000000007;

// --------------------------------------------------------------------------

ll N, L, B[100005];

int main()
{
    cin >> N >> L;

    f(i,1,N) cin >> B[i];
    ll mb = INFLL;
    f(i,1,N) mb = min(mb,B[i]);
    f(i,1,N) B[i] -= mb;
    ll p = -1;
    fd(i,L,1) if(B[i] == 0) {p = i; break;}
    if(p < 0) fd(i,N,L) if(B[i] == 0) {p = i; break;}
    if(p <= L) f(i,p+1,L) B[i]--, B[p]++;
    else
    {
        f(i,p+1,N) B[i]--, B[p]++;
        f(i,1,L) B[i]--, B[p]++;
    }
    B[p] += mb * N;
    f(i,1,N) cout << B[i] << " ";
}


#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

#define all(x) x.begin(), x.end()
#define f(i,a,b) for(int i = (a); i <= (b); i++)
#define fd(i,a,b) for(int i = (a); i >= (b); i--)
#define iter(it,x) for(auto it = (x).begin(); it != (x).end(); it++)
#define mii map<int,int>
#define msi map<string,int>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define vc vector<char>
#define vi vector<int>
#define vii vector<pair<int,int>>
#define vll vector<ll>
#define vs vector<string>

const int INF = 2000000005;
const ll INFLL = 1000000000000000009;
const ll MOD = 1000000007;

// --------------------------------------------------------------------------

int N, L, B[100005];

int main()
{
    cin >> N >> L;

    f(i,1,N) cin >> B[i];
    int mb = INF;
    f(i,1,N) mb = min(mb,B[i]);
    f(i,1,N) B[i] -= mb;
    int p = -1;
    fd(i,L,1) if(B[i] == 0) {p = i; break;}
    if(p < 0) fd(i,N,L) if(B[i] == 0) {p = i; break;}
    if(p <= L) f(i,p+1,L) B[i]--, B[p]++;
    else
    {
        f(i,p+1,N) B[i]--, B[p]++;
        f(i,1,L) B[i]--, B[p]++;
    }
    B[p] += mb * N;
    f(i,1,N) cout << B[i] << " ";
}


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

long long box[100005];

int main() {
    int n, ind;
    scanf("%d %d", &n, &ind);
    --ind;

    for (int i = 0; i < n; ++i)
        cin >> box[i];

    long long mini = *min_element(box, box + n);
    long long sbox = mini * n;

    while (box[ind] != mini) {
        ++sbox;
        --box[ind];
        ind = (ind - 1 + n) % n;
    }

    for (int i = 0; i < n; ++i)
        box[i] -= mini;
    box[ind] = sbox;

    for (int i = 0; i < n; ++i)
        cout << box[i] << ' ';cout << endl;
    return 0;
}


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

int main() {
    int n , final;
    cin >> n >> final;
    vector<int> V(n);
    for(auto &x : V)
        cin >> x;

    int mini = *min_element(V.begin() , V.end());

    for(auto &x : V)
        x -= mini;

    long long res = (long long)mini * n;

    int ind = final - 1;
    while(V[ind]) {
        --V[ind];
        --ind;
        if(ind < 0)ind = n - 1;
        ++res;
    }
    V[ind] = res;

    for(auto &x : V)
        cout << x << ' ';
    cout << endl;
    return 0;
}


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

int main() {
    int n , final;
    cin >> n >> final;
    vector<int> V(n);
    for(auto &x : V)
        cin >> x;

    long long res = 0;

    bool done = 0;
    for(int i = final - 1 ; i >= 0 ; --i) {
        if(!V[i]){
            V[i] = res;
            done = 1;
            break;
        }
        --V[i];
        ++res;
    }

    int mini = *min_element(V.begin() , V.end());
    for(auto &x : V)
        x -= mini;

    res += (long long)mini * n;

    for(int i = n - 1 ; !done ; --i) {
        if(!V[i]) {
            V[i] = res;
            break;
        }
        --V[i];
        ++res;
    }

    for(auto &x : V)
        cout << x << ' ';
    cout << endl;
    return 0;
}


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

int main() {
    int n , final;
    cin >> n >> final;
    vector<int> V(n);
    for(auto &x : V)
        cin >> x;

    long long res = 0;

    bool done = 0;
    for(int i = final - 1 ; i >= 0 ; --i) {
        if(!V[i]){
            V[i] = res;
            done = 1;
            break;
        }
        --V[i];
        ++res;
    }

    int mini = *min_element(V.begin() , V.end());
    if(!done)for(auto &x : V)
        x -= mini;

    if(!done)res += (long long)mini * n;

    for(int i = n - 1 ; !done ; --i) {
        if(!V[i]) {
            V[i] = res;
            break;
        }
        --V[i];
        ++res;
    }

    for(auto &x : V)
        cout << x << ' ';
    cout << endl;
    return 0;
}


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

int main() {
    int n , final;
    cin >> n >> final;
    vector<int> V(n);
    for(auto &x : V)
        cin >> x;

    int mini = *min_element(V.begin() , V.end());

    int arr[100007] = {};
    for(int i = 0 ; i < n ; ++i) {
        arr[i + 1] = arr[i] + (V[i] == mini);
    }

    int ansInd;
    for(int i = 0 ; i < n ; ++i) {
        if(i < final && V[i] == mini && !(arr[final] - arr[i + 1])) {
            ansInd = i;
            break;
        }
        if(i >= final && V[i] == mini && !(arr[n] - arr[i + 1]) && !(arr[final] - arr[1])) {
            ansInd = i;
            break;
        }
    }

    cout << ansInd << endl;
    long long sum = final + n - ansInd - 1;

    for(int i = 0 ; i < final ; ++i)
        --V[i];
    for(int i = ansInd + 1 ; i < n ; ++i)
        --V[i];

    mini = *min_element(V.begin() , V.end());
    sum += (long long)mini * n;

    for(auto &x : V)
        x -= mini;

    for(int i = 0 ; i < n ; ++i)
        if(i == ansInd)
            cout << sum << ' ';
        else
            cout << V[i] << ' ';
    cout << endl;
    return 0;
}


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

int main() {
    int n , final;
    cin >> n >> final;
    vector<long long> V(n);
    for(auto &x : V)
        cin >> x;

    int mini = *min_element(V.begin() , V.end());
    if(mini != 0)for(auto &x : V)
        x -= mini - 1;

    int ind = final - 1;

    long long res = 0;
    if(mini != 0)res = (long long)(mini - 1) * n;

    while(1) {
        if(!V[ind]){
            V[ind] = res;
            break;
        }
        --V[ind];
        --ind;
        if(ind < 0)ind = n - 1;
        ++res;
    }

    for(auto &x : V)
        cout << x << ' ';
    cout << endl;
    return 0;
}


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

int main() {
    int n , final;
    cin >> n >> final;
    vector<int> V(n);
    for(auto &x : V)
        cin >> x;

    long long res = 0;

    for(int i = final - 1 ; i >= 0 ; --i) {
        --V[i];
        ++res;
    }

    int mini = *min_element(V.begin() , V.end());
    for(auto &x : V)
        x -= mini;

    res += (long long)mini * n;

    for(int i = n - 1 ;  ; --i) {
        if(!V[i]) {
            V[i] = res;
            break;
        }
        --V[i];
        ++res;
    }

    for(auto &x : V)
        cout << x << ' ';
    cout << endl;
    return 0;
}


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

int main() {
    int n , final;
    cin >> n >> final;
    vector<int> V(n);
    for(auto &x : V)
        cin >> x;

    long long res = 0;

    bool done = 0;
    for(int i = final - 1 ; i >= 0 ; --i) {
        if(!V[i]){
            V[i] = res;
            done = 1;
            break;
        }
        --V[i];
        ++res;
    }

    int mini = *min_element(V.begin() , V.end());
    if(!done)for(auto &x : V)
        x -= mini;

    res += (long long)mini * n;

    for(int i = n - 1 ; !done ; --i) {
        if(!V[i]) {
            V[i] = res;
            break;
        }
        --V[i];
        ++res;
    }

    for(auto &x : V)
        cout << x << ' ';
    cout << endl;
    return 0;
}


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

int main() {
    int n , final;
    cin >> n >> final;
    vector<int> V(n);
    for(auto &x : V)
        cin >> x;

    int mini = *min_element(V.begin() , V.end());
    if(mini != 0)for(auto &x : V)
        x -= mini - 1;

    int ind = final - 1;

    long long res = 0;
    if(mini != 0)res = (long long)(mini - 1) * n;

    while(1) {
        if(!V[ind]){
            V[ind] = res;
            break;
        }
        --V[ind];
        --ind;
        if(ind < 0)ind = n - 1;
        ++res;
    }

    for(auto &x : V)
        cout << x << ' ';
    cout << endl;
    return 0;
}


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

int main() {
    int n , final;
    cin >> n >> final;
    vector<int> V(n);
    for(auto &x : V)
        cin >> x;

    int mini = *min_element(V.begin() , V.end());

    int arr[100007] = {};
    for(int i = 0 ; i < n ; ++i) {
        arr[i + 1] = arr[i] + (V[i] == mini);
    }

    int ansInd;
    for(int i = 0 ; i < n ; ++i) {
        if(i < final && V[i] == mini && !(arr[final] - arr[i + 1])) {
            ansInd = i;
            break;
        }
        if(i >= final && V[i] == mini && !(arr[n] - arr[i + 1]) && !(arr[final] - arr[1])) {
            ansInd = i;
            break;
        }
    }

    long long sum = final + n - ansInd - 1;

    for(int i = 0 ; i < final ; ++i)
        --V[i];
    for(int i = ansInd + 1 ; i < n ; ++i)
        --V[i];

    mini = *min_element(V.begin() , V.end());
    sum += (long long)mini * n;

    for(auto &x : V)
        x -= mini;

    for(int i = 0 ; i < n ; ++i)
        if(i == ansInd)
            cout << sum << ' ';
        else
            cout << V[i] << ' ';
    cout << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;
//{{{Commonly used macro
//-----------------------By cylixstar-----------------------//
#define REP(i, n) for (int n_##__LINE__= (n), i = 0; i < n_##__LINE__; ++i)
#define FOR(i, f, t) for (__typeof__(f) f_##__LINE__=(f), t_##__LINE__=(t), i = f_##__LINE__; i <= t_##__LINE__; ++i)
#define TR(c, it) for (__typeof__((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALL(c) (c).begin(), (c).end()
#define SZ(a) ((int)(a).size())
#define CLR(a, v) do { memset(a, v, sizeof(a)); } while(0)
#define DBG(a) do { std::cout << "[" << __FUNCTION__ << "]" << #a << ": " << a << endl; } while(0)

template<typename T>
inline void checkMax(T& a, const T& b) {
  if (a < b) a = b;
}

template<typename T>
inline void checkMin(T& a, const T& b) {
  if (a > b) a = b;
}

//}}}

typedef long long int64;
const int kMaxN = 100000;
const int kInf = 2000000000;
int a[kMaxN];
int min_val[4  * kMaxN];
int n, x;

int query(int x, int y) {
  int ans = kInf;
  for (int L = x + 2 * n, R = y + 1 + 2 * n;
      L < R; L = (L - 1)>>1, R = (R - 1)>>1) {
    if (!(L & 1)) checkMin(ans, min_val[L++]);
    if (!(R & 1)) checkMin(ans, min_val[--R]);
  }
  return ans;
}
int main() {
  scanf("%d%d", &n,&x);
  --x;
  REP (i, n) {
    scanf("%d", a + i);
    min_val[2 * n + i]
      = min_val[3 * n + i] = a[i];
  }
  for (int i = 2 * n - 1; i >= 0 ; --i) {
    int ls = i * 2 + 1, rs = i * 2 + 2;
    min_val[i] = min(min_val[ls], min_val[rs]);
  }
  int pos = -1, r;
  int64 org;
  REP (i, n) {
    r = (x + n - i) % n;
    org = a[i] * (int64)n + r;
    if (query(i + 1, i + r) >= a[i] + 1
        && query(i + n - (n - r), i + n) >= a[i]) {
      pos = i;
      break;
    }
  }

  int rr;
  REP (i, n) {
    rr = (i + n - pos) % n;
    if (rr > 0 && rr <= r) cout<<a[i] - a[pos] - 1<<' ';
    else if (rr == 0) cout<<org<<' ';
    else cout<<a[i] - a[pos]<<' ';
  }
  puts("");
  return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;
//{{{Commonly used macro
//-----------------------By cylixstar-----------------------//
#define REP(i, n) for (int n_##__LINE__= (n), i = 0; i < n_##__LINE__; ++i)
#define FOR(i, f, t) for (__typeof__(f) f_##__LINE__=(f), t_##__LINE__=(t), i = f_##__LINE__; i <= t_##__LINE__; ++i)
#define TR(c, it) for (__typeof__((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALL(c) (c).begin(), (c).end()
#define SZ(a) ((int)(a).size())
#define CLR(a, v) do { memset(a, v, sizeof(a)); } while(0)
#define DBG(a) do { std::cout << "[" << __FUNCTION__ << "]" << #a << ": " << a << endl; } while(0)

template<typename T>
inline void checkMax(T& a, const T& b) {
  if (a < b) a = b;
}

template<typename T>
inline void checkMin(T& a, const T& b) {
  if (a > b) a = b;
}

//}}}

typedef long long int64;
const int kMaxN = 100000;
const int kInf = 2000000000;
int a[kMaxN + kMaxN];
int n, x;
int main() {
  scanf("%d%d", &n,&x);
  --x;
  REP (i, n) {
    scanf("%d", a + i);
    a[n + i] = a[i];
  }
  int pos = x, r, t;
  int64 org;
  for (int i = x + n; i > x; --i) {
    if (a[pos] > a[i]) pos = i % n;
  }
  r = (x + n - pos) % n;
  org = a[pos] * (int64)n + r;
  t = a[pos];
  REP (i, n) {
    if ((i + n - pos) % n > r) cout<<a[i] - t<<' ';
    else if (i == pos) cout<<org<<' ';
    else cout<<a[i] - t - 1<<' ';
  }
  puts("");
  return 0;
}


#include <iostream>

using namespace std;

const int LIM = 1e+5 + 100;
const int INF = 2e+9;

long long a[LIM];

int main(){
	long long m = INF;
	int n, x;
	cin >> n >> x;
	for ( int i = 0; i < n; i++ ){
		cin >> a[i];
		m = min(m, a[i]);
	}

	long long add = m * n;

	for ( int i = 0; i < n; i++ )
		a[i] -= m;

	for ( int i = 1; i <= n; i++ )
		if ( a[(x - i + n) % n] == 0 ){
			a[(x - i + n) % n] = add;
			break;
		}else{
			a[(x - i + n) % n]--;
			add++;
		}

	for ( int i = 0; i < n; i++ )
		cout << a[i] << ' ';

	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cassert>
#include <initializer_list>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#ifndef ONLINE_JUDGE
#define DEBUG
#endif

#define oo 0x3F3F3F3F
#ifdef DEBUG
#define cvar(x) cerr << "<" << #x << ": " << x << ">"
#define evar(x) cvar (x) << endl
template<class T> void DISP(const char *s, T x, int n) {cerr << "[" << s << ": "; for (int i = 0; i < n; ++i) cerr << x[i] << " "; cerr << "]" << endl;}
#define disp(x,n) DISP(#x " to " #n, x, n)
#else
#define cvar(...) ({})
#define evar(...) ({})
#define disp(...) ({})
#endif
#define fst first
#define snd second
#define PB push_back
#define SZ(x) (int)((x).size())
#define ALL(x) (x).begin(), (x).end()

typedef unsigned int uint;
typedef long long int64;
typedef unsigned long long uint64;
typedef long double real;

int64 pow(int64 b, int64 e, int64 m) { int64 t = 1; for (; e; e >>= 1, b = b * b % m) e & 1 ? t = t * b % m : 0; return t; }
template<class T> inline bool chkmin(T &a, T b) {return a > b ? a = b, true : false;}
template<class T> inline bool chkmax(T &a, T b) {return a < b ? a = b, true : false;}
template<class T> inline T sqr(T x) {return x * x;}
template <typename T> T gcd(T x, T y) {for (T t; x; t = x, x = y % x, y = t); return y; }

template<class edge> struct Graph
{
  vector<vector<edge> > adj;
  Graph(int n) {adj.clear (); adj.resize (n + 5);}
  Graph() {adj.clear (); }
  void resize(int n) {adj.resize (n + 5); }
  void add(int s, edge e){adj[s].push_back (e);}
  void del(int s, edge e) {adj[s].erase (find (iter (adj[s]), e)); }
  vector<edge>& operator [](int t) {return adj[t];}
};

const int maxn = 110000;

int64 v[maxn];

int main ()
{
#ifndef ONLINE_JUDGE
	freopen("C.in" , "r", stdin);
	freopen("C.out", "w", stdout);
#endif
	ios_base::sync_with_stdio (false);

	int n, x;

	cin >> n >> x;

	int64 y = oo;
	for (int i = 1; i <= n; ++i) {
		cin >> v[i];
		chkmin(y, v[i]);
	}
	for (int i = 1; i <= n; ++i)
		v[i] -= y;

	for (int i = x, j = 0; ; ) {

		if (v[i] == 0) {
			v[i] = y * n + j;
			break;
		}
		--v[i], ++j;

		if (i == 1)
			i = n;
		else
			--i;
	}

	for (int i = 1; i <= n; ++i)
		cout << v[i] << " ";
	return 0;
}


//#define PROB "test"    //{{{ Preamble
#define IN   PROB ".in"
#define OUT  PROB ".out"
#ifndef LOCAL_PC
#  define NDEBUG
#  define LOG(...) static_cast<void>(0)
#else
#  include <logging.hpp>
#endif
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#  include <forward_list>
#  include <unordered_map>
#  include <unordered_set>
#endif
#ifdef __GNUC__
#  include <ext/numeric>
using __gnu_cxx::power;
#endif
using namespace std;typedef long long ll;typedef unsigned long long ull;const
double pi=3.14159265358979323846;const double E=2.7182818284590452354;static
struct _{ios_base::Init i;_(){cin.sync_with_stdio(0);cin.tie(0);srand(time(0));
}}_;template<class T>inline T sq(const T&X){return X*X;}template<class I>inline
void in(I Y,int X){do cin>>*Y++;while(--X);}
#if defined(PROB) && !defined(LOCAL_PC)
static struct ${$(){cin.rdbuf(a.open(IN,ios::in));cout.rdbuf(b.open(OUT,ios::
out));}~$(){cin.rdbuf(0);cout.rdbuf(0);}filebuf a,b;}$;
#endif
#define endl         '\n'
#define pb(...)      push_back(__VA_ARGS__)
#define eb(...)      emplace_back(__VA_ARGS__)
#define sz(v)        static_cast<int>((v).size())
#define X            first
#define Y            second
#define FOREACH(i,c) for(__typeof__((c).begin())i=(c).begin();i!=(c).end();++i)
#define mp(x, y)     make_pair((x), (y))
#define ass(e)       assert(e)
//}}}

ll arr[100005];
ll lmin[100005];

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

    in(arr, n);

    int ans;

    ll gmin = *min_element(arr, arr+n);

    lmin[x] = arr[x];
    for (int i = x-1; i > x-n; i--)
    {
        int j = (i + n) % n;
        lmin[j] = min(arr[j], lmin[(j + 1 + n) % n]);
    }

    for (ans = 0; ans < n; ans++)
    {
        if (arr[ans] == gmin && (lmin[(ans+1) % n] > gmin || ans == x))
        {
            break;
        }
    }

    bool z = ans != x;
    for (int i = ans+1; i < ans+n; i++)
    {
        int j = (i + n) % n;

        arr[ans] += gmin;
        arr[j] -= gmin;

        if (z)
        {
            arr[ans]++;
            arr[j]--;
        }
        if (j == x)
            z = false;
    }

    cout << arr[0];
    for (int i = 1; i < n; i++)
        cout << " " << arr[i];
    cout << endl;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<string>
#define ll long long
using namespace std;
const int N=1e5+5,M=998244353;
int a[N][6];
int v[20]={0};
int main()
{
    int n;
    cin>>n;
    queue<int> S;
    ios::sync_with_stdio(false);
    for(int i=1;i<=n;i++)
    {
    	for(int j=1;j<=5;j++)
    		cin>>a[i][j];
    }
    if(n>11){
    	cout<<'0'<<endl;
    	return 0;
    }
    for(int i=1;i<=n;i++){//a
    	int flag=0;
    	for(int j=1;j<=n;j++){//b
    		for(int k=1;k<=n;k++)//c
    		{
    			int abc=0;
    			if(i==j)continue;
    			if(i==k)continue;
    			if(k==j)continue;
    			for(int h=1;h<=5;h++)
    			{
    				abc+=(a[k][h]-a[i][h])*(a[j][h]-a[i][h]);
    			}
    			//cout<<abc<<endl;
    			if(abc<=0.01){S.push(i);flag=1;break;}
    		}
    		if(flag)break;
    	}
    }
    cout<<S.size()<<endl;
    while(!S.empty()){
    	cout<<S.front()<<endl;
    	S.pop();
    }
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int a[100005][6];
int v[20];
int main()
{
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=5;j++)cin>>a[i][j];
	}
	if(n>11){
		cout<<'0'<<endl;
		return 0;
	}
	memset(v,0,sizeof(v));
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			for(int k=1;k<=n;k++)
			{
				int abc=0;
				if(i==j||i==k||k==j)continue;
				for(int h=1;h<=5;h++)
				{
					abc+=(a[j][h]-a[i][h])*(a[k][h]-a[i][h]);
					//cout<<abc<<endl;
				}
				if(abc>0){
					v[i]=1;
					break;
				}
			}
			if(v[i])break;
		}
	}
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		if(v[i]==0)ans++;
	}
	cout<<ans<<endl;
	for(int i=1;i<=n;i++)
	{
		if(v[i]==0)cout<<i<<endl;
	}
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<string>
#define ll long long
using namespace std;
const int N=1e5+5,M=998244353;
int a[N][6];
int v[20];
int main()
{
    int n;
    cin>>n;
    ios::sync_with_stdio(false);
    for(int i=1;i<=n;i++)
    {
    	for(int j=1;j<=5;j++)
    		cin>>a[i][j];
    }
    if(n>11){
    	cout<<'0'<<endl;
    	return 0;
    }
    n=min(n,11);
    int ans=0;
    for(int i=1;i<=n;i++)//a
    	for(int j=1;j<=n;j++)//b
    		for(int k=1;k<=n;k++)//c
    		{
    			int abc=0,ab=0,ac=0;
    			if(i==j||k==i||k==j)continue;
    			for(int h=1;h<=5;h++)
    			{
    				ab+=(a[j][h]-a[i][h])*(a[j][h]-a[i][h]);
    				ac+=(a[k][h]-a[i][h])*(a[k][h]-a[i][h]);
    				abc+=(a[k][h]-a[i][h])*(a[j][h]-a[i][h]);
    			}
    			double x=(double)abc/((double)sqrt((double)ab)*(double)sqrt((double)ac));
    			if(acos(x)<=3.1415926/2)v[i]=1;
    		}
    for(int i=1;i<=n;i++)
    {
    	if(!v[i])ans++;
    }
    cout<<ans<<endl;
    for(int i=1;i<=n;i++)
    {
    	if(!v[i])cout<<i<<endl;
    }
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<string>
#define ll long long
using namespace std;
const int N=1e5+5,M=998244353;
int a[N][6];
int v[20]={0};
int main()
{
    int n;
    cin>>n;
    stack<int> S;
    ios::sync_with_stdio(false);
    for(int i=1;i<=n;i++)
    {
    	for(int j=1;j<=5;j++)
    		cin>>a[i][j];
    }
    if(n>11){
    	cout<<'0'<<endl;
    	return 0;
    }
    for(int i=1;i<=n;i++){//a
    	int flag=0;
    	for(int j=1;j<=n;j++){//b
    		for(int k=1;k<=n;k++)//c
    		{
    			int abc=0;
    			if(i==j)continue;
    			if(i==k)continue;
    			if(k==j)continue;
    			for(int h=1;h<=5;h++)
    			{
    				abc+=(a[k][h]-a[i][h])*(a[j][h]-a[i][h]);
    			}
    			cout<<abc<<endl;
    			if(abc<=0){S.push(i);flag=1;break;}
    		}
    		if(flag)break;
    	}
    }
    cout<<S.size()<<endl;
    while(!S.empty()){
    	cout<<S.top()<<endl;
    	S.pop();
    }
}


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

int Calc(vector<int>& X, vector<int>& Y, vector<int>& Z) {
	return (X[0] - Y[0]) * (X[0] - Z[0]) +
		(X[1] - Y[1]) * (X[1] - Z[1]) +
		(X[2] - Y[2]) * (X[2] - Z[2]) +
		(X[3] - Y[3]) * (X[3] - Z[3]) +
		(X[4] - Y[4]) * (X[4] - Y[4]);
}

int main() {
	int N;
	cin >> N;
	vector<vector<int> > A(N, vector<int>(5));
	vector<int> ANS;
	for (int i = 0; i < N; i++) cin >> A[i][0] >> A[i][1] >> A[i][2] >> A[i][3] >> A[i][4];
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (i == j) continue;
			for (int k = j + 1; k < N; k++) {
				if (i == k) continue;
				if (Calc(A[i], A[j], A[k]) > 0) goto Next;
			}
		}
		ANS.push_back(i + 1);
	Next:;
	}
	cout << ANS.size() << endl;
	for (int i = 0; i < ANS.size(); i++) cout << ANS[i] << endl;
}


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

int Calc(vector<int>& X, vector<int>& Y, vector<int>& Z) {
	return (X[0] - Y[0]) * (X[0] - Z[0]) +
		(X[1] - Y[1]) * (X[1] - Z[1]) +
		(X[2] - Y[2]) * (X[2] - Z[2]) +
		(X[3] - Y[3]) * (X[3] - Z[3]) +
		(X[4] - Y[4]) * (X[4] - Z[4]);
}

int main() {
	int N;
	cin >> N;
	vector<vector<int> > A(N, vector<int>(5));
	vector<int> ANS;
	for (int i = 0; i < N; i++) cin >> A[i][0] >> A[i][1] >> A[i][2] >> A[i][3] >> A[i][4];
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (i == j) continue;
			for (int k = j + 1; k < N; k++) {
				if (i == k) continue;
				if (Calc(A[i], A[j], A[k]) > 0) goto Next;
			}
		}
		ANS.push_back(i + 1);
	Next:;
	}
	cout << ANS.size() << endl;
	for (int i = 0; i < ANS.size(); i++) cout << ANS[i] << endl;
}


#include <iostream>
#include <vector>
using namespace std;

int N, A[1009][5];

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 5; j++) cin >> A[i][j];
	}

	if (N > 243) {
		cout << "0" << endl;
		return 0;
	}

	vector<int>ans;
	for (int i = 0; i < N; i++) {
		bool flag = false;
		for (int j = 0; j < N; j++) {
			for (int k = j + 1; k < N; k++) {
				int L = 0;
				for (int l = 0; l < 5; l++) L += (A[j][l] - A[i][l]) * (A[k][l] - A[i][l]);
				if (L > 0) flag = true;
			}
		}
		if (flag == false) ans.push_back(i);
	}
	cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); i++) cout << ans[i] + 1 << endl;
	return 0;
}


#include <iostream>
#include <vector>
using namespace std;

int N, A[1009][5]; vector<int>P[32];

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 5; j++) cin >> A[i][j];
	}

	vector<int>ans;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 32; j++) P[j].clear();
		for (int j = 0; j < N; j++) {
			int sum = 0;
			for (int k = 0; k < 5; k++) { if (A[j][k] >= A[i][k]) sum += (1 << j); }
			P[sum].push_back(j);
		}
		vector<int>J; bool flag = false;
		for (int j = 0; j < 32; j++) {
			if (P[j].size() == 1) J.push_back(P[j][0]);
			if (P[j].size() >= 2) flag = true;
		}
		for (int j = 0; j < J.size(); j++) {
			for (int k = j + 1; k < J.size(); k++) {
				int L = 0;
				for (int l = 0; l < 5; l++) L += (A[J[j]][l] - A[i][l]) * (A[J[k]][l] - A[i][l]);
				if (L > 0) flag = true;
			}
		}
		if (flag == false) ans.push_back(i);
	}
	cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); i++) cout << ans[i] + 1 << endl;
	return 0;
}


#include <bits/stdc++.h>
#define owo(i,a, b) for(int i=(a); i<(b); ++i)
#define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i)
#define senpai push_back
#define ttgl pair<int, int>
#define ayaya cout<<"debug"<<endl

using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 998244353;
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
const double PI = acos(-1);
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxN = 1001;
array<int, 5> arr[mxN];
int n;
int main()
{
    //freopen("filename.in", "r", stdin);
    //freopen("filename.out", "w", stdout);
    mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
    cin.tie(0)->sync_with_stdio(0);
    cin>>n;
    if(n>=50) {
        cout<<"0\n";
    }
    owo(i, 0, n) {
        cin>>arr[i][0]>>arr[i][1]>>arr[i][2]>>arr[i][3]>>arr[i][4];
    }
    vector<int> ans;
    owo(i, 0, n) {
        int num = 0;
        owo(j, 0, n) {
            owo(k, 0, n) {
                if(i==j||j==k||i==k)continue;
                num = (arr[j][0]-arr[i][0])*(arr[k][0]-arr[i][0]) +
                      (arr[j][1]-arr[i][1])*(arr[k][1]-arr[i][1]) +
                      (arr[j][2]-arr[i][2])*(arr[k][2]-arr[i][2]) +
                      (arr[j][3]-arr[i][3])*(arr[k][3]-arr[i][3]) +
                      (arr[j][4]-arr[i][4])*(arr[k][4]-arr[i][4]);
            }
        }
        if(num<=0) ans.senpai(i);
    }
    cout<<ans.size()<<"\n";
    for(int j: ans) {
        cout<<(j+1)<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define owo(i,a, b) for(int i=(a); i<(b); ++i)
#define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i)
#define senpai push_back
#define ttgl pair<int, int>
#define ayaya cout<<"debug"<<endl

using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 998244353;
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
const double PI = acos(-1);
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxN = 1001;
array<int, 5> arr[mxN];
int n;
int main()
{
    //freopen("filename.in", "r", stdin);
    //freopen("filename.out", "w", stdout);
    mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
    cin.tie(0)->sync_with_stdio(0);
    cin>>n;
    if(n>=50) {
        cout<<"0\n";
        return 0;
    }
    owo(i, 0, n) {
        cin>>arr[i][0]>>arr[i][1]>>arr[i][2]>>arr[i][3]>>arr[i][4];
    }
    vector<int> ans;
    owo(i, 0, n) {
        int num = 0;
        owo(j, 0, n) {
            owo(k, 0, n) {
                if(i==j||j==k||i==k)continue;
                num = (arr[j][0]-arr[i][0])*(arr[k][0]-arr[i][0]) +
                      (arr[j][1]-arr[i][1])*(arr[k][1]-arr[i][1]) +
                      (arr[j][2]-arr[i][2])*(arr[k][2]-arr[i][2]) +
                      (arr[j][3]-arr[i][3])*(arr[k][3]-arr[i][3]) +
                      (arr[j][4]-arr[i][4])*(arr[k][4]-arr[i][4]);
            }
        }
        if(num<=0) ans.senpai(i);
    }
    cout<<ans.size()<<"\n";
    for(int j: ans) {
        cout<<(j+1)<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define owo(i,a, b) for(int i=(a); i<(b); ++i)
#define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i)
#define senpai push_back
#define ttgl pair<int, int>
#define ayaya cout<<"debug"<<endl

using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 998244353;
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
const double PI = acos(-1);
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxN = 1001;
array<int, 5> arr[mxN];
int n;
int main()
{
    //freopen("filename.in", "r", stdin);
    //freopen("filename.out", "w", stdout);
    mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
    cin.tie(0)->sync_with_stdio(0);
    cin>>n;
    if(n>=50) {
        cout<<"0\n";
        return 0;
    }
    owo(i, 0, n) {
        cin>>arr[i][0]>>arr[i][1]>>arr[i][2]>>arr[i][3]>>arr[i][4];
    }
    vector<int> ans;
    owo(i, 0, n) {
        bool ok = true;
        int num = 0;
        owo(j, 0, n) {
            owo(k, 0, n) {
                if(i==j||j==k||i==k)continue;
                num = (arr[j][0]-arr[i][0])*(arr[k][0]-arr[i][0]) +
                      (arr[j][1]-arr[i][1])*(arr[k][1]-arr[i][1]) +
                      (arr[j][2]-arr[i][2])*(arr[k][2]-arr[i][2]) +
                      (arr[j][3]-arr[i][3])*(arr[k][3]-arr[i][3]) +
                      (arr[j][4]-arr[i][4])*(arr[k][4]-arr[i][4]);
                if(num>0)ok = false;
            }
        }
        if(ok) ans.senpai(i);
    }
    cout<<ans.size()<<"\n";
    for(int j: ans) {
        cout<<(j+1)<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long double ld;
typedef long long ll;
const ld pi = acos(-1.0), eps = 1e-7;

template<class T>
struct point{
	vector<T>x;

	point(vector<T>coord = vector<T>(5, 0)){
		x.resize(5);
		for (int i = 0; i < 5; i ++) x[i] = coord[i];
	}
	T operator*(const point &p) const{
		T val = 0;
		for (int i = 0; i < 5; i ++) val += (x[i] * p.x[i]);
		return val;
	}
	point operator-(const point &p) const{
		vector<int>coords(5);
		for (int i = 0; i < 5; i ++) coords[i] = x[i] - p.x[i];
		return point(coords);
	}
	ld norm(){
		return sqrt((ld)(*this * *this));
	}

};

template<class T>
istream &operator>>(istream &in, point<T> &p)
{ return in >> p.x[0] >> p.x[1] >> p.x[2] >> p.x[3] >> p.x[4]; }

int main(){
    ios::sync_with_stdio(0);
    int n;
    cin >> n;
    if (n > 65){
    	cout << "0\n";
    	return 0;
    }
    vector<point<int> >points(n);
    for (int i = 0; i < n; i ++){
    	cin >> points[i];
    }
    vector<bool>is_good(n, true);
    for (int i = 0; i < n; i ++){
    	point<int> a = points[i];
    	for (int j = 0; j < n; j ++){
    		if (j != i){
    			point<int> b = points[j];
    			for (int k = 0; k < n; k ++){
    				if (k != i and k != j){
    					point<int> c = points[k];
    					point<int> A1 = b - a;
    					point<int> A2 = c - a;
    					int val = A1 * A2;
    					ld div = (ld)val / (ld)(A1.norm() * A2.norm());
    					ld angle = acos(div);
    					if (angle < pi / 2.0L){
    						is_good[i] = 0;
    					}
    				}
    			}
    		}
    	}
    }
    int cant = 0;
    for (int i = 0; i < n; i ++){
    	if (is_good[i]) cant ++;
    }
    cout << cant << "\n";
    for (int i = 0; i < n; i ++){
    	if (is_good[i]){
    		cout << i + 1 << "\n";
    	}
    }
	return 0;
}


/*
 *  Filename: GitGud/850A.cpp
 *  Timestamp: 16-10-2020 13:18:39
 *  Author: Fadhil Musaad
 */
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pair<int, int> > piii;
#define pb push_back
#define NeedForSpeed ios_base::sync_with_stdio(0), cin.tie(0)
#define PI acos(-1)
#define all(c) c.begin(), c.end()
#define SET(x, y) memset((x), y, sizeof(x))
const int MOD = 1e9 + 7;
const int INF = 1e9 + 5;
const ll INF64 = 1e18;

string to_string(const string &s) {
  return '"' + s + '"';
}

string to_string(bool b) {
  return b ? "true" : "false";
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename T>
string to_string(const vector<T> &v) {
  string ret = "<";
  for (auto it : v)
    ret += to_string(it) + ", ";
  ret.pop_back(); ret.pop_back();
  ret += ">";
  return ret;
}

void debug_print() { cerr << endl; }

template <typename T, typename ...U>
void debug_print(T t, U... u) {
  cerr << " " << to_string(t);
  debug_print(u...);
}

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_print(__VA_ARGS__)
const int N = 1e5 + 5;

double dot(const vector<double> &a, const vector<double>& b) {
  double ret = 0;
  for (int i = 0; i < 5; i++)
    ret += a[i] * b[i];
  return ret;
}

double scalar(const vector<double> &a) {
  return sqrt(dot(a, a));
}

double angle(const vector<double> &a, const vector<double> &b) {
  double d = dot(a, b);
  double sa = scalar(a);
  double sb = scalar(b);
  return acos(d / (sa * sb));
}

vector<double> sub(const vector<double> &a, const vector<double> &b) {
  vector<double> ret = a;
  for (int i = 0; i < 5; i++) {
    ret[i] -= b[i];
  }
  return ret;
}

vector<double> p[1005];
vector<int> ans;

const double EPS = 1e-9;

int main() {
  NeedForSpeed;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    p[i].resize(5);
    for (int j = 0; j < 5; j++)
      cin >> p[i][j];
  }
  for (int i = 0; i < n; i++) {
    bool valid = true;
    for (int j = 0; j < n && valid; j++) {
      if (j == i)
        continue;
      for (int k = j + 1; k < n && valid; k++) {
        if (k == i)
          continue;
        vector<double> ij = sub(p[j], p[i]);
        vector<double> ik = sub(p[k], p[i]);
        assert(angle(ij, ik) < 4);
        /* debug(angle(ij, ik) - (PI / 2.0)); */
        if (angle(ij, ik) - (PI / 2.0) < -EPS)
          valid = false;
      }
    }
    if (valid)
      ans.pb(i + 1);
  }
  cout << ans.size() << '\n';
  for (auto it : ans)
    cout << it << '\n';
  //If you dont need Flush Stream, dont use endl
  return 0;
}


/*input
3
0 0 1 2 0
0 0 9 2 0
0 0 5 9 0
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<long long, null_type, less_equal<long long>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
typedef long long int ll;
#define ld double
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
const ll maxn=1005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=4e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
ll mult(ll a,ll b){
    return ((a%MOD)*(b%MOD))%MOD;
}
ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=mult(res,a);
        a=mult(a,a);
        b>>=1;
    }
    return res;
}
int a[maxn][5];
int main(){
    int n;
    cin>>n;
    if(n>=100){
        cout<<0;
        return 0;
    }
    else{
        REP(i,n) REP(j,5) cin>>a[i][j];
        vector<int> ans;
        REP(i,n){
            bool failed=0;
            REP(j,n) if(i!=j)
                REP(k,j)if (k!=i)
                {
                    int sum = 0;
                    REP(l, 5)
                        sum += (a[j][l] - a[i][l]) * (a[k][l] - a[i][l]);
                    if (sum > 0) failed = 1;
                }
            if (!failed) ans.pb(i);
        }
        cout<<sz(ans)<<'\n';
        for (auto u : ans) printf("%d\n", u + 1);
    }
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rev(i,a,b) for(int i=a;i>b;i--)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define se second
#define all(a) (a).begin(),(a).end()
#define endl '\n'
#define MOD 1000000007
using namespace std;
int n,p[1001][5];
bool check(int i, int j, int k){
    ll tmp=0;
    rep(l,0,5)
        tmp+=(p[j][l]-p[i][l])*(p[k][l]-p[i][l]);
    //cout<<i<<" "<<j<<" "<<" "<<k<<" "<<tmp<<endl;
    return (tmp>0);
}
void code(){
    cin>>n;
    rep(i,0,n){
        rep(j,0,5)
            cin>>p[i][j];
    }
    vi ans;
    rep(i,0,n){
        bool flag=1;
        rep(j,0,n){
            if(j==i)
                continue;
            rep(k,j+1,n){
                if(k==i)
                    continue;
                if(check(i,j,k)){
                    flag=0;
                    break;
                }
            }
            if(flag==0)
                break;
        }
        if(flag)
            ans.pb(i);
    }
    cout<<ans.size()<<endl;
    for(int i:ans)
        cout<<i+1<<" ";
}
int main()
{
	cin.tie(0);
	cout.tie(0);
	int t=1;
      //  cin>>t;
	while(t--){
        code();
	}
}


///#pragma GCC optimize("Ofast,no-stack-protector")
///#pragma GCC target("avx")

#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <set>
#include <deque>
#include <list>
#include <queue>
#include <utility>
#include <map>
#include <string>
#include <iomanip>
#include <utility>
#include <stdio.h>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

#define se second
#define fi first
#define mp read_pair
#define pb push_back

typedef long long ll;
typedef long double ld;

using namespace std;

struct point {
    vector<ld> x;
    point(): x(5) {}
    point(ld q, ld w, ld e, ld r, ld t): x({q, w, e, r, t}) {}

    ld operator* (const point& b) const {
        ld ret = 0.0;
        for (int i = 0; i < 5; i++) ret += this->x[i] * b.x[i];
        return ret;
    }

    point operator- (const point& b) const {
        point ret;
        for (int i = 0; i < 5; i++) ret.x[i] = this->x[i] - b.x[i];
        return ret;
    }

    ld len() const {
        //return sqrt(this->operator*(*this));
        return sqrt((*this) * (*this));
    }
};

ld angle(const point& a, const point& b) {
    return (a * b) / (a.len() * b.len());
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ///freopen("iiiin.in", "r", stdin);
    ///freopen("oooout.out", "w", stdout);

    //operator*(a, b);
    //a.operator*(b);

    int n;
    cin >> n;
    vector<point> points(n);
    for (auto& e : points) {
        for (auto& k : e.x) cin >> k;
    }
    if (n > 33) return cout << 0, 0;
    if (n <= 2) {
        cout << n << '\n';
        for (int i = 1; i <= n; i++) cout << i << '\n';
        return 0;
    }
    for (int x = 0; x < n; x++) {
        bool f = 1;
        for (int a = 0; a < n; a++) {
            if (a == x) continue;
            for (int b = 0; b < n; b++) {
                if (b == x || b == a) continue;
                point xa = points[a] - points[x];
                point xb = points[b] - points[x];
                if (angle(xa, xb) > 0) f = 0;
            }
        }
        if (f) return cout << 1 << '\n' << x + 1, 0;
    }
    cout << 0;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define F(i,a,b) for(int i=int(a);i<=int(b);i++)
#define endl "\n"
#define ios std::ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define out(x) cout<<x<<endl,exit(0);
#define pb push_back
#define all(v) v.begin(),v.end()
#define I first
#define S second

bool calc(vector <int> a,vector<int> b,vector <int> c){
    int ans=0;
    F(i,0,4){
        ans+=(a[i]-b[i])*(a[i]-c[i]);
    }
    return (ans>0);
}

int main(){
    ios;
    int n;
    cin>>n;

    vector<vector<int> > v;
    F(i,0,n-1){
        int a,b,c,d,e;
        cin>>a>>b>>c>>d>>e;
        v.pb({a,b,c,d,e});
    }

    vector <int> ans;
    F(i,0,n-1){
        int f=0;
        F(j,0,n-1){
            F(k,0,n-1){
                if(i==j || j==k || i==k) continue;
                if(calc(v[i],v[j],v[k])){
                    f=1;
                    break;
                }
            }
            if(f) break;
        }
        if(f==0) ans.pb(i+1);
    }
    cout<<ans.size()<<endl;
    for(auto it:ans) cout<<it<<" ";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=1000000007,MAX=200005,INF=1<<30;

bool ok(vector<int> &a,vector<int> &b,vector<int> &c){
    int s=0;
    for(int j=0;j<5;j++){
        s+=(b[j]-a[j])*(c[j]-a[j]);
    }
    if(s>0) return 1;
    return 0;
}

int main(){

    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;cin>>N;
    vector<int> ans;
    vector<vector<int>> A(N,vector<int>(5));

    for(int i=0;i<N;i++){
        for(int j=0;j<5;j++){
            cin>>A[i][j];
        }
    }

    for(int i=0;i<N;i++){
        bool check=false;
        for(int j=0;j<N;j++){
            for(int k=0;k<N;k++){
                if(j==k) continue;

                if(ok(A[i],A[j],A[k])){
                    check=true;
                    break;
                }
            }
            if(check) break;
        }
        if(!check) ans.push_back(i+1);
    }

    cout<<si(ans)<<endl;
    for(int a:ans) cout<<a<<"\n";

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#define x first
#define y second
#define mp make_pair
#define pb push_back

vector<array<int, 5>> p;
int n;
bool acute(int a, int b, int c)
{
    int s = 0;
    for (int i=0;i<5;++i) s += (p[b][i] - p[a][i]) * (p[c][i] - p[a][i]);
    return s>0;
}
bool is_bad[1111];
void solve()
{
    scanf("%lld", &n);
    p.resize(n);
    forn(i, n)
    {
        forn(j, 5) scanf("%lld", &p[i][j]);
    }
    forn(i, n)
    {
        forn(j, n)
        {
            if (i == j) continue;
            bool ed = false;
            forn(k, n)
            {
                if (k == i || k == j) continue;
                if (acute(i, j, k))
                {
                    is_bad[i] = 1;
                    ed = true;
                    break;
                }
            }
            if (ed) break;
         }
    }
    vector<int> ans;
    forn(i, n)
    {
        if(!is_bad[i]) ans.push_back(i);
    }
    printf("%lld\n", sz(ans));
    for(int it: ans) printf("%lld ", it + 1);
}
signed main()
{
    int T = 1; //scanf("%lld", &T);
    while (T--) solve();
    return 0;
}


#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF LLONG_MAX

ll mpow(ll a, ll b){
	if(b==0) return 1;
	ll t1 = mpow(a,b/2);
	t1 *= t1;
	t1 %= MOD;
	if(b%2) t1 *= a;
	t1 %= MOD;
	return t1;
}

void solve(){
	ll n;
	cin >> n;
	ll a[n][5];
	forn(i,n) forn(p,5) cin >> a[i][p];
	ll mark[n];
	forn(i,n) mark[i]=0;
	ll c = 0;
	if(n>100){
		cout << 0 << ln;
	}
	else{
		forn(i,n){
			forn(j,n){
				forn(k,n){
					if(i==j || j==k || i==k) continue;
					ll val=0;
					forn(p,5){
						val += (a[i][p]-a[j][p])*(a[i][p]-a[k][p]);
					}
					if(val>0 && mark[i]==0){
						mark[i]=1;
						c++;
					}
				}
			}
		}
		cout << n-c << ln;
		forn(i,n){
			if(mark[i]==0) cout << i+1 << " ";
		}
		cout << ln;
	}
}

int main()
{
	ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll t=1;
    // cin >> t;
    forn(i,t) solve();
    return 0;
}


#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF LLONG_MAX

ll mpow(ll a, ll b){
	if(b==0) return 1;
	ll t1 = mpow(a,b/2);
	t1 *= t1;
	t1 %= MOD;
	if(b%2) t1 *= a;
	t1 %= MOD;
	return t1;
}

void solve(){
	ll n;
	cin >> n;
	ll a[n][5];
	forn(i,n) forn(p,5) cin >> a[i][p];
	ll mark[n];
	forn(i,n) mark[i]=0;
	ll c = 0;
	if(n>6){
		cout << 0  << ln;
	}
	else{
		forn(i,n){
			forn(j,n){
				forn(k,n){
					if(i==j || j==k || i==k) continue;
					ll val=0;
					forn(p,5){
						val += (a[i][p]-a[j][p])*(a[i][p]-a[k][p]);
					}
					if(val>0 && mark[i]==0){
						mark[i]=1;
						c++;
					}
				}
			}
		}
		cout << n-c << ln;
		forn(i,n){
			if(mark[i]==0) cout << i+1 << " ";
		}
		cout << ln;
	}
}

int main()
{
	ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll t=1;
    // cin >> t;
    forn(i,t) solve();
    return 0;
}


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

using ll=long long;
#define int ll

#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif

template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}

template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;

using pi=pair<int,int>;
using vi=vc<int>;

template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p.a<<","<<p.b<<"}";
}

template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}

#define mp make_pair
#define mt make_tuple
#define one(x) memset(x,-1,sizeof(x))
#define zero(x) memset(x,0,sizeof(x))
#ifdef LOCAL
void dmpr(ostream&os){os<<endl;}
template<class T,class... Args>
void dmpr(ostream&os,const T&t,const Args&... args){
	os<<t<<" ";
	dmpr(os,args...);
}
#define dmp2(...) dmpr(cerr,__LINE__,##__VA_ARGS__)
#else
#define dmp2(...) void(0)
#endif

using uint=unsigned;
using ull=unsigned long long;

template<class t,size_t n>
ostream& operator<<(ostream&os,const array<t,n>&a){
	return os<<vc<t>(all(a));
}

template<int i,class T>
void print_tuple(ostream&,const T&){
}

template<int i,class T,class H,class ...Args>
void print_tuple(ostream&os,const T&t){
	if(i)os<<",";
	os<<get<i>(t);
	print_tuple<i+1,T,Args...>(os,t);
}

template<class ...Args>
ostream& operator<<(ostream&os,const tuple<Args...>&t){
	os<<"{";
	print_tuple<0,tuple<Args...>,Args...>(os,t);
	return os<<"}";
}

template<class t>
void print(t x,int suc=1){
	cout<<x;
	if(suc==1)
		cout<<"\n";
	if(suc==2)
		cout<<" ";
}

ll read(){
	ll i;
	cin>>i;
	return i;
}

vi readvi(int n,int off=0){
	vi v(n);
	rep(i,n)v[i]=read()+off;
	return v;
}

template<class T>
void print(const vector<T>&v,int suc=1){
	rep(i,v.size())
		print(v[i],i==int(v.size())-1?suc:2);
}

string readString(){
	string s;
	cin>>s;
	return s;
}

template<class T>
T sq(const T& t){
	return t*t;
}

//#define CAPITAL
void yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<"\n";
	#else
	cout<<"Yes"<<"\n";
	#endif
	if(ex)exit(0);
}
void no(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<"\n";
	#else
	cout<<"No"<<"\n";
	#endif
	if(ex)exit(0);
}
void possible(bool ex=true){
	#ifdef CAPITAL
	cout<<"POSSIBLE"<<"\n";
	#else
	cout<<"Possible"<<"\n";
	#endif
	if(ex)exit(0);
}
void impossible(bool ex=true){
	#ifdef CAPITAL
	cout<<"IMPOSSIBLE"<<"\n";
	#else
	cout<<"Impossible"<<"\n";
	#endif
	if(ex)exit(0);
}

constexpr ll ten(int n){
	return n==0?1:ten(n-1)*10;
}

const ll infLL=LLONG_MAX/3;

#ifdef int
const int inf=infLL;
#else
const int inf=INT_MAX/2-100;
#endif

int topbit(signed t){
	return t==0?-1:31-__builtin_clz(t);
}
int topbit(ll t){
	return t==0?-1:63-__builtin_clzll(t);
}
int botbit(signed a){
	return a==0?32:__builtin_ctz(a);
}
int botbit(ll a){
	return a==0?64:__builtin_ctzll(a);
}
int popcount(signed t){
	return __builtin_popcount(t);
}
int popcount(ll t){
	return __builtin_popcountll(t);
}
bool ispow2(int i){
	return i&&(i&-i)==i;
}
ll mask(int i){
	return (ll(1)<<i)-1;
}

bool inc(int a,int b,int c){
	return a<=b&&b<=c;
}

template<class t> void mkuni(vc<t>&v){
	sort(all(v));
	v.erase(unique(all(v)),v.ed);
}

ll rand_int(ll l, ll r) { //[l, r]
	#ifdef LOCAL
	static mt19937_64 gen;
	#else
	static mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
	#endif
	return uniform_int_distribution<ll>(l, r)(gen);
}

template<class t>
void myshuffle(vc<t>&a){
	rep(i,si(a))swap(a[i],a[rand_int(0,i)]);
}

template<class t>
int lwb(const vc<t>&v,const t&a){
	return lower_bound(all(v),a)-v.bg;
}

const int K=5;
using A=array<int,K>;

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);

	int n;cin>>n;
	vc<A> p(n);
	rep(i,n)rep(j,K)cin>>p[i][j];
	vi ok(n,1);
	rep(i,n){
		rep(j,n)if(i!=j){
			rep(k,j)if(k!=i&&k!=i){
				int s=0;
				rep(t,K){
					s+=(p[j][t]-p[i][t])*(p[k][t]-p[i][t]);
				}
				if(s>0){
					ok[i]=0;
					break;
				}
			}
			if(!ok[i])break;
		}
	}
	vi ans;
	rep(i,n)if(ok[i])ans.pb(i);
	print(si(ans));
	for(auto&v:ans)v++;
	print(ans);
}


#include<bits/stdc++.h>
#define         ll long long int
#define         start ios::sync_with_stdio(false)
#define         enjoy cin.tie(NULL);
#define         read_input_from_file freopen("input.txt","r",stdin)
#define         write_output_to_file freopen("output.txt","w",stdout)
#define         pi acos(-1)
#define         rad pi/180.0
#define         eps 1e-10
#define         pb push_back
#define         mp make_pair
#define         pair pair<ll,ll>
#define         mdlu 1e9+7 // modulo
#define         goto_hell return 0
#define         finish return
using           namespace std;
/*
// result of pow(a,b)
ll bin_pow(ll a,ll b)
{
    ll res=1; // initial result
    while(b>0)
    {
        if(b&1)res=res*a;
        a*=a;
        b=b>>1; // b is divided by 2
    }
    return res;
}*/

/*
//binary search
int binary_search(int a[],int n,int q) //array must be sorted
{
    int fst=0,lst=n-1,mid;
    while(fst<=lst)
    {
        mid=(fst+lst)/2;
        if(a[mid]==x)return mid;
        if(a[mid]>x)lst=mid-1;
        else fst=mid+1;
    }
    retutn -1;
}*/

void solve()
{
    ll n;
    cin >> n;
    vector<int>vec;
    ll a[n],b[n],c[n],d[n],e[n];
    for(int i=0;i<n;i++)
        cin >> a[i] >> b[i] >> c[i] >> d[i] >> e[i];
    for(int i=0;i<n;i++)
    {
        int f=1;
        for(int j=0;j<n;j++)
        {
            if(j==i)continue;
            for(int k=0;k<n;k++)
            {
                if(k==j || k==i)continue;
                ll p=(a[j]-a[i])*(a[k]-a[i])+(b[j]-b[i])*(b[k]-b[i])+(c[j]-c[i])*(c[k]-c[i])+(d[j]-d[i])*(d[k]-d[i])+(e[j]-e[i])*(e[k]-e[i]);
                if(p>0ll)
                {
                    f=0;break;
                }
            }
            if(f==0)break;
        }
        if(f)vec.pb(i+1);
    }
    cout << vec.size() << endl;
    if(vec.size())
    {
        for(auto it=vec.begin();it!=vec.end();++it)
        cout << *it << endl;
    }

}

int main()
{
    //start;
    //enjoy;
    //read_input_from_file;
    //write_output_to_file;
    int t=1;
    // input test case
    //cin >> t;
    while(t--)
    solve();

    goto_hell;
}


#define _USE_MATH_DEFINES
#define EPS 1e-9
#define pb push_back
#define mp make_pair
#define fst first
#define snd second

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

struct point {
    ll a, b, c, d, e;

    point() : a(0), b(0), c(0), d(0), e(0) {}
    point(ll _a, ll _b, ll _c, ll _d, ll _e) :
        a(_a), b(_b), c(_c), d(_d), e(_e) {}

    point operator-(point other) {
        return point(a - other.a, b - other.b, c - other.c, d - other.d, e - other.e);
    }
};

ll dot(point p1, point p2) {
    return p1.a * p2.a + p1.b * p2.b + p1.c * p2.c + p1.d * p2.d + p1.e * p2.e;
}

ll norm2(point p) {
    return dot(p, p);
}

ll distance2(point p1, point p2) {
    return norm2(p2 - p1);
}

double angle(point p1, point p2) {
    return acos(dot(p1, p2) / sqrt(norm2(p1)) / sqrt(norm2(p2)));
}

bool good(int n, vector<point>& ps, int idx) {
    for (int i = 0; i < n; i++) {
        if (i == idx) continue;
        for (int j = i + 1; j < n; j++) {
            if (j == idx) continue;
            if (angle(ps[i] - ps[idx], ps[j] - ps[idx]) < M_PI / 2 - EPS) {
                return false;
            }
        }
    }
    return true;
}

int main() {
    ios_base::sync_with_stdio(false);
    cout << setprecision(12);

    int n;
    cin >> n;

    if (n == 1) {
        cout << 1 << endl;
        cout << 1 << endl;
        return 0;
    }

    vector<point> ps(n);
    for (int i = 0; i < n; i++) {
        cin >> ps[i].a >> ps[i].b >> ps[i].c >> ps[i].d >> ps[i].e;
    }

    ll d_min = LLONG_MAX;
    int i1, i2;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            ll d = distance2(ps[i], ps[j]);
            if (d < d_min) {
                d_min = d;
                i1 = i;
                i2 = j;
            }
        }
    }

    bool good1 = good(n, ps, i1);
    bool good2 = good(n, ps, i2);
    if (!good1 && !good2) {
        cout << 0 << endl;
    } else if (!good1) {
        cout << 1 << endl;
        cout << i2 + 1 << endl;
    } else if (!good2) {
        cout << 1 << endl;
        cout << i1 + 1 << endl;
    } else {
        cout << 2 << endl;
        cout << i1 + 1 << endl;
        cout << i2 + 1 << endl;
    }
}


#define _USE_MATH_DEFINES
#define EPS 1e-9
#define pb push_back
#define mp make_pair
#define fst first
#define snd second

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

struct point {
    ll a, b, c, d, e;

    point() : a(0), b(0), c(0), d(0), e(0) {}
    point(ll _a, ll _b, ll _c, ll _d, ll _e) :
        a(_a), b(_b), c(_c), d(_d), e(_e) {}

    point operator-(point other) {
        return point(a - other.a, b - other.b, c - other.c, d - other.d, e - other.e);
    }
};

ll dot(point p1, point p2) {
    return p1.a * p2.a + p1.b * p2.b + p1.c * p2.c + p1.d * p2.d + p1.e * p2.e;
}

ll norm2(point p) {
    return dot(p, p);
}

ll distance2(point p1, point p2) {
    return norm2(p2 - p1);
}

double angle(point p1, point p2) {
    return acos(dot(p1, p2) / sqrt(norm2(p1)) / sqrt(norm2(p2)));
}

bool good(int n, vector<point>& ps, int idx) {
    for (int i = 0; i < n; i++) {
        if (i == idx) continue;
        for (int j = i + 1; j < n; j++) {
            if (j == idx) continue;
            if (angle(ps[i] - ps[idx], ps[j] - ps[idx]) < M_PI / 2 - EPS) {
                return false;
            }
        }
    }
    return true;
}

int main() {
    ios_base::sync_with_stdio(false);
    cout << setprecision(12);

    int n;
    cin >> n;

    vector<point> ps(n);
    for (int i = 0; i < n; i++) {
        cin >> ps[i].a >> ps[i].b >> ps[i].c >> ps[i].d >> ps[i].e;
    }

    ll d_min = LLONG_MAX;
    int i1, i2;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            ll d = distance2(ps[i], ps[j]);
            if (d < d_min) {
                d_min = d;
                i1 = i;
                i2 = j;
            }
        }
    }

    bool good1 = good(n, ps, i1);
    bool good2 = good(n, ps, i2);
    if (!good1 && !good2) {
        cout << 0 << endl;
    } else if (!good1) {
        cout << 1 << endl;
        cout << i2 + 1 << endl;
    } else if (!good2) {
        cout << 1 << endl;
        cout << i1 + 1 << endl;
    } else {
        cout << 2 << endl;
        cout << i1 + 1 << endl;
        cout << i2 + 1 << endl;
    }
}


#define _USE_MATH_DEFINES
#define EPS 1e-9
#define pb push_back
#define mp make_pair
#define fst first
#define snd second

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

struct point {
    ll a, b, c, d, e;

    point() : a(0), b(0), c(0), d(0), e(0) {}
    point(ll _a, ll _b, ll _c, ll _d, ll _e) :
        a(_a), b(_b), c(_c), d(_d), e(_e) {}

    point operator-(point other) {
        return point(a - other.a, b - other.b, c - other.c, d - other.d, e - other.e);
    }
};

ll dot(point p1, point p2) {
    return p1.a * p2.a + p1.b * p2.b + p1.c * p2.c + p1.d * p2.d + p1.e * p2.e;
}

ll norm2(point p) {
    return dot(p, p);
}

ll distance2(point p1, point p2) {
    return norm2(p2 - p1);
}

double angle(point p1, point p2) {
    return acos(dot(p1, p2) / sqrt(norm2(p1)) / sqrt(norm2(p2)));
}

bool good(int n, vector<point>& ps, int idx) {
    for (int i = 0; i < n; i++) {
        if (i == idx) continue;
        for (int j = i + 1; j < n; j++) {
            if (j == idx) continue;
            if (angle(ps[i] - ps[idx], ps[j] - ps[idx]) < M_PI / 2 - EPS) {
                return false;
            }
        }
    }
    return true;
}

int main() {
    ios_base::sync_with_stdio(false);
    cout << setprecision(12);

    int n;
    cin >> n;

    if (n > 11) {
        cout << 0 << endl;
        return 0;
    }

    vector<point> ps(n);
    for (int i = 0; i < n; i++) {
        cin >> ps[i].a >> ps[i].b >> ps[i].c >> ps[i].d >> ps[i].e;
    }

    vector<int> result;
    for (int i = 0; i < n; i++) {
        if (good(n, ps, i)) {
            result.pb(i + 1);
        }
    }

    cout << result.size() << endl;
    for (int i = 0; i < result.size(); i++) {
        cout << result[i] << endl;
    }
}


#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#include<random>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (int)(Y);++(X))
#define reps(X,S,Y) for (int (X) = (int)(S);(X) < (int)(Y);++(X))
#define rrep(X,Y) for (int (X) = (int)(Y)-1;(X) >=0;--(X))
#define rreps(X,S,Y) for (int (X) = (int)(Y)-1;(X) >= (int)(S);--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define Endl endl
#define NL <<"\n"

using namespace std;
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
template<class T> using vv=vector<vector<T>>;
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
//#undef NUIP
#ifdef NUIP
#include "benri.h"
#else
#define out(args...)
#endif
#ifdef __cpp_init_captures
template<typename T>vector<T> table(int n, T v){ return vector<T>(n, v);}
template <class... Args> auto table(int n, Args... args){auto val = table(args...); return vector<decltype(val)>(n, move(val));}
#endif
const ll MOD=1e9+7; //998244353

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  cout<<fixed<<setprecision(0);
	using AR=array<int,5>;
	int n;
	cin>>n;
	vector<AR> ar(n);
	for(auto &[a,s,d,f,g]:ar) cin>>a>>s>>d>>f>>g;
	if(n>=500){
		cout<<0 NL;
		return 0;
	}
	vector<int> re;
	auto bad=
		[&](int i){
			rep(j,n)if(i!=j)rep(k,j)if(k!=i){
					if((get<0>(ar[j])-get<0>(ar[i]))*(get<0>(ar[k])-get<0>(ar[i]))
						 +(get<1>(ar[j])-get<1>(ar[i]))*(get<1>(ar[k])-get<1>(ar[i]))
						 +(get<2>(ar[j])-get<2>(ar[i]))*(get<2>(ar[k])-get<2>(ar[i]))
						 +(get<3>(ar[j])-get<3>(ar[i]))*(get<3>(ar[k])-get<3>(ar[i]))
						 +(get<4>(ar[j])-get<4>(ar[i]))*(get<4>(ar[k])-get<4>(ar[i]))>0) return true;
				}
			return false;
		};
	rep(i,n)if(!bad(i)) re.pb(i);
	cout<<re.size() NL;
	rep(i,re.size()) cout<<re[i]+1<<" \n"[i+1==re.size()];
	return 0;
}


#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#include<random>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (int)(Y);++(X))
#define reps(X,S,Y) for (int (X) = (int)(S);(X) < (int)(Y);++(X))
#define rrep(X,Y) for (int (X) = (int)(Y)-1;(X) >=0;--(X))
#define rreps(X,S,Y) for (int (X) = (int)(Y)-1;(X) >= (int)(S);--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define Endl endl
#define NL <<"\n"

using namespace std;
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
template<class T> using vv=vector<vector<T>>;
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
//#undef NUIP
#ifdef NUIP
#include "benri.h"
#else
#define out(args...)
#endif
#ifdef __cpp_init_captures
template<typename T>vector<T> table(int n, T v){ return vector<T>(n, v);}
template <class... Args> auto table(int n, Args... args){auto val = table(args...); return vector<decltype(val)>(n, move(val));}
#endif
const ll MOD=1e9+7; //998244353

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  cout<<fixed<<setprecision(0);
	using AR=array<ll,5>;
	int n;
	cin>>n;
	vector<AR> ar(n);
	for(auto &[a,s,d,f,g]:ar) cin>>a>>s>>d>>f>>g;
	vector<int> re;
	auto check=
		[&](int i){
			rep(j,n)if(i!=j)rep(k,j)if(k!=i){
					if((get<0>(ar[j])-get<0>(ar[i]))*(get<0>(ar[k])-get<0>(ar[i]))
						 +(get<1>(ar[j])-get<1>(ar[i]))*(get<1>(ar[k])-get<1>(ar[i]))
						 +(get<2>(ar[j])-get<2>(ar[i]))*(get<2>(ar[k])-get<2>(ar[i]))
						 +(get<3>(ar[j])-get<3>(ar[i]))*(get<3>(ar[k])-get<3>(ar[i]))
						 +(get<4>(ar[j])-get<4>(ar[i]))*(get<4>(ar[k])-get<4>(ar[i]))<=0) return false;
				}
			return true;
		};
	rep(i,n)if(!check(i)) re.pb(i);
	cout<<re.size() NL;
	rep(i,re.size()) cout<<re[i]+1<<" \n"[i+1==re.size()];
	return 0;
}


#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#include<random>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (int)(Y);++(X))
#define reps(X,S,Y) for (int (X) = (int)(S);(X) < (int)(Y);++(X))
#define rrep(X,Y) for (int (X) = (int)(Y)-1;(X) >=0;--(X))
#define rreps(X,S,Y) for (int (X) = (int)(Y)-1;(X) >= (int)(S);--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define Endl endl
#define NL <<"\n"

using namespace std;
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
template<class T> using vv=vector<vector<T>>;
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
//#undef NUIP
#ifdef NUIP
#include "benri.h"
#else
#define out(args...)
#endif
#ifdef __cpp_init_captures
template<typename T>vector<T> table(int n, T v){ return vector<T>(n, v);}
template <class... Args> auto table(int n, Args... args){auto val = table(args...); return vector<decltype(val)>(n, move(val));}
#endif
const ll MOD=1e9+7; //998244353

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  cout<<fixed<<setprecision(0);
	using AR=array<int,5>;
	int n;
	cin>>n;
	vector<AR> ar(n);
	for(auto &[a,s,d,f,g]:ar) cin>>a>>s>>d>>f>>g;
	if(n>=500){
		cout<<n<<endl;
		rep(i,n) cout<<i+1<<" \n"[i+1==n];
		return 0;
	}
	vector<int> re;
	auto bad=
		[&](int i){
			rep(j,n)if(i!=j)rep(k,j)if(k!=i){
					if((get<0>(ar[j])-get<0>(ar[i]))*(get<0>(ar[k])-get<0>(ar[i]))
						 +(get<1>(ar[j])-get<1>(ar[i]))*(get<1>(ar[k])-get<1>(ar[i]))
						 +(get<2>(ar[j])-get<2>(ar[i]))*(get<2>(ar[k])-get<2>(ar[i]))
						 +(get<3>(ar[j])-get<3>(ar[i]))*(get<3>(ar[k])-get<3>(ar[i]))
						 +(get<4>(ar[j])-get<4>(ar[i]))*(get<4>(ar[k])-get<4>(ar[i]))>0) return true;
				}
			return false;
		};
	rep(i,n)if(!bad(i)) re.pb(i);
	cout<<re.size() NL;
	rep(i,re.size()) cout<<re[i]+1<<" \n"[i+1==re.size()];
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
using lint = long long;
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }
#ifdef HITONANODE_LOCAL
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl
#else
#define dbg(x)
#endif

int main()
{
    int N;
    cin >> N;
    vector V(N, vector<int>(5));
    cin >> V;
    vector<int> ret;
    REP(i, N)
    {
        bool ok = true;
        REP(j, N) if (i != j)
        {
            REP(k, j) if (k != j and k != i)
            {
                lint m = 0;
                REP(d, 5) m += (V[k][d] - V[i][d]) * (V[j][d] - V[i][d]);
                if (m > 0) ok = false;
                if (!ok) break;
            }
            if (!ok) break;
        }
        if (ok) ret.emplace_back(i + 1);
    }
    cout << ret.size() << '\n';
    for (auto x : ret) cout << x << '\n';
}


#include <bits/stdc++.h>
using namespace std;
using lint = long long;
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)
template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }
#ifdef HITONANODE_LOCAL
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl
#else
#define dbg(x)
#endif

int main()
{
    int N;
    cin >> N;
    vector V(N, vector<int>(5));
    cin >> V;
    vector<int> ret;
    if (N > 100) puts("0");
    else
    {
        REP(i, N)
        {
            bool ok = true;
            REP(j, N) if (i != j)
            {
                REP(k, j) if (k != j and k != i)
                {
                    lint m = 0;
                    REP(d, 5) m += (V[k][d] - V[i][d]) * (V[j][d] - V[i][d]);
                    if (m > 0) ok = false;
                    if (!ok) break;
                }
                if (!ok) break;
            }
            if (ok) ret.emplace_back(i + 1);
        }
    }
    cout << ret.size() << '\n';
    for (auto x : ret) cout << x << '\n';
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll, ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define ppi pair<pii,int>
#define pip pair<int,pii>
#define pdd pair<double, double>
#define f first
#define s second
#define MOD 1000000007
#define mkp make_pair
#define M_PI 3.14159265358979323846
#define FOR(i,l,r) for (int i=l;i<=r;i++)
#define LOR(i,l,r) for (ll i=l;i<=r;i++)
#define FORD(i,r,l) for (int i=r;i>=l;i--)
#define LORD(i,r,l) for (ll i=r;i>=l;i--)
#define INF 1000000000
#define CL(x) memset(x,0,sizeof(x))
#define DEB(x) cout << #x << " : " << x << '\n'
#define ALL(x) x.begin(), x.end()
#define SZ(x) x.size()
#define UI(x) (int)(x-'A')
#define LI(x) (int)(x-'a')
typedef long long ll;

#define MXN 1005
int N;
double P[MXN][5];
vector<int> ans;

double dot(double* v1, double* v2)
{
    double rtn=0;
    FOR(i,0,4)rtn+=v1[i]*v2[i];
    return rtn;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>N;
    FOR(i,1,N)
    {
        FOR(j,0,4)cin>>P[i][j];
    }
    if(N>33)
    {
        cout<<0<<'\n';
        return 0;
    }

    double v1[5],v2[5];
    double l1,l2;
    FOR(i,1,N)
    {
        bool ok=true;
        FOR(j,1,N)
        {
            if(j==i)continue;
            l1=0;
            FOR(x,0,4)
            {
                v1[x]=P[j][x]-P[i][x];
                l1+=v1[x]*v1[x];
            }
            l1 = sqrt(l1);
            FOR(k,1,N)
            {
                if(k==j||k==i)continue;
                l2=0;
                FOR(x,0,4)
                {
                    v2[x]=P[k][x]-P[i][x];
                    l2+=v2[x]*v2[x];
                }
                l2 = sqrt(l2);
                if( dot(v1,v2)/(l1*l2)>0 )
                {
                    ok=false;
                    break;
                }
            }
            if(!ok)break;
        }
        if(ok)ans.pb(i);
    }

    cout<<SZ(ans)<<'\n';
    for(int ai : ans)cout<<ai<<'\n';

    return 0;
}


#pragma GCC optimize("Ofast")
#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
int num[1005][10];
int dot(int i,int j,int k){
	int l,ans=0;
	for(l=1;l<=5;l++)
		ans+=(num[j][l]-num[i][l])*(num[k][l]-num[i][l]);
	return ans;
}
int main(){
	int i,j,k,n;
	scanf("%d",&n);
	if(n>11){
		puts("0");
		return 0;
	}
	for(i=1;i<=n;i++)
		for(j=1;j<=5;j++)
			scanf("%d",&num[i][j]);
	vector<int> put;
	for(i=1;i<=n;i++){
		bool right=1;
		for(j=1;j<=n;j++){
			if(i==j)
				continue;
			for(k=1;k<=n;k++){
				if(i==k||j==k)
					continue;
				right&=(dot(i,j,k)<=0);
			}
		}
		if(right)
			put.emplace_back(i);
	}
	printf("%d\n",(int)put.size());
	for(auto x:put)
		printf("%d ",x);
}


#pragma GCC optimize("Ofast")
#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
int num[1005][10];
int dot(int i,int j,int k){
	int l,ans=0;
	for(l=1;l<=5;l++)
		ans+=(num[j][l]-num[i][l])*(num[k][l]-num[i][l]);
	return ans;
}
int main(){
	int i,j,k,n;
	scanf("%d",&n);
	if(n>10){
		puts("0");
		return 0;
	}
	for(i=1;i<=n;i++)
		for(j=1;j<=5;j++)
			scanf("%d",&num[i][j]);
	vector<int> put;
	for(i=1;i<=n;i++){
		bool right=1;
		for(j=1;j<=n;j++){
			if(i==j)
				continue;
			for(k=1;k<=n;k++){
				if(i==k||j==k)
					continue;
				right&=(dot(i,j,k)<=0);
			}
		}
		if(right)
			put.emplace_back(i);
	}
	printf("%d\n",(int)put.size());
	for(auto x:put)
		printf("%d ",x);
}


#pragma GCC optimize("Ofast")
#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
int num[1005][10];
int dot(int i,int j,int k){
	int l,ans=0;
	for(l=1;l<=5;l++)
		ans+=(num[j][l]-num[i][l])*(num[k][l]-num[i][l]);
	return ans;
}
int main(){
	int i,j,k,n;
	scanf("%d",&n);
	if(n>12){
		puts("0");
		return 0;
	}
	for(i=1;i<=n;i++)
		for(j=1;j<=5;j++)
			scanf("%d",&num[i][j]);
	vector<int> put;
	for(i=1;i<=n;i++){
		bool right=1;
		for(j=1;j<=n;j++){
			if(i==j)
				continue;
			for(k=1;k<=n;k++){
				if(i==k||j==k)
					continue;
				right&=(dot(i,j,k)<=0);
			}
		}
		if(right)
			put.emplace_back(i);
	}
	printf("%d\n",(int)put.size());
	for(auto x:put)
		printf("%d ",x);
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstring>
#include <string>
#include <string.h>
#include <cmath>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>
#include <list>
#include <stack>
#include <fstream>
#include <sstream>
#define pi acos(-1.0)
#define INF 0x3f3f3f3f
#define SIZE 300007
#define rep(i, a, b) for(int i = a; i <= b; ++i)
#define pii pair<int,int>
#define ms(a, n) memset(a, n, sizeof(a))
const int  N = 1050000;
const int mod = 998244353;
using namespace std;
typedef	long long ll;
void io() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
}
struct Point {
	int a, b, c, d, e;
}p[SIZE];
bool pp[SIZE];
ll n, t, m;
int main() {
	io();
	cin >> n;
	if (n > 11) cout << "0";
	else {
		rep(i, 1, n) {
			cin >> p[i].a >> p[i].b >> p[i].c >> p[i].d >> p[i].e;
		}
		int num = n;
		rep(i, 1, n) {
			bool flag = true;
			int a = p[i].a, b = p[i].b, c = p[i].c, d = p[i].d, e = p[i].e;
			rep(j, 1, n) {
				if (j == i) continue;
				int a1 = a - p[j].a, b1 = b - p[j].b, c1 = c - p[j].b, d1 = d - p[j].d, e1 = e - p[j].e;
				rep(k, 1, n) {
					if (k == j || k == i) continue;
					int a2 = a - p[k].a, b2 = b - p[k].b, c2 = c - p[k].b, d2 = d - p[k].d, e2 = e - p[k].e;
					int tmp = a1 * a2 + b1 * b2 + c1 * c2 + d1 * d2 + e1 * e2;
					if (tmp > 0) {
						flag = false;
						pp[i] = true;
						num--;
						break;
					}
				}
				if (pp[i]) break;
			}
		}
		cout << num << endl;
		rep(i, 1, n) {
			if (!pp[i]) cout << i << ' ';
		}
	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstring>
#include <string>
#include <string.h>
#include <cmath>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>
#include <list>
#include <stack>
#include <fstream>
#include <sstream>
#define pi acos(-1.0)
#define INF 0x3f3f3f3f
#define SIZE 300007
#define rep(i, a, b) for(int i = a; i <= b; ++i)
#define pii pair<int,int>
#define ms(a, n) memset(a, n, sizeof(a))
const int  N = 1050000;
const int mod = 998244353;
using namespace std;
typedef	long long ll;
void io() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
}
struct Point {
	int a, b, c, d, e;
}p[SIZE];
bool pp[SIZE];
ll n, t, m;
int num;
void solve(int i) {
	int a = p[i].a, b = p[i].b, c = p[i].c, d = p[i].d, e = p[i].e;
	rep(j, 1, n) {
		if (j == i) continue;
		int a1 = a - p[j].a, b1 = b - p[j].b, c1 = c - p[j].c, d1 = d - p[j].d, e1 = e - p[j].e;
		rep(k, 1, n) {
			if ((k == j) || (k == i)) continue;
			int a2 = a - p[k].a, b2 = b - p[k].b, c2 = c - p[k].c, d2 = d - p[k].d, e2 = e - p[k].e;
			int tmp = a1 * a2 + b1 * b2 + c1 * c2 + d1 * d2 + e1 * e2;
			if (tmp > 0) {
				pp[i] = true;
				num--;
				break;
			}
		}
		if (pp[i]) break;
	}
}
int main() {
	io();
	cin >> n;
	num = n;
	if (n > 11) cout << "0";
	else {
		rep(i, 1, n) {
			cin >> p[i].a >> p[i].b >> p[i].c >> p[i].d >> p[i].e;
		}
		rep(i, 1, n) {
			solve(i);
		}
		cout << num << endl;
		rep(i, 1, n) {
			if (!pp[i]) cout << i << ' ';
		}
	}
	return 0;
}


#define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

struct vector5 {
	int c1, c2, c3, c4, c5;
	double dot(const vector5& other) const {
		return c1 * other.c1 + c2 * other.c2 + c3 * other.c3 + c4 * other.c4 + c5 * other.c5;
	}
	double len() const {
		return sqrt(this->dot(*this));
	}
};

vector5 operator- (vector5& l, vector5& r) {
	return { l.c1 - r.c1, l.c2 - r.c2, l.c3 - r.c3, l.c4 - r.c4, l.c5 - r.c5 };;
}

istream& operator>> (istream& is, vector5& v) {
	is >> v.c1 >> v.c2 >> v.c3 >> v.c4 >> v.c5;
	return is;
}

int n, cntBad;
vector5 v[1005];
bool bad[1005];

double angle(const vector5& a, const vector5& b) {
	return acos(a.dot(b) / a.len() / b.len()) / M_PI * 180;
}

bool isBad(int i, int j, int k) {
	return angle(v[j] - v[i], v[k] - v[i]) < 90;
}

int main() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> v[i];
	}
	for (int i = 1; i <= n-2; i++) {
		for (int j = i+1; j <= n - 1; j++) {
			for (int k = j+1; k <= n; k++) {
				if (!bad[i] && isBad(i, j, k)) {
					cntBad++;
					bad[i] = true;
				}
				if (!bad[j] && isBad(j, i, k)) {
					cntBad++;
					bad[j] = true;
				}
				if (!bad[k] && isBad(k, j, i)) {
					cntBad++;
					bad[k] = true;
				}
			}
		}
	}
	cout << n - cntBad << '\n';
	for (int i = 1; i <= n; i++)
		if (!bad[i])
			cout << i << ' ';
}


#include <iostream>
#include <cstdio>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <iterator>

#define x0 abc
#define y0 ABC
#define x1 abcd
#define y1 ABCD
#define xn abcde
#define yn ABCDE

#define l_b lower_bound
#define u_b upper_bound

#define fi first
#define se second
#define m_p make_pair

#define p_b push_back
#define po_b pop_back

#define ld long double
#define ll long long

#define cont continue
#define re return

#define MAXLL 9000000000000000000LL
#define MAXINT 2000000000

#define MINLL -9000000000000000000LL
#define MININT -2000000000

#define P acos(-1.)

#define endl '\n'

#define OUT cout << "-------" << endl;

using namespace std;

vector <int> ans;

ld a[181][6], v1[6], v2[6], sum1, sum2, sum3;

int n, i, j, z, p, q;

bool x;

    ld grad(ld a)
    {
        re a * 180. / P;
    }

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;

    if (n > 11) {
        cout << "0" << endl;

        re 0;
    }

    for (i = 1; i <= n; i++)
        for (j = 1; j <= 5; j++) cin >> a[i][j];

    for (z = 1; z <= n; z++) {
        x = true;

        for (p = 1; p <= n; p++)
            for (q = p + 1; q <= n; q++)
                if (p != z && q != z) {
                    for (i = 1; i <= 5; i++) v1[i] = a[z][i] - a[p][i];

                    for (i = 1; i <= 5; i++) v2[i] = a[z][i] - a[q][i];

                    sum1 = sum2 = sum3 = 0.;

                    for (i = 1; i <= 5; i++) sum1 += v1[i] * v2[i];

                    for (i = 1; i <= 5; i++) sum2 += pow(v1[i], 2);

                    sum2 = sqrt(sum2);

                    for (i = 1; i <= 5; i++) sum3 += pow(v2[i], 2);

                    sum3 = sqrt(sum3);

                    if (grad(acos(sum1 / sum2 / sum3)) < 90.)
                    x = false;
                }

        if (x)
        ans.p_b(z);
    }

    cout << ans.size() << endl;

    for (i = 0; i < ans.size(); i++) cout << ans[i] << endl;

    re 0;
}


#include <iostream>
#include <cstdio>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <iterator>

#define x0 abc
#define y0 ABC
#define x1 abcd
#define y1 ABCD
#define xn abcde
#define yn ABCDE

#define l_b lower_bound
#define u_b upper_bound

#define fi first
#define se second
#define m_p make_pair

#define p_b push_back
#define po_b pop_back

#define ld long double
#define ll long long

#define cont continue
#define re return

#define MAXLL 9000000000000000000LL
#define MAXINT 2000000000

#define MINLL -9000000000000000000LL
#define MININT -2000000000

#define P acos(-1.)

#define endl '\n'

#define OUT cout << "-------" << endl;

using namespace std;

vector <int> ans;

ld a[181][6], v1[6], v2[6], sum1, sum2, sum3;

int n, i, j, z, p, q;

bool x;

    ld grad(ld a)
    {
        re a * 180. / P;
    }

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;

    if (n > 11) {
        cout << "0" << endl;

        re 0;
    }

    for (i = 1; i <= n; i++)
        for (j = 1; j <= 5; j++) cin >> a[i][j];

    for (z = 1; z <= n; z++) {
        x = false;

        for (p = 1; p <= n; p++)
            for (q = p + 1; q <= n; q++)
                if (p != z && q != z) {
                    if (x)
                    cont;

                    for (i = 1; i <= 5; i++) v1[i] = a[z][i] - a[p][i];

                    for (i = 1; i <= 5; i++) v2[i] = a[z][i] - a[q][i];

                    sum1 = sum2 = sum3 = 0.;

                    for (i = 1; i <= 5; i++) sum1 += v1[i] * v2[i];

                    for (i = 1; i <= 5; i++) sum2 += pow(v1[i], 2);

                    sum2 = sqrt(sum2);

                    for (i = 1; i <= 5; i++) sum3 += pow(v2[i], 2);

                    sum3 = sqrt(sum3);

                    if (!(grad(acos(sum1 / sum2 / sum3)) < 90.)) {
                        x = true;

                        ans.p_b(z);
                    }
                }
    }

    cout << ans.size() << endl;

    for (i = 0; i < ans.size(); i++) cout << ans[i] << endl;

    re 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<vector<int>> X(n, vector<int>(5));
  for (int i = 0; i < n; i++){
    for (int j = 0; j < 5; j++){
      cin >> X[i][j];
    }
  }
  if (n > 100){
    cout << 0 << endl;
  } else {
    vector<bool> good(n, true);
    for (int i = 0; i < n; i++){
      for (int j = 0; j < n; j++){
        for (int k = 0; k < n; k++){
          if (i != j && j != k && k != i){
            int dot = 0;
            for (int l = 0; l < 5; l++){
              dot += (X[j][l] - X[i][l]) * (X[k][l] - X[i][l]);
            }
            if (dot > 0){
              good[i] = false;
            }
          }
        }
      }
    }
    vector<int> ans;
    for (int i = 0; i < n; i++){
      if (good[i]){
        ans.push_back(i);
      }
    }
    int k = ans.size();
    cout << k << endl;
    for (int i = 0; i < k; i++){
      cout << ans[i] + 1 << endl;
    }
  }
}


#include<bits/stdc++.h>
#define rep(i , a , b) for(int i = a ; i <= b ; i ++)
using namespace std;
const int N = 3e5 + 10;
int a[N][10];
vector<int>ans;
signed main()
{
	int n ;
	cin >> n;
	rep(i , 1 , n) rep(j , 1 , 5) cin >> a[i][j];
	if(n > 11) return cout << 0 << '\n' , 0;
	rep(i , 1 , n)
	{
		int flag = 0;
		rep(j , 1 , n)
		{
			if(i == j) continue ;
			rep(k , 1 , n)
			{
				if(i == k || k == j) continue ;
				int z = 0;
				rep(h , 1 , 5) z += (a[j][h] - a[i][h]) * (a[k][h] - a[i][h]);
				if(z > 0) {flag = 1 ; break ; }
			}
			if(flag) break ;
		}
		if(!flag) ans.push_back(i);
	}
	cout << ans.size() << '\n';
	for(auto i : ans) cout << i << " ";
	cout << '\n';
	return 0;
}