#include <bits/stdc++.h>
#define Buff ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define oo 1e9
#define fi first
#define se second
#define ii pair<int,int>
#define ll long long
#define eps 0.00001
#define Mask(i) (1LL<<(i))
#define getbit(x,i) ((x>>(k-1))&1)
#define cbit(x) __builtin_popcountll(x)
#define onbit(x,k) ((x)|1LL<<(k-1))
#define offbit(x,k) ((x)&~(1LL<<(k-1)))
#define mod 1e9 + 7
#define FU(i,a,b) for (int i=(a);i<=(b);i++)
#define FD(i,a,b) for (int i=(a);i>=(b);i--)
#define input freopen("1.inp","r",stdin)
#define output freopen("1.out","w",stdout)
#define pb push_back
#define sz(x) (int)x.size()
#define ALL(x) x.begin(),x.end()
#define dad(i) (i+i&(-i))
#define child(i) (i-i&(-i))
#define endl '\n'
using namespace std;
const int maxn =1e5+1;
string trace;
int x,y;
void inp(){
cin>>trace;
}
void cal_step(char move,int nsteps){
// y asis
if (move=='U'||move=='D'){
y+=(move=='U'?nsteps:-nsteps);
}
// x asis
if (move=='L'||move=='R'){
x+=(move=='R'?nsteps:-nsteps);
}
}
void isPrime(int a){
if (a<=1) return;
if (a%2==0&&a!=2) return;
for (int i=3;i*i<=a;i+=2){
if (a%i==0) return;
}
cout<<"Number "<<a<<" is prime number";
}
void isSquared(int a){
int tmp=sqrt(a);
if (tmp*tmp==a) cout<<"Number "<<a<<" is square number";
}
void run(){
for (int i=0;i<=sz(trace)-1;i+=2) cal_step(trace[i],(int)trace[i+1]-'0');
double d=sqrt(x*x+y*y);// distance
int res=round(d);\
cout<<"The distance the vehicle has moved from the origin to the current point is: "<<res<<endl;
isPrime(res);
isSquared(res);
}
int main(){
Buff;
// input;
// output;
inp();
run();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgQnVmZiAgCQkgICAgICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oMCksY2luLnRpZSgwKSxjb3V0LnRpZSgwKQojZGVmaW5lIG9vIAkJCSAgICAgICAgMWU5CiNkZWZpbmUgZmkgCQkJICAgICAgICBmaXJzdAojZGVmaW5lIHNlIAkJCSAgICAgICAgc2Vjb25kCiNkZWZpbmUgaWkgCQkJICAgICAgICBwYWlyPGludCxpbnQ+CiNkZWZpbmUgbGwgCQkJICAgICAgICBsb25nIGxvbmcKI2RlZmluZSBlcHMgCQkgICAgICAgIDAuMDAwMDEKI2RlZmluZSBNYXNrKGkpICAgICAgICAgICAgICgxTEw8PChpKSkKI2RlZmluZSBnZXRiaXQoeCxpKSAgICAgICAgICgoeD4+KGstMSkpJjEpCiNkZWZpbmUgY2JpdCh4KQkJICAgICAgICBfX2J1aWx0aW5fcG9wY291bnRsbCh4KQojZGVmaW5lIG9uYml0KHgsaykgCSAgICAgICAgKCh4KXwxTEw8PChrLTEpKQojZGVmaW5lIG9mZmJpdCh4LGspICAgICAgICAgKCh4KSZ+KDFMTDw8KGstMSkpKQojZGVmaW5lIG1vZCAJCSAgICAgICAgMWU5ICsgNwojZGVmaW5lIEZVKGksYSxiKSAJICAgICAgICBmb3IgKGludCBpPShhKTtpPD0oYik7aSsrKQojZGVmaW5lIEZEKGksYSxiKSAJICAgICAgICBmb3IgKGludCBpPShhKTtpPj0oYik7aS0tKQojZGVmaW5lIGlucHV0IAkJICAgICAgICBmcmVvcGVuKCIxLmlucCIsInIiLHN0ZGluKQojZGVmaW5lIG91dHB1dCAgICAgICAgICAgICAgZnJlb3BlbigiMS5vdXQiLCJ3IixzdGRvdXQpCiNkZWZpbmUgcGIgICAgICAgICAgICAgICAgICBwdXNoX2JhY2sKI2RlZmluZSBzeih4KSAgICAgICAgICAgICAgIChpbnQpeC5zaXplKCkKI2RlZmluZSBBTEwoeCkgICAgICAgICAgICAgIHguYmVnaW4oKSx4LmVuZCgpCiNkZWZpbmUgZGFkKGkpICAgICAgICAgICAgICAoaStpJigtaSkpCiNkZWZpbmUgY2hpbGQoaSkgICAgICAgICAgICAoaS1pJigtaSkpCiNkZWZpbmUgZW5k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