#include using namespace std; int sign(int x){ return x? x>0? +1: -1: 0; } struct vec2{ int x,y; vec2(int x,int y):x(x),y(y){} }; int main(){ string s; cin>>s; int const n=s.length(); vector moves; for (auto i: s) switch (i){ case 'U': moves.emplace_back(0,+1); break; case 'D': moves.emplace_back(0,-1); break; case 'L': moves.emplace_back(-1,0); break; case 'R': moves.emplace_back(+1,0); break; default: assert(false); } // Cases with three or more final moves in the same direction are impossible, // because it is impossible to avoid going over the target twice. if (moves.size()>=3 and abs(moves[n-3].x)==abs(moves[n-2].x) and abs(moves[n-2].x)==abs(moves[n-1].x)){ cout<<"impossible"< blocks; int radius=0; vec2 ball={0,0}; for (int i=0; i