stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll inf=0x3f3f3f3f;

ll a[3005];

int main(){

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

    ll n;

    cin>>n;

    ll sum=0;

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

        cin>>a[i];

        sum+=a[i]-1;

    }

    cout<<sum<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.29876993971376x):
#include<stdio.h>

int main()

{

    int t,b;

    int sum=0;

    scanf("%d",&t);

    while(t--)

    {

        scanf("%d",&b);

        sum=sum+b-1;

    }

    printf("%d\n",sum);

    return 0;

}
// Slower C++ solution:
#include<iostream> 

#include<string>

#include<cstring>

#include<algorithm>

#include<cstdio>

#include<cmath>

#include<set>

#include<map>

#include<vector>

#include<queue>

#include<sstream>

using namespace std;

 

#define sf scanf

#define pf printf

#define pfn printf("\n");

#define pfk printf(" ");

#define pf0 printf("0");

#define pf1 printf("1");

#define ll long long

#define sfd(n) scanf("%d",&n);

#define sfdd(n,m) scanf("%d%d",&n,&m);

#define sfld(n) scanf("%lld",&n);

#define sfldd(n,m) scanf("%lld%lld",&n,&m);

#define sflf(n) scanf("%lf",&n);

#define sflff(n,m) scanf("%lf%lf",&n,&m);

#define sfc(n) scanf("%c",n);

#define sfcc(n,m) scanf("%c%c",n,m);

#define sfs(n) scanf("%s",n);

#define sfss(n,m) scanf("%s%s",n,m);

#define pfd(n) printf("%d",n);

#define pfld(n) printf("%lld",n);

#define pflf(n) printf("%lf",n);

#define pfc(n) printf("%c",n);

#define pfs(n) printf("%s",n);

 

#define csh(a,n) memset(a,n,sizeof(a));

int arr[1001][1001];

int main(){

	int t,n,m;

	cin>>n;

	int sum=0;

	for(int i=0;i<n;i++){

		int a;

		cin>>a;

		sum+=a-1;

	} 

	cout<<sum<<endl;

} 

// Faster C++ solution for the same problem (measured speedup: 5.235060577253185x):
#include<stdio.h>

int main()

{

    int t,b;

    int sum=0;

    scanf("%d",&t);

    while(t--)

    {

        scanf("%d",&b);

        sum=sum+b-1;

    }

    printf("%d\n",sum);

    return 0;

}
// Slower C++ solution:
/*g++ main.cpp -o main.out*/

/*./main.out*/



#include <map>

#include <set>

#include <list>

#include <cmath>

#include <ctime>

#include <deque>

#include <queue>

#include <stack>

#include <bitset>

#include <cctype>

#include <cstdio>

#include <string>

#include <vector>

#include <climits>

#include <cstdlib>

#include <cstring>

#include <fstream>

#include <iomanip>

#include <sstream>

#include <iostream>

#include <iterator>

#include <algorithm>

using namespace std;



#define LL long long

#define LD long double

#define Mod 1000000007

#define L_Mod 17100000013



const double eps = 1e-9;

const int INF = 0x3f3f3f3f;

const double PI = 3.1415926535;



#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);



#define ree(a,n) memset(a,n,sizeof(a));



#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))

#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))

#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))



LL lcm(LL a,LL b)

{

    return a*b/__gcd(a,b);

}



LL a[100005];



int main()

{

    NO_TLE

    int n;

    cin>>n;

//    rep(i,n)cin>>a[i];

//    LL l=a[0];

//    rer(i,1,n-1)

//    {

//        LL t=__gcd(l,a[i]);

//        l=l/t*a[i];

//    }

//    LL sum=0;

//    l--;

//    rep(i,n)sum+=l%a[i];

//    cout<<sum<<endl;

    LL sum=0,x;

    while(n--)

    {

        cin>>x;

        sum+=x-1;

    }

    cout<<sum<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3105451573203455x):
#include<stdio.h>

int main()

{

    int t,b;

    int sum=0;

    scanf("%d",&t);

    while(t--)

    {

        scanf("%d",&b);

        sum=sum+b-1;

    }

    printf("%d\n",sum);

    return 0;

}
// Slower C++ solution:
#include <stdio.h>

#include <stdlib.h>

#include <iostream>

#include <algorithm>

#include <string.h>

#include <sstream>

#include <stack>



using namespace std;



int main()

{

   int n;

   scanf("%d",&n);

   int *a=new int[n];

   for(int i=0;i<n;++i)

   {

       scanf("%d",&a[i]);

   }

   int sum=0;

   for(int i=0;i<n;++i)

   {

       sum+=a[i]-1;

   }

   printf("%d\n",sum);

}


// Faster C++ solution for the same problem (measured speedup: 5.173323978717476x):
#include<stdio.h>

int main()

{

    int t,b;

    int sum=0;

    scanf("%d",&t);

    while(t--)

    {

        scanf("%d",&b);

        sum=sum+b-1;

    }

    printf("%d\n",sum);

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define dint __int128

#define ll long long

#define fup(i,a,b) for(int i=a;i<=b;++i)

#define upf(i,a,b) for(int i=a;i<b;++i)

#define fdn(i,a,b) for(int i=a;i>=b;++i)

#define dnf(i,a,b) for(int i=a;i>b;++i)

#define hh putchar(10)

#define kg putchar(32)

inline ll read(){ll x,f=1;char a;while((a=getchar())<48||a>57)if(a=='-')f=-1;

for(x=a^48;(a=getchar())>47&&a<58;x=(x<<3)+(x<<1)+(a^48));return f*x;}



void Main()

{

    int n;

    cin>>n;

    int a,ans=0;

    fup(i,1,n)cin>>a,ans+=(a-1);

    cout<<ans;

}

int main()

{

    Main();

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.186411077867125x):
#include<stdio.h>

int main()

{

    int t,b;

    int sum=0;

    scanf("%d",&t);

    while(t--)

    {

        scanf("%d",&b);

        sum=sum+b-1;

    }

    printf("%d\n",sum);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

int main () {

	int n,x,i,sum=0;

	cin>>n;

	for(i=0;i<n;i++){

    cin>>x;

    sum+=x;

	}

	sum-=n;

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 5.223379448436891x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int N, sum = 0;



int main() {

    cin >> N;

    int a[N];

    for (int i = 0; i < N; i++) cin >> a[i];

    for (int k = 0; k < N; k++) {

        sum += a[k] - 1;

    }

    cout << sum << endl;

    

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.234950727049478x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll inf=0x3f3f3f3f;

ll a[3005];

int main(){

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

    ll n;

    cin>>n;

    ll sum=0;

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

        cin>>a[i];

        sum+=a[i]-1;

    }

    cout<<sum<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.2956988649033025x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
#include<iostream> 

#include<string>

#include<cstring>

#include<algorithm>

#include<cstdio>

#include<cmath>

#include<set>

#include<map>

#include<vector>

#include<queue>

#include<sstream>

using namespace std;

 

#define sf scanf

#define pf printf

#define pfn printf("\n");

#define pfk printf(" ");

#define pf0 printf("0");

#define pf1 printf("1");

#define ll long long

#define sfd(n) scanf("%d",&n);

#define sfdd(n,m) scanf("%d%d",&n,&m);

#define sfld(n) scanf("%lld",&n);

#define sfldd(n,m) scanf("%lld%lld",&n,&m);

#define sflf(n) scanf("%lf",&n);

#define sflff(n,m) scanf("%lf%lf",&n,&m);

#define sfc(n) scanf("%c",n);

#define sfcc(n,m) scanf("%c%c",n,m);

#define sfs(n) scanf("%s",n);

#define sfss(n,m) scanf("%s%s",n,m);

#define pfd(n) printf("%d",n);

#define pfld(n) printf("%lld",n);

#define pflf(n) printf("%lf",n);

#define pfc(n) printf("%c",n);

#define pfs(n) printf("%s",n);

 

#define csh(a,n) memset(a,n,sizeof(a));

int arr[1001][1001];

int main(){

	int t,n,m;

	cin>>n;

	int sum=0;

	for(int i=0;i<n;i++){

		int a;

		cin>>a;

		sum+=a-1;

	} 

	cout<<sum<<endl;

} 

// Faster C++ solution for the same problem (measured speedup: 5.232026427280088x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
/*g++ main.cpp -o main.out*/

/*./main.out*/



#include <map>

#include <set>

#include <list>

#include <cmath>

#include <ctime>

#include <deque>

#include <queue>

#include <stack>

#include <bitset>

#include <cctype>

#include <cstdio>

#include <string>

#include <vector>

#include <climits>

#include <cstdlib>

#include <cstring>

#include <fstream>

#include <iomanip>

#include <sstream>

#include <iostream>

#include <iterator>

#include <algorithm>

using namespace std;



#define LL long long

#define LD long double

#define Mod 1000000007

#define L_Mod 17100000013



const double eps = 1e-9;

const int INF = 0x3f3f3f3f;

const double PI = 3.1415926535;



#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);



#define ree(a,n) memset(a,n,sizeof(a));



#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))

#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))

#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))



LL lcm(LL a,LL b)

{

    return a*b/__gcd(a,b);

}



LL a[100005];



int main()

{

    NO_TLE

    int n;

    cin>>n;

//    rep(i,n)cin>>a[i];

//    LL l=a[0];

//    rer(i,1,n-1)

//    {

//        LL t=__gcd(l,a[i]);

//        l=l/t*a[i];

//    }

//    LL sum=0;

//    l--;

//    rep(i,n)sum+=l%a[i];

//    cout<<sum<<endl;

    LL sum=0,x;

    while(n--)

    {

        cin>>x;

        sum+=x-1;

    }

    cout<<sum<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.307467257798758x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
#include <stdio.h>

#include <stdlib.h>

#include <iostream>

#include <algorithm>

#include <string.h>

#include <sstream>

#include <stack>



using namespace std;



int main()

{

   int n;

   scanf("%d",&n);

   int *a=new int[n];

   for(int i=0;i<n;++i)

   {

       scanf("%d",&a[i]);

   }

   int sum=0;

   for(int i=0;i<n;++i)

   {

       sum+=a[i]-1;

   }

   printf("%d\n",sum);

}


// Faster C++ solution for the same problem (measured speedup: 5.170325610202115x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define dint __int128

#define ll long long

#define fup(i,a,b) for(int i=a;i<=b;++i)

#define upf(i,a,b) for(int i=a;i<b;++i)

#define fdn(i,a,b) for(int i=a;i>=b;++i)

#define dnf(i,a,b) for(int i=a;i>b;++i)

#define hh putchar(10)

#define kg putchar(32)

inline ll read(){ll x,f=1;char a;while((a=getchar())<48||a>57)if(a=='-')f=-1;

for(x=a^48;(a=getchar())>47&&a<58;x=(x<<3)+(x<<1)+(a^48));return f*x;}



void Main()

{

    int n;

    cin>>n;

    int a,ans=0;

    fup(i,1,n)cin>>a,ans+=(a-1);

    cout<<ans;

}

int main()

{

    Main();

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.1834051242969315x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int n,tmp,ans;

int main(){

	cin>>n;

	while(n--){

		cin>>tmp;

		ans+=(tmp-1);

	}

	cout<<ans<<endl;

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.231413025166811x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	int n,sum,i,b,a[200000];

	cin>>n;

	sum=0;

	for(i=0;i<n;i++)

	{

		scanf("%d",&b);

		sum+=b;

	}

	cout<<sum-n<<endl;

	return 0;

 } 

// Faster C++ solution for the same problem (measured speedup: 5.244688599757966x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>



using namespace __gnu_pbds;  

using namespace std;



typedef long long ll;



typedef tree<

pair <int, int>,

null_type,

less<pair <int, int>>,

rb_tree_tag,

tree_order_statistics_node_update>

os;



double getTime() {

  return clock() / (double) CLOCKS_PER_SEC;

}



void read() {};



template<typename T, typename... Args>

void read(T& a, Args&... args) {

  cin >> a;

  read(args...);

}



void print() {};



template <typename T, typename... Args>

void print(T a, Args... args) {

  cout << a << " \n"[sizeof...(args) == 0];

  print(args...);

}



int main() {

  int n; cin >> n;

  vector <int> a(n);

  for(auto &x : a) cin >> x;

  cout << accumulate(a.begin(), a.end(), 0) - n << '\n';

}


// Faster C++ solution for the same problem (measured speedup: 5.279189669070283x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
/*

        Author: Prokash

                CSE48, JU



*/



#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

int ara[2005];

int main()

{

    FAST;

    ll n;

    cin>>n;

    ll ans=0;

    while(n--)

    {

        int in;

        cin>>in;

        ans+=(in-1);//counting (lcm-1) sum;

    }

    cout<<ans<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.307802080905233x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,sum=0;

    cin>>n;

    int i,a[n];

    for(i=0;i<n;i++)

        cin>>a[i];

    for(i=0;i<n;i++)

        sum=sum+a[i];

        sum=sum-n;

    cout<<sum<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.232904849680161x):
#include<stdio.h>

int main()

{

    int n,i,count=0;

    scanf("%d",&n);

    int a[n];

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    for(i=0;i<n;i++)

    {

        count+=a[i];

    }

    count=count-n;

    printf("%d\n",count);

}
// Slower C++ solution:
#include <stdio.h>

#include <iostream>

#include <algorithm>

#include <string>

#include <iomanip>

#include <math.h>

#include <utility>



#define div1 1000000007



using namespace std;



int main(void)

{

    long long N, X[100001], L[100001], i, S[100001], T[100001], ans=0, t=-10000000000;



    cin >> N;



    for(i=1; i<=N; i++){

        cin >> X[i] >> L[i];

        

        S[i] = X[i] - L[i];

        T[i] = X[i] + L[i];

    }



    pair<int, int> itv[100001];



    for(i=1; i<=N; i++){

        itv[i].first = T[i];//終

        itv[i].second = S[i];//始

    }



    sort(itv+1, itv+N+1);



    for(i=1; i<=N; i++){

        if(t <= itv[i].second){

            ans++;

            t = itv[i].first;

        }

    }



    cout << ans << endl;



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8889511745959282x):
#include <stdio.h>

#include <iostream>

#include <algorithm>

#include <string>

#include <iomanip>

#include <math.h>

#include <utility>

#include <vector>

#include <map>

#include <unordered_map>

#include <cstdlib>

#include <stack>

#include <queue>

#define div1 1000000007

const long long INF = 1LL << 60;

using namespace std;

using ll = long long;

using ld = long double;

// a>b -> a==b;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

// a<b -> a==b;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



int main(void)

{

    ll N, i, x, l, t, ans=0;

    

    cin >> N;



    vector<pair<ll,ll>> p(N);



    for(i=0; i<N; i++){

        cin >> x >> l;

        p[i].first = x+l; // 終

        p[i].second = x-l; // 始

    }



    sort(p.begin(), p.end());



    t = -10000000000;



    for(i=0; i<N; i++){

        if(t <= p[i].second){

            ans++;

            t = p[i].first;

        }

    }



    cout << ans << endl;



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)

typedef pair<int, int> P;



int n;

P robots[101010];



int main(){

  cin >> n;

  rep(i, n){

    int x, l;

    cin >> x >> l;

    robots[i].second = x - l;

    robots[i].first = x + l;

  }

  sort(robots, robots + n);

  //rep(i, n) cerr << robots[i].second << " " << robots[i].first << endl;

  int pos = -1000000000;

  int ans = 0;

  for(P x : robots){

    if(x.second >= pos){

      pos = x.first;

      ans++;

    }

  }

  cout << ans << endl;

  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.790675976337799x):
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)

typedef long long int ll;

typedef pair<int, int> P;



int n;

P sec[101010];



int main()

{

    cin >> n;

    rep(i, n)

    {

        int x, l;

        cin >> x >> l;

        sec[i].first = x + l;

        sec[i].second = x - l;

    }

    sort(sec, sec + n);



    int res = 0, pos = -1000000001;

    rep(i, n)

    {

        if(pos <= sec[i].second)

        {

            pos = sec[i].first;

            res++;

        }

    }

    cout << res << endl;



    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <cstring>

#include <queue>

using std::queue;



const int N = 500 + 10;



int n;

char s[N][20];

int g[255][255];

int deg[255];

queue<int> Q;



bool topsort()

{

	while(!Q.empty()) Q.pop();

	for(int i = 0; i < 255; i++) if(deg[i] == 0) Q.push(i);

	int cnt = 0;

	while(!Q.empty())

	{

		int x = Q.front(); Q.pop(); cnt++;

		for(int i = 0; i < 255; i++)

			if(g[x][i] == 1)

			{

				deg[i]--;

				if(deg[i] == 0) Q.push(i);

			}

	}

	//printf("cnt = %d\n", cnt);

	return cnt == 255;

}



bool solve()

{

	memset(g, 0, sizeof(g));

	memset(deg, 0, sizeof(deg));

	for(int i = 2; i <= n; i++)

	{

		for(int j = 0; s[i][j] || s[i-1][j]; j++)

		{

			if(s[i][j] == s[i-1][j]) continue;

			if(!s[i][j]) return 0;

			char lesser = s[i-1][j], larger = s[i][j];

			if(g[larger][lesser] == 1) return 0;

			if(g[lesser][larger] == 0)

			{

				g[lesser][larger] = 1;

				deg[larger]++;

			}

			break;

		}

	}

	return topsort();

}



int main()

{

	while(scanf("%d", &n) == 1 && n)

	{

		memset(s, 0, sizeof(s));

		for(int i = 1; i <= n; i++) scanf("%s", s[i]);

		if(solve()) puts("yes"); else puts("no");

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.3879807215645423x):
#include<bits/stdc++.h>

using namespace std;

set<int> G[26];

typedef set<int>::iterator it;

int n;

string s[505];

bool flag;

bool vis[26];

int in[26];

int main()

{

	while(~scanf("%d",&n)&&n)

	{

		for(int i=0;i<n;i++)

			cin>>s[i];

		for(int i=0;i<26;i++)

			G[i].clear(),vis[i] = 0,in[i] = 0;

		flag = true;

		for(int x=1;x<n;x++)

			for(int y=0;y<x;y++)

		    {

			    int len1 = s[y].size();

			    int len2 = s[x].size();

			    bool flag1 = true;

			    for(int i=0;i<min(len1,len2);i++)

				    if(s[y][i]!=s[x][i])

			        {

			    	    flag1 = false;

			    	    G[s[y][i]-'a'].insert(s[x][i]-'a');

			    	    break;

			        }

			    if(flag1&&len1>len2)

				    flag = false;

		    }

		int cnt = 0;

		for(int i=0;i<26;i++)

			for(it p = G[i].begin();p!=G[i].end();p++)

			    in[*p]++,cnt++;

		while(1)

		{

			bool flag1 = true;

			for(int i=0;i<26;i++)

				if(in[i]==0&&!vis[i])

				{

					flag1 = false;

					vis[i] = 1;

				    for(it p = G[i].begin();p != G[i].end();p++)

			        {

			        	int v = *p;

			        	cnt--;

			        	in[v]--;

			        }

				}

			if(flag1) break;

		}

		if(cnt!=0) flag = false;

		puts(flag?"yes":"no");

	}

	return 0;

}