You are on page 1of 1

#include<iostream>

using namespace std;


int main()
{int x, y, z;
cin>>z>>x;
while(x)
{cin>>y;
if(z<y-x)
cout<<"->"<<x%10<<endl;
else
cout<<"->"<<y%10<<endl;
x=y;
}
return 0;
}

You might also like