锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int a[16], k, p;
char path[100];
char ch[] =
{'L', 'U', 'D', 'R'};
int dir[] =
{-1, -4, 4, 1};
int m[16][16] =
{0};
bool go[][4] =
{
0, 0, 1, 1,
1, 0, 1, 1,
1, 0, 1, 1,
1, 0, 1, 0,
0, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 0,
0, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 0,
0, 1, 0, 1,
1, 1, 0, 1,
1, 1, 0, 1,
1, 1, 0, 0,
};

struct point
{
int x, y;

bool operator<(const point & p)const
{
return x < p.x;
}
};

void swap(int i)
{
a[p] = a[p + dir[i]];
a[p += dir[i]] = 0;
}

bool dfs(int step, int mht, int x)
{
if (mht == 0)
{
path[step] = 0;
puts(path);
return 1;
}
int cnt = 0;
point c[4];
for (int i = 0; i < 4; i++)
{
if (!go[p][i] || i == x)continue;
int t = p + dir[i];
c[cnt].x = mht + m[p][a[t] - 1] - m[t][a[t] - 1];
if (c[cnt].x + step <= k)c[cnt++].y = i;
}
sort(c, c + cnt);
for (int i = 0; i < cnt; i++)
{
path[step] = ch[c[i].y];
swap(c[i].y);
if (dfs(step + 1, c[i].x, 3 - c[i].y))return 1;
swap(3 - c[i].y);
}
return 0;
}

int main()
{
for (int i = 0; i < 16; i++)
for (int j = i + 1; j < 16; j++)
m[i][j] = m[j][i] = abs(i / 4 - j / 4) + abs(i % 4 - j % 4);
int T;
scanf("%d", &T);
while (T--)
{
int cnt = 0;
for (int i = 0; i < 16; i++)
{
scanf("%d", &a[i]);
if (a[i] == 0)p = i;
for (int j = 0; j < i; j++)
cnt += a[j] > a[i];
}
if (((cnt + m[p][15])&1) == 0)
puts("This puzzle is not solvable.");
else
{
int mht = 0;
for (int i = 0; i < 16; i++)
if (a[i]) mht += m[i][a[i] - 1];
for (k = mht; k < 51 && !dfs(0, mht, -1); k++);
}
}
return 0;
}
//鎼滅儲(chǔ)鍏ラ棬
#include <stdio.h>
#include <algorithm>
using namespace std;
int length,a[64],n,sum;
bool ok,v[64]=
{0};
void dfs(int i,int size,int step)
{
if(size==length)i=0,size=0,step--;
if(step==0)ok=1;
for(int old=-1;!ok&&i<n;i++)
if(!v[i]&&a[i]!=old&&(size+a[i])<=length)
{
v[i]=1;
old=a[i];
dfs(i+1,size+a[i],step);
v[i]=0;
if(size==0)return;
}
}
bool cmp(int x,int y)
{return x>y;}
int main()
{
while(scanf("%d",&n),n)
{
sum=0,ok=0;
for(int i=0;i<n;i++)
{scanf("%d",&a[i]);sum+=a[i];}
sort(a,a+n,cmp);
for(length=a[0];!ok&&length<=sum;length++)
if(sum%length==0)
{
dfs(0,0,(sum/length)-1);
if(ok)printf("%d\n",length);
}
}
return 0;
}