// Don't place your source in a package
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

// Please name your class Main
public class Main {

	static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

    static int read() throws IOException {
        in.nextToken();
        return (int) in.nval;
    }
    static String readString() throws IOException {
        in.nextToken();
        return in.sval;
	}

	public static void main (String[] args) throws java.lang.Exception {
	    Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		//InputReader in = new InputReader(System.in);

		int T=in.nextInt();

		for(int t=0;t<T;t++){
			int n=in.nextInt();
			int A[]=new int[n];
			int B[]=new int[n];
			int C[]=new int[n];
			for(int i=0;i<n;i++){
				A[i]=in.nextInt();
			}
			for(int i=0;i<n;i++){
				B[i]=in.nextInt();
			}
			for(int i=0;i<n;i++){
				C[i]=in.nextInt();
			}
			Solution sol=new Solution();
			sol.solution(A,B,C);
		}

		out.flush();
	}

}

class Solution{
	//constant variable
	final int MAX=Integer.MAX_VALUE;
	final int MIN=Integer.MIN_VALUE;
	//Set<Integer>adjecent[];
	//////////////////////////////

	public void solution(int A[],int B[],int C[]){

		int n=A.length;
		int pre=A[0];
		msg1(A[0]+" ");
		for(int i=1;i<n;i++){
			if(i==n-1){
				if(A[i]!=pre&&A[i]!=A[0]){
					msg1(A[i]+" ");
					pre=A[i];
				}else if(B[i]!=pre&&B[i]!=A[0]){
					msg1(B[i]+" ");
					pre=B[i];
				}else if(C[i]!=pre&&C[i]!=A[0]){
					msg1(C[i]+" ");
					pre=C[i];
				}
				continue;
			}

			if(A[i]!=pre){
				msg1(A[i]+" ");
				pre=A[i];
			}else if(B[i]!=pre){
				msg1(B[i]+" ");
				pre=B[i];
			}else{
				msg1(C[i]+" ");
				pre=C[i];
			}
		}
		msg("");
	}

	public void swap(int A[],int l,int r){
		int t=A[l];
		A[l]=A[r];
		A[r]=t;
	}

	public long C(long fact[],int i,int j){ // C(20,3)=20!/(17!*3!)
		// take   a/b     where a=20!  b=17!*3!
		if(j>i)return 0;
		if(j==0)return 1;
		long mod=998244353;
		long a=fact[i];
		long b=((fact[i-j]%mod)*(fact[j]%mod))%mod;
		BigInteger B= BigInteger.valueOf(b);
		long binverse=B.modInverse(BigInteger.valueOf(mod)).longValue();
		return ((a)*(binverse%mod))%mod;
	}

	//map operation
	public void put(Map<Integer,Integer>map,int i){
		if(!map.containsKey(i))map.put(i,0);
		map.put(i,map.get(i)+1);
	}

	public void delete(Map<Integer,Integer>map,int i){
		map.put(i,map.get(i)-1);
		if(map.get(i)==0)map.remove(i);
	}

	/*public void tarjan(int p,int r){
		if(cut)return;
		List<Integer>childs=adjecent[r];
		dis[r]=low[r]=time;
		time++;

		//core for tarjan
		int son=0;
		for(int c:childs){
			if(ban==c||c==p)continue;
			if(dis[c]==-1){
				son++;
				tarjan(r,c);
				low[r]=Math.min(low[r],low[c]);
				if((r==root&&son>1)||(low[c]>=dis[r]&&r!=root)){
					cut=true;
					return;
				}
			}else{
				if(c!=p){
					low[r]=Math.min(low[r],dis[c]);
				}
			}
		}

	}*/

	//helper function I would use
	public void remove(Map<Integer,Integer>map,int i){
		map.put(i,map.get(i)-1);
		if(map.get(i)==0)map.remove(i);
	}

	public void ascii(String s){
		for(char c:s.toCharArray()){
			System.out.print((c-'a')+" ");
		}
		msg("");
	}

	public int flip(int i){
		if(i==0)return 1;
		else return 0;
	}

	public boolean[] primes(int n){
		boolean A[]=new boolean[n+1];
		for(int i=2;i<=n;i++){
			if(A[i]==false){
				for(int j=i+i;j<=n;j+=i){
					A[j]=true;
				}
			}
		}
		return A;
	}

	public void msg(String s){
		System.out.println(s);
	}

	public void msg1(String s){
		System.out.print(s);
	}

	public int[] kmpPre(String p){
		int pre[]=new int[p.length()];
		int l=0,r=1;
		while(r<p.length()){
			if(p.charAt(l)==p.charAt(r)){
				pre[r]=l+1;
				l++;r++;
			}else{
				if(l==0)r++;
				else l=pre[l-1];
			}
		}
		return pre;
	}

	public boolean isP(String s){
		int l=0,r=s.length()-1;
		while(l<r){
			if(s.charAt(l)!=s.charAt(r))return false;
			l++;r--;
		}
		return true;
	}

	public int find(int nums[],int x){//union find => find method
		if(nums[x]==x)return x;
		int root=find(nums,nums[x]);
		nums[x]=root;
		return root;
	}

	public int get(int A[],int i){
		if(i<0||i>=A.length)return 0;
		return A[i];
	}
	public int[] copy1(int A[]){
		int a[]=new int[A.length];
		for(int i=0;i<a.length;i++)a[i]=A[i];
		return a;
	}

	public int[] copy2(int A[]){
		int a[]=new int[A.length];
		for(int i=0;i<a.length;i++)a[i]=A[i];
		return a;
	}

	public void print1(long A[]){
		for(long i:A)System.out.print(i+" ");
		System.out.println();
	}
	public void print2(long A[][]){
		for(int i=0;i<A.length;i++){
			for(int j=0;j<A[0].length;j++){
				System.out.print(A[i][j]+" ");
			}System.out.println();
		}
	}

	public int min(int a,int b){
		return Math.min(a,b);
	}

	public int[][] matrixdp(int[][] grid) {
        if(grid.length==0)return new int[][]{};
        int res[][]=new int[grid.length][grid[0].length];
        for(int i=0;i<grid.length;i++){
            for(int j=0;j<grid[0].length;j++){
                res[i][j]=grid[i][j]+get(res,i-1,j)+get(res,i,j-1)-get(res,i-1,j-1);
            }
        }
        return res;
    }

    public int get(int grid[][],int i,int j){
        if(i<0||j<0||i>=grid.length||j>=grid[0].length)return 0;
        return grid[i][j];
    }

	public int[] suffixArray(String s){
		int n=s.length();
		Suffix A[]=new Suffix[n];

		for(int i=0;i<n;i++){
			A[i]=new Suffix(i,s.charAt(i)-'a',0);
		}

		for(int i=0;i<n;i++){
			if(i==n-1){
				A[i].next=-1;
			}else{
				A[i].next=A[i+1].rank;
			}
		}
		Arrays.sort(A);

		for(int len=4;len<A.length*2;len<<=1){
			int in[]=new int[A.length];
			int rank=0;
			int pre=A[0].rank;
			A[0].rank=rank;
			in[A[0].index]=0;
			for(int i=1;i<A.length;i++){//rank for the first two letter
				if(A[i].rank==pre&&A[i].next==A[i-1].next){
					pre=A[i].rank;
					A[i].rank=rank;
				}else{
					pre=A[i].rank;
					A[i].rank=++rank;
				}
				in[A[i].index]=i;
			}

			for(int i=0;i<A.length;i++){
				int next=A[i].index+len/2;
				if(next>=A.length){
					A[i].next=-1;
				}else{
					A[i].next=A[in[next]].rank;
				}
			}

			Arrays.sort(A);
		}

		int su[]=new int[A.length];
		for(int i=0;i<su.length;i++){
			su[i]=A[i].index;
		}
		return su;
	}

}

//suffix array Struct
class Suffix implements Comparable<Suffix>{
	int index;
	int rank;
	int next;
	public Suffix(int i,int rank,int next){
		this.index=i;
		this.rank=rank;
		this.next=next;
	}

	@Override
	public int compareTo(Suffix other) {
		if(this.rank==other.rank){
			return this.next-other.next;
		}
		return this.rank-other.rank;
	}

	public String toString(){
		return this.index+"   "+this.rank+"   "+this.next+"  ";
	}
}

class Wrapper implements Comparable<Wrapper>{
	int spf;int cnt;
	public Wrapper(int spf,int cnt){
		this.spf=spf;
		this.cnt=cnt;
	}

	@Override
	public int compareTo(Wrapper other) {
		return this.spf-other.spf;
	}
}

    class Node{//what the range would be for that particular node
		boolean state=false;
        int l=0,r=0;
		int ll=0,rr=0;
        public Node(boolean state){
            this.state=state;
        }
    }

	class Seg1{
			int A[];
			public Seg1(int A[]){
				this.A=A;
			}

			public void update(int left,int right,int val,int s,int e,int id){
				if(left<0||right<0||left>right)return;
				if(left==s&&right==e){

					A[id]+=val;
					return;
				}
				int mid=s+(e-s)/2; //[s,mid] [mid+1,e]

				if(left>=mid+1){
					update(left,right,val,mid+1,e,id*2+2);
				}else if(right<=mid){
					update(left,right,val,s,mid,id*2+1);
				}else{
					update(left,mid,val,s,mid,id*2+1);
					update(mid+1,right,val,mid+1,e,id*2+2);
				}
			}

			public int query(int i,int add,int s,int e,int id){

				if(s==e&&i==s){
					return A[id]+add;
				}

				int mid=s+(e-s)/2; //[s,mid] [mid+1,e]

				if(i>=mid+1){
					return query(i,A[id]+add,mid+1,e,id*2+2);
				}else{
					return query(i,A[id]+add,s,mid,id*2+1);
				}
			}
	}

	 class MaxFlow{

		  public static List<Edge>[] createGraph(int nodes) {
			List<Edge>[] graph = new List[nodes];
			for (int i = 0; i < nodes; i++)
			  graph[i] = new ArrayList<>();
			return graph;
		  }

		  public static void addEdge(List<Edge>[] graph, int s, int t, int cap) {
			graph[s].add(new Edge(t, graph[t].size(), cap));
			graph[t].add(new Edge(s, graph[s].size() - 1, 0));
		  }

		  static boolean dinicBfs(List<Edge>[] graph, int src, int dest, int[] dist) {
			Arrays.fill(dist, -1);
			dist[src] = 0;
			int[] Q = new int[graph.length];
			int sizeQ = 0;
			Q[sizeQ++] = src;
			for (int i = 0; i < sizeQ; i++) {
			  int u = Q[i];
			  for (Edge e : graph[u]) {
				if (dist[e.t] < 0 && e.f < e.cap) {
				  dist[e.t] = dist[u] + 1;
				  Q[sizeQ++] = e.t;
				}
			  }
			}
			return dist[dest] >= 0;
		  }

		  static int dinicDfs(List<Edge>[] graph, int[] ptr, int[] dist, int dest, int u, int f) {
			if (u == dest)
			  return f;
			for (; ptr[u] < graph[u].size(); ++ptr[u]) {
			  Edge e = graph[u].get(ptr[u]);
			  if (dist[e.t] == dist[u] + 1 && e.f < e.cap) {
				int df = dinicDfs(graph, ptr, dist, dest, e.t, Math.min(f, e.cap - e.f));
				if (df > 0) {
				  e.f += df;
				  graph[e.t].get(e.rev).f -= df;
				  return df;
				}
			  }
			}
			return 0;
		  }

		  public static int maxFlow(List<Edge>[] graph, int src, int dest) {
			int flow = 0;
			int[] dist = new int[graph.length];
			while (dinicBfs(graph, src, dest, dist)) {
			  int[] ptr = new int[graph.length];
			  while (true) {
				int df = dinicDfs(graph, ptr, dist, dest, src, Integer.MAX_VALUE);
				if (df == 0)
				  break;
				flow += df;
			  }
			}
			return flow;
		  }

	 }

	 	 class Edge {
			int t, rev, cap, f;

			public Edge(int t, int rev, int cap) {
			  this.t = t;
			  this.rev = rev;
			  this.cap = cap;
			}
		  }


// Don't place your source in a package
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

// Please name your class Main
public class Main {

	static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

    static int read() throws IOException {
        in.nextToken();
        return (int) in.nval;
    }
    static String readString() throws IOException {
        in.nextToken();
        return in.sval;
	}

	public static void main (String[] args) throws java.lang.Exception {
	    Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		//InputReader in = new InputReader(System.in);

		int T=in.nextInt();

		for(int t=0;t<T;t++){
			int n=in.nextInt();
			int A[]=new int[n];
			int B[]=new int[n];
			int C[]=new int[n];
			for(int i=0;i<n;i++){
				A[i]=in.nextInt();
			}
			for(int i=0;i<n;i++){
				B[i]=in.nextInt();
			}
			for(int i=0;i<n;i++){
				C[i]=in.nextInt();
			}
			Solution sol=new Solution();
			sol.solution(A,B,C);
		}

		out.flush();
	}

}

class Solution{
	//constant variable
	final int MAX=Integer.MAX_VALUE;
	final int MIN=Integer.MIN_VALUE;
	//Set<Integer>adjecent[];
	//////////////////////////////

	public void solution(int A[],int B[],int C[]){

		int n=A.length;
		int pre=-1;
		for(int i=0;i<n;i++){
			if(A[i]!=pre){
				msg1(A[i]+" ");
				pre=A[i];
			}else if(B[i]!=pre){
				msg1(B[i]+" ");
				pre=B[i];
			}else{
				msg1(C[i]+" ");
				pre=C[i];
			}
		}
		msg("");
	}

	public void swap(int A[],int l,int r){
		int t=A[l];
		A[l]=A[r];
		A[r]=t;
	}

	public long C(long fact[],int i,int j){ // C(20,3)=20!/(17!*3!)
		// take   a/b     where a=20!  b=17!*3!
		if(j>i)return 0;
		if(j==0)return 1;
		long mod=998244353;
		long a=fact[i];
		long b=((fact[i-j]%mod)*(fact[j]%mod))%mod;
		BigInteger B= BigInteger.valueOf(b);
		long binverse=B.modInverse(BigInteger.valueOf(mod)).longValue();
		return ((a)*(binverse%mod))%mod;
	}

	//map operation
	public void put(Map<Integer,Integer>map,int i){
		if(!map.containsKey(i))map.put(i,0);
		map.put(i,map.get(i)+1);
	}

	public void delete(Map<Integer,Integer>map,int i){
		map.put(i,map.get(i)-1);
		if(map.get(i)==0)map.remove(i);
	}

	/*public void tarjan(int p,int r){
		if(cut)return;
		List<Integer>childs=adjecent[r];
		dis[r]=low[r]=time;
		time++;

		//core for tarjan
		int son=0;
		for(int c:childs){
			if(ban==c||c==p)continue;
			if(dis[c]==-1){
				son++;
				tarjan(r,c);
				low[r]=Math.min(low[r],low[c]);
				if((r==root&&son>1)||(low[c]>=dis[r]&&r!=root)){
					cut=true;
					return;
				}
			}else{
				if(c!=p){
					low[r]=Math.min(low[r],dis[c]);
				}
			}
		}

	}*/

	//helper function I would use
	public void remove(Map<Integer,Integer>map,int i){
		map.put(i,map.get(i)-1);
		if(map.get(i)==0)map.remove(i);
	}

	public void ascii(String s){
		for(char c:s.toCharArray()){
			System.out.print((c-'a')+" ");
		}
		msg("");
	}

	public int flip(int i){
		if(i==0)return 1;
		else return 0;
	}

	public boolean[] primes(int n){
		boolean A[]=new boolean[n+1];
		for(int i=2;i<=n;i++){
			if(A[i]==false){
				for(int j=i+i;j<=n;j+=i){
					A[j]=true;
				}
			}
		}
		return A;
	}

	public void msg(String s){
		System.out.println(s);
	}

	public void msg1(String s){
		System.out.print(s);
	}

	public int[] kmpPre(String p){
		int pre[]=new int[p.length()];
		int l=0,r=1;
		while(r<p.length()){
			if(p.charAt(l)==p.charAt(r)){
				pre[r]=l+1;
				l++;r++;
			}else{
				if(l==0)r++;
				else l=pre[l-1];
			}
		}
		return pre;
	}

	public boolean isP(String s){
		int l=0,r=s.length()-1;
		while(l<r){
			if(s.charAt(l)!=s.charAt(r))return false;
			l++;r--;
		}
		return true;
	}

	public int find(int nums[],int x){//union find => find method
		if(nums[x]==x)return x;
		int root=find(nums,nums[x]);
		nums[x]=root;
		return root;
	}

	public int get(int A[],int i){
		if(i<0||i>=A.length)return 0;
		return A[i];
	}
	public int[] copy1(int A[]){
		int a[]=new int[A.length];
		for(int i=0;i<a.length;i++)a[i]=A[i];
		return a;
	}

	public int[] copy2(int A[]){
		int a[]=new int[A.length];
		for(int i=0;i<a.length;i++)a[i]=A[i];
		return a;
	}

	public void print1(long A[]){
		for(long i:A)System.out.print(i+" ");
		System.out.println();
	}
	public void print2(long A[][]){
		for(int i=0;i<A.length;i++){
			for(int j=0;j<A[0].length;j++){
				System.out.print(A[i][j]+" ");
			}System.out.println();
		}
	}

	public int min(int a,int b){
		return Math.min(a,b);
	}

	public int[][] matrixdp(int[][] grid) {
        if(grid.length==0)return new int[][]{};
        int res[][]=new int[grid.length][grid[0].length];
        for(int i=0;i<grid.length;i++){
            for(int j=0;j<grid[0].length;j++){
                res[i][j]=grid[i][j]+get(res,i-1,j)+get(res,i,j-1)-get(res,i-1,j-1);
            }
        }
        return res;
    }

    public int get(int grid[][],int i,int j){
        if(i<0||j<0||i>=grid.length||j>=grid[0].length)return 0;
        return grid[i][j];
    }

	public int[] suffixArray(String s){
		int n=s.length();
		Suffix A[]=new Suffix[n];

		for(int i=0;i<n;i++){
			A[i]=new Suffix(i,s.charAt(i)-'a',0);
		}

		for(int i=0;i<n;i++){
			if(i==n-1){
				A[i].next=-1;
			}else{
				A[i].next=A[i+1].rank;
			}
		}
		Arrays.sort(A);

		for(int len=4;len<A.length*2;len<<=1){
			int in[]=new int[A.length];
			int rank=0;
			int pre=A[0].rank;
			A[0].rank=rank;
			in[A[0].index]=0;
			for(int i=1;i<A.length;i++){//rank for the first two letter
				if(A[i].rank==pre&&A[i].next==A[i-1].next){
					pre=A[i].rank;
					A[i].rank=rank;
				}else{
					pre=A[i].rank;
					A[i].rank=++rank;
				}
				in[A[i].index]=i;
			}

			for(int i=0;i<A.length;i++){
				int next=A[i].index+len/2;
				if(next>=A.length){
					A[i].next=-1;
				}else{
					A[i].next=A[in[next]].rank;
				}
			}

			Arrays.sort(A);
		}

		int su[]=new int[A.length];
		for(int i=0;i<su.length;i++){
			su[i]=A[i].index;
		}
		return su;
	}

}

//suffix array Struct
class Suffix implements Comparable<Suffix>{
	int index;
	int rank;
	int next;
	public Suffix(int i,int rank,int next){
		this.index=i;
		this.rank=rank;
		this.next=next;
	}

	@Override
	public int compareTo(Suffix other) {
		if(this.rank==other.rank){
			return this.next-other.next;
		}
		return this.rank-other.rank;
	}

	public String toString(){
		return this.index+"   "+this.rank+"   "+this.next+"  ";
	}
}

class Wrapper implements Comparable<Wrapper>{
	int spf;int cnt;
	public Wrapper(int spf,int cnt){
		this.spf=spf;
		this.cnt=cnt;
	}

	@Override
	public int compareTo(Wrapper other) {
		return this.spf-other.spf;
	}
}

    class Node{//what the range would be for that particular node
		boolean state=false;
        int l=0,r=0;
		int ll=0,rr=0;
        public Node(boolean state){
            this.state=state;
        }
    }

	class Seg1{
			int A[];
			public Seg1(int A[]){
				this.A=A;
			}

			public void update(int left,int right,int val,int s,int e,int id){
				if(left<0||right<0||left>right)return;
				if(left==s&&right==e){

					A[id]+=val;
					return;
				}
				int mid=s+(e-s)/2; //[s,mid] [mid+1,e]

				if(left>=mid+1){
					update(left,right,val,mid+1,e,id*2+2);
				}else if(right<=mid){
					update(left,right,val,s,mid,id*2+1);
				}else{
					update(left,mid,val,s,mid,id*2+1);
					update(mid+1,right,val,mid+1,e,id*2+2);
				}
			}

			public int query(int i,int add,int s,int e,int id){

				if(s==e&&i==s){
					return A[id]+add;
				}

				int mid=s+(e-s)/2; //[s,mid] [mid+1,e]

				if(i>=mid+1){
					return query(i,A[id]+add,mid+1,e,id*2+2);
				}else{
					return query(i,A[id]+add,s,mid,id*2+1);
				}
			}
	}

	 class MaxFlow{

		  public static List<Edge>[] createGraph(int nodes) {
			List<Edge>[] graph = new List[nodes];
			for (int i = 0; i < nodes; i++)
			  graph[i] = new ArrayList<>();
			return graph;
		  }

		  public static void addEdge(List<Edge>[] graph, int s, int t, int cap) {
			graph[s].add(new Edge(t, graph[t].size(), cap));
			graph[t].add(new Edge(s, graph[s].size() - 1, 0));
		  }

		  static boolean dinicBfs(List<Edge>[] graph, int src, int dest, int[] dist) {
			Arrays.fill(dist, -1);
			dist[src] = 0;
			int[] Q = new int[graph.length];
			int sizeQ = 0;
			Q[sizeQ++] = src;
			for (int i = 0; i < sizeQ; i++) {
			  int u = Q[i];
			  for (Edge e : graph[u]) {
				if (dist[e.t] < 0 && e.f < e.cap) {
				  dist[e.t] = dist[u] + 1;
				  Q[sizeQ++] = e.t;
				}
			  }
			}
			return dist[dest] >= 0;
		  }

		  static int dinicDfs(List<Edge>[] graph, int[] ptr, int[] dist, int dest, int u, int f) {
			if (u == dest)
			  return f;
			for (; ptr[u] < graph[u].size(); ++ptr[u]) {
			  Edge e = graph[u].get(ptr[u]);
			  if (dist[e.t] == dist[u] + 1 && e.f < e.cap) {
				int df = dinicDfs(graph, ptr, dist, dest, e.t, Math.min(f, e.cap - e.f));
				if (df > 0) {
				  e.f += df;
				  graph[e.t].get(e.rev).f -= df;
				  return df;
				}
			  }
			}
			return 0;
		  }

		  public static int maxFlow(List<Edge>[] graph, int src, int dest) {
			int flow = 0;
			int[] dist = new int[graph.length];
			while (dinicBfs(graph, src, dest, dist)) {
			  int[] ptr = new int[graph.length];
			  while (true) {
				int df = dinicDfs(graph, ptr, dist, dest, src, Integer.MAX_VALUE);
				if (df == 0)
				  break;
				flow += df;
			  }
			}
			return flow;
		  }

	 }

	 	 class Edge {
			int t, rev, cap, f;

			public Edge(int t, int rev, int cap) {
			  this.t = t;
			  this.rev = rev;
			  this.cap = cap;
			}
		  }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

import com.sun.tools.classfile.StackMapTable_attribute.verification_type_info;

import java.util.*;

public class A {

	public static void main(String[] args) {

			FastScanner fs = new FastScanner();
			int t=fs.nextInt();
			while(t-->0)
			{
				int n = fs.nextInt();
				int a[]=new int[n];
				int b[]=new int[n];
				int c[]=new int[n];
				for(int i=0;i<n;i++)
				{
					a[i]=fs.nextInt();

				}
				for(int i=0;i<n;i++)
				{
					b[i]=fs.nextInt();

				}
				for(int i=0;i<n;i++)
				{
					c[i]=fs.nextInt();

				}

				int p[]=new int[n];
				for(int i=0;i<n;i++)
				{
					p[i]=a[i];
				}
				for(int i=1;i<n;i++)
				{
					if(p[i]==p[i-1])
					{
						if(p[i]!=b[i])
							p[i]=b[i];
						else
							p[i]=c[i];
					}
				}
				for(int i=0;i<n;i++)
					System.out.print(p[i]+" ");
			System.out.println();
			}

	}
	static class FastScanner
    {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

import java.util.*;

public class A {

	public static void main(String[] args) {

			FastScanner fs = new FastScanner();
			int t=fs.nextInt();
			while(t-->0)
			{
				int n = fs.nextInt();
				int a[]=new int[n];
				int b[]=new int[n];
				int c[]=new int[n];
				for(int i=0;i<n;i++)
				{
					a[i]=fs.nextInt();

				}
				for(int i=0;i<n;i++)
				{
					b[i]=fs.nextInt();

				}
				for(int i=0;i<n;i++)
				{
					c[i]=fs.nextInt();

				}

				int p[]=new int[n];
				for(int i=0;i<n;i++)
				{
					p[i]=a[i];
				}
				for(int i=1;i<n;i++)
				{
					if(p[i]==p[i-1])
					{
						if(p[i]!=b[i])
							p[i]=b[i];
						else
							p[i]=c[i];
					}
				}

				if(p[n-1]==p[0])
				{
					if(p[n-1]!=b[n-1] && p[n-2]!=b[n-1])
						p[n-1]=b[n-1];
					else
						p[n-1]=c[n-1];
				}
				for(int i=0;i<n;i++)
					System.out.print(p[i]+" ");
			System.out.println();
			}

	}
	static class FastScanner
    {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class C {

	public static void main(String[] args) throws IOException{
		try {
			FastScanner fs = new FastScanner();
			int t = fs.nextInt();
			while(t-->0)
			{
				int n = fs.nextInt();
				int k =fs.nextInt();
				int a[]=new int[n];
				for(int i=0;i<n;i++)
				{
					a[i]=fs.nextInt();
				}
				HashSet<Integer> set  = new HashSet<>();
				for(int i=0;i<n;i++)
				{

					set.add(a[i]);
				}
				int types = set.size();
				int ans=0;
				if(k==1 && types>1) {
					System.out.println("-1");
					continue;
				}
				int temp=types;
				while(temp>0)
				{
					temp-=k;
					ans++;
				}
				int ansif0=0;
				if(set.contains(0)==true)
				{
					for(int i=0;i<set.size()-1;i+=(k-1))
					{

							ansif0++;

					}

					System.out.println(ansif0);
					continue;
				}

				System.out.println(ans);

			}
		}
		catch (Exception e)
		{
			return;
		}

	}

	static class FastScanner
    {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

}


import java.io.*;
import java.util.*;

public class A{
    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}
        public FastReader(String fileName) throws FileNotFoundException{br = new BufferedReader(new FileReader(fileName));}
        String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException  e){e.printStackTrace();}}return st.nextToken();}
        int nextInt(){return Integer.parseInt(next());}
        long nextLong(){return Long.parseLong(next());}
        double nextDouble(){return Double.parseDouble(next());}
        char[][] readCharArray(int n,int m) {
            String str;
            char[][] arr = new char[n][m];
            for(int i=0;i<n;i++) {
                str=nextLine();
                for(int j=0;j<n;j++) {
                    arr[i][j]=str.charAt(j);
                }
            }
            return arr;
        }
        char[][] readCharArray(int n){
            return readCharArray(n,n);
        }
        int[] readArray(int n){int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;}
        long[] readLongArray(int n){long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;}
        String nextLine(){String str = "";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;}
    }
    static void printArray(int[] arr){
        for(int x:arr){
            System.out.print(x+" ");
        }
        System.out.println();
    }
    static final Random random=new Random();
    static void ruffleSort(int[] a) {
        int n=a.length;//shuffle, then sort
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }
    public static void main(String[] args) throws NumberFormatException, IOException {
        FastReader st = new FastReader();
        int tt = st.nextInt();
        int n,temp;
        while(tt-- > 0) {
        	n=st.nextInt();temp=0;
        	int[] ans = new int[n];
        	int[] a = st.readArray(n);
        	int[] b = st.readArray(n);
        	int[] c = st.readArray(n);
        	for(int i=0;i<n;i++) {
        		int[] arr = {a[i],b[i],c[i]};
        		int j=0;
        		if(i==0) ans[i]=arr[0];
        		else if(i==(n-1)) {
        			if(arr[0]!=ans[0] && arr[0]!=ans[n-2]) {
        				ans[i]=arr[0];
        			}else if(arr[1]!=ans[0] && arr[1]!=ans[n-2]) {
        				ans[i]=arr[1];
        			}else {
        				ans[i]=arr[2];
        			}
        		}
        		else {
        			for(j=0;j<3;j++) {
        				if(temp!=arr[j]) {
        					ans[i]=arr[j];break;
        				}
        			}
        		}
        		temp = arr[j];
        	}
        	printArray(ans);
        }
    }
}


import java.io.*;
import java.util.*;

public class A{
    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}
        public FastReader(String fileName) throws FileNotFoundException{br = new BufferedReader(new FileReader(fileName));}
        String next(){while (st == null || !st.hasMoreElements()){try{st = new StringTokenizer(br.readLine());}catch (IOException  e){e.printStackTrace();}}return st.nextToken();}
        int nextInt(){return Integer.parseInt(next());}
        long nextLong(){return Long.parseLong(next());}
        double nextDouble(){return Double.parseDouble(next());}
        char[][] readCharArray(int n,int m) {
            String str;
            char[][] arr = new char[n][m];
            for(int i=0;i<n;i++) {
                str=nextLine();
                for(int j=0;j<n;j++) {
                    arr[i][j]=str.charAt(j);
                }
            }
            return arr;
        }
        char[][] readCharArray(int n){
            return readCharArray(n,n);
        }
        int[] readArray(int n){int[] a=new int[n];for (int i=0; i<n; i++) a[i]=nextInt();return a;}
        long[] readLongArray(int n){long[] a=new long[n];for (int i=0; i<n; i++) a[i]=nextLong();return a;}
        String nextLine(){String str = "";try{str = br.readLine();}catch (IOException e){e.printStackTrace();}return str;}
    }
    static void printArray(int[] arr){
        for(int x:arr){
            System.out.print(x+" ");
        }
        System.out.println();
    }
    static final Random random=new Random();
    static void ruffleSort(int[] a) {
        int n=a.length;//shuffle, then sort
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }
    public static void main(String[] args) throws NumberFormatException, IOException {
        FastReader st = new FastReader();
        int tt = st.nextInt();
        int n,temp;
        while(tt-- > 0) {
        	n=st.nextInt();temp=0;
        	StringBuilder ans = new StringBuilder("");
        	int[] a = st.readArray(n);
        	int[] b = st.readArray(n);
        	int[] c = st.readArray(n);
        	int[] arr = {a[0],b[0]};
        	if(n%2==0) {
        		for(int i=0;i<n;i++) {
            		ans.append(arr[i%2]+" ");
            	}
        	}else {
        		for(int i=0;i<n-1;i++) {
            		ans.append(arr[i%2]+" ");
            	}
        		ans.append(c[0]+" ");
        	}
        	System.out.println(ans);
        }
    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeMap;

public class A {

	public static void main(String[] args) {

		Scanner nik = new Scanner(System.in);
		int t = nik.nextInt();
		StringBuilder st = new StringBuilder();

		while (t-- > 0) {
			int n = nik.nextInt();

			int[] a = new int[n];

			int[] b = new int[n];
			int[] c = new int[n];

			for (int i = 0; i < n; i++) {
				a[i] = nik.nextInt();
			}

			for (int i = 0; i < n; i++) {
				b[i] = nik.nextInt();
			}
			for (int i = 0; i < n; i++) {
				c[i] = nik.nextInt();

			}

			int[] res = new int[n];
			res[0] = a[0];

			int temp = n % 2 == 0 ? n : n - 1;

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

				if (a[i] != res[i - 1]) {
					res[i] = a[i];
				} else if (b[i] != res[i - 1]) {
					res[i] = b[i];
				} else {
					res[i] = c[i];
				}

			}

			if (n % 2 != 0) {

				if (a[n - 1] != res[n - 2] && a[n - 1] != res[0]) {
					res[n - 1] = a[n - 1];
				} else if (a[n - 1] != res[n - 2] && b[n - 1] != res[0]) {
					res[n - 1] = b[n - 1];
				} else {
					res[n - 1] = c[n - 1];
				}

			}

			for (int val : res) {
				st.append(val + " ");
			}
			st.append("\n");

		}
		System.out.println(st);
	}
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeMap;

public class A {

	public static void main(String[] args) {

		Scanner nik = new Scanner(System.in);
		int t = nik.nextInt();
		StringBuilder st = new StringBuilder();

		while (t-- > 0) {
			int n = nik.nextInt();

			int[] a = new int[n];

			int[] b = new int[n];
			int[] c = new int[n];

			TreeMap<Integer, Integer> hm = new TreeMap<>();

			ArrayList<Integer> a1 = new ArrayList<>();

			for (int i = 0; i < n; i++) {
				a[i] = nik.nextInt();
				if (hm.containsKey(a[i]) == false) {
					a1.add(a[i]);
				}
				hm.put(a[i], hm.getOrDefault(a[i], 0) + 1);
			}

			for (int i = 0; i < n; i++) {
				b[i] = nik.nextInt();
				if (!hm.containsKey(b[i])) {
					a1.add(b[i]);
				}
				hm.put(b[i], hm.getOrDefault(b[i], 0) + 1);
			}

			for (int i = 0; i < n; i++) {
				c[i] = nik.nextInt();

				if (!hm.containsKey(c[i])) {
					a1.add(c[i]);
				}

				hm.put(c[i], hm.getOrDefault(c[i], 0) + 1);
			}

			int l = 0;
			int r = a1.size() - 1;
			int[] res = new int[n];

			// System.out.println(a1);
			for (int i = 0; i < n - 1; i += 2) {

				int g = hm.get(a1.get(l));
				int g1 = hm.get(a1.get(r));

				res[i] = a1.get(l);
				res[i + 1] = a1.get(r);
				if (g == 1) {
					hm.remove(a1.get(l));
					l++;
				} else {
					hm.put(a1.get(l), g - 1);
				}
				if (g1 == 1) {
					hm.remove(a1.get(r));
					r--;
				} else {
					hm.put(a1.get(r), g1 - 1);
				}
			}

			if (n % 2 != 0) {
				for (int i = 1; i < a1.size(); i++) {
					if (a1.get(i) != res[0] && a1.get(i) != res[n - 2]) {
						res[n - 1] = a1.get(i);
					}
				}
			}

			for (int val : res) {
				st.append(val + " ");
			}
			st.append("\n");

		}
		System.out.println(st);
	}
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeMap;

public class A {

	public static void main(String[] args) {

		Scanner nik = new Scanner(System.in);
		int t = nik.nextInt();
		StringBuilder st = new StringBuilder();

		while (t-- > 0) {
			int n = nik.nextInt();

			int[] a = new int[n];

			int[] b = new int[n];
			int[] c = new int[n];

			TreeMap<Integer, Integer> hm = new TreeMap<>();

			ArrayList<Integer> a1 = new ArrayList<>();

			for (int i = 0; i < n; i++) {
				a[i] = nik.nextInt();
				if (hm.containsKey(a[i]) == false) {
					a1.add(a[i]);
				}
				hm.put(a[i], hm.getOrDefault(a[i], 0) + 1);
			}

			for (int i = 0; i < n; i++) {
				b[i] = nik.nextInt();
				if (!hm.containsKey(b[i])) {
					a1.add(b[i]);
				}
				hm.put(b[i], hm.getOrDefault(b[i], 0) + 1);
			}

			for (int i = 0; i < n; i++) {
				c[i] = nik.nextInt();

				if (!hm.containsKey(c[i])) {
					a1.add(c[i]);
				}

				hm.put(c[i], hm.getOrDefault(c[i], 0) + 1);
			}

			int l = 0;
			int r = a1.size() - 1;
			int[] res = new int[n];
			if (n % 2 != 0) {
				res[n - 1] = a1.get(0);
				n--;
			}
			// System.out.println(a1);
			for (int i = 0; i < n - 1; i += 2) {

				int g = hm.get(a1.get(l));
				int g1 = hm.get(a1.get(r));

				res[i] = a1.get(l);
				res[i + 1] = a1.get(r);
				if (g == 1) {
					hm.remove(a1.get(l));
					l++;
				} else {
					hm.put(a1.get(l), g - 1);
				}
				if (g1 == 1) {
					hm.remove(a1.get(r));
					r--;
				} else {
					hm.put(a1.get(r), g1 - 1);
				}
			}

			for (int val : res) {
				st.append(val + " ");
			}
			st.append("\n");

		}
		System.out.println(st);
	}
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeMap;

public class A {

	public static void main(String[] args) {

		Scanner nik = new Scanner(System.in);
		int t = nik.nextInt();
		StringBuilder st = new StringBuilder();

		while (t-- > 0) {
			int n = nik.nextInt();

			int[] a = new int[n];

			int[] b = new int[n];
			int[] c = new int[n];

			for (int i = 0; i < n; i++) {
				a[i] = nik.nextInt();
			}

			for (int i = 0; i < n; i++) {
				b[i] = nik.nextInt();
			}
			for (int i = 0; i < n; i++) {
				c[i] = nik.nextInt();

			}

			int[] res = new int[n];
			res[0] = a[0];

			// int temp = n % 2 == 0 ? n : n - 1;

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

				if (a[i] != res[i - 1]) {
					res[i] = a[i];
				} else if (b[i] != res[i - 1]) {
					res[i] = b[i];
				} else {
					res[i] = c[i];
				}

			}

			if (a[n - 1] != res[n - 2] && a[n - 1] != res[0]) {
				res[n - 1] = a[n - 1];
			} else if (b[n - 1] != res[n - 2] && b[n - 1] != res[0]) {
				res[n - 1] = b[n - 1];
			} else {
				res[n - 1] = c[n - 1];
			}

			for (int val : res) {
				st.append(val + " ");
			}
			st.append("\n");

		}
		System.out.println(st);
	}
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeMap;

public class A {

	public static void main(String[] args) {

		Scanner nik = new Scanner(System.in);
		int t = nik.nextInt();
		StringBuilder st = new StringBuilder();

		while (t-- > 0) {
			int n = nik.nextInt();

			int[] a = new int[n];

			int[] b = new int[n];
			int[] c = new int[n];

			for (int i = 0; i < n; i++) {
				a[i] = nik.nextInt();
			}

			for (int i = 0; i < n; i++) {
				b[i] = nik.nextInt();
			}
			for (int i = 0; i < n; i++) {
				c[i] = nik.nextInt();

			}

			int[] res = new int[n];
			res[0] = a[0];

			int temp = n % 2 == 0 ? n : n - 1;

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

				if (a[i] != res[i - 1]) {
					res[i] = a[i];
				} else if (b[i] != res[i - 1]) {
					res[i] = b[i];
				} else {
					res[i] = c[i];
				}

			}

			if (n % 2 != 0) {

				if (a[n - 1] != res[n - 2] && a[n - 1] != res[0]) {
					res[n - 1] = a[n - 1];
				} else if (a[n - 1] != res[n - 2] && a[n - 1] != res[0]) {
					res[n - 1] = b[n - 1];
				} else {
					res[n - 1] = c[n - 1];
				}

			}

			for (int val : res) {
				st.append(val + " ");
			}
			st.append("\n");

		}
		System.out.println(st);
	}
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeMap;

public class A {

	public static void main(String[] args) {

		Scanner nik = new Scanner(System.in);
		int t = nik.nextInt();
		StringBuilder st = new StringBuilder();

		while (t-- > 0) {
			int n = nik.nextInt();

			int[] a = new int[n];

			int[] b = new int[n];
			int[] c = new int[n];

			for (int i = 0; i < n; i++) {
				a[i] = nik.nextInt();
			}

			for (int i = 0; i < n; i++) {
				b[i] = nik.nextInt();
			}
			for (int i = 0; i < n; i++) {
				c[i] = nik.nextInt();

			}

			int[] res = new int[n];
			res[0] = a[0];

			int temp = n % 2 == 0 ? n : n - 1;

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

				if (a[i] != res[i - 1]) {
					res[i] = a[i];
				} else if (b[i] != res[i - 1]) {
					res[i] = b[i];
				} else {
					res[i] = c[i];
				}

			}

			if (n % 2 != 0) {

				if (a[n - 1] != res[n - 2] && a[n - 1] != res[0]) {
					res[n - 1] = a[n - 1];
				} else if (b[n - 1] != res[n - 2] && b[n - 1] != res[0]) {
					res[n - 1] = b[n - 1];
				} else {
					res[n - 1] = c[n - 1];
				}

			}

			for (int val : res) {
				st.append(val + " ");
			}
			st.append("\n");

		}
		System.out.println(st);
	}
}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class CircleColoring {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int matches = Integer.valueOf(in.nextLine());
        String[] result = new String[matches];
        for (int i = 0; i < matches; i++) {
            String length = in.nextLine();
            int[] a1 = Arrays.stream(in.nextLine().split(" ")).map(Integer::valueOf).mapToInt(n -> n).toArray();
            int[] a2 = Arrays.stream(in.nextLine().split(" ")).map(Integer::valueOf).mapToInt(n -> n).toArray();
            int[] a3 = Arrays.stream(in.nextLine().split(" ")).map(Integer::valueOf).mapToInt(n -> n).toArray();
            int[] res = new int[a1.length];
            res[0] = a1[0];
            for (int z = 1; z < a1.length; z++) {
                if (z < a1.length -1) {
                    if (a1[z] != res[z - 1]) {
                        res[z] = a1[z];
                    } else if (a2[z] != res[z - 1]) {
                        res[z] = a2[z];
                    } else if (a3[z] != res[z - 1]) {
                        res[z] = a3[z];
                    }
                } else {
                    if (a1[z] != res[z - 1] && a1[z] != res[0]) {
                        res[z] = a1[z];
                    } else if (a2[z] != res[z - 1] && a3[z] != res[0]) {
                        res[z] = a2[z];
                    } else if (a3[z] != res[z - 1] && a3[z] != res[0]) {
                        res[z] = a3[z];
                    }
                }
            }
            result[i] = Arrays.stream(res).mapToObj(String::valueOf).collect(Collectors.joining());
        }
        Arrays.stream(result).forEach(System.out::println);
    }
}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class CircleColoring {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int matches = Integer.valueOf(in.nextLine());
        String[] result = new String[matches];
        for (int i = 0; i < matches; i++) {
            String length = in.nextLine();
            int[] a1 = Arrays.stream(in.nextLine().split(" ")).map(Integer::valueOf).mapToInt(n -> n).toArray();
            int[] a2 = Arrays.stream(in.nextLine().split(" ")).map(Integer::valueOf).mapToInt(n -> n).toArray();
            int[] a3 = Arrays.stream(in.nextLine().split(" ")).map(Integer::valueOf).mapToInt(n -> n).toArray();
            int[] res = new int[a1.length];
            res[0] = a1[0];
            for (int z = 1; z < a1.length; z++) {
                if (z < a1.length -1) {
                    if (a1[z] != res[z - 1]) {
                        res[z] = a1[z];
                    } else if (a2[z] != res[z - 1]) {
                        res[z] = a2[z];
                    } else if (a3[z] != res[z - 1]) {
                        res[z] = a3[z];
                    }
                } else {
                    if (a1[z] != res[z - 1] && a1[z] != res[0]) {
                        res[z] = a1[z];
                    } else if (a2[z] != res[z - 1] && a2[z] != res[0]) {
                        res[z] = a2[z];
                    } else if (a3[z] != res[z - 1] && a3[z] != res[0]) {
                        res[z] = a3[z];
                    }
                }
            }
            result[i] = Arrays.stream(res).mapToObj(String::valueOf).collect(Collectors.joining(" "));
        }
        Arrays.stream(result).forEach(System.out::println);
    }
}


import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class CircleColoring {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int matches = Integer.valueOf(in.nextLine());
        String[] result = new String[matches];
        for (int i = 0; i < matches; i++) {
            String length = in.nextLine();
            int[] a1 = Arrays.stream(in.nextLine().split(" ")).map(Integer::valueOf).mapToInt(n -> n).toArray();
            int[] a2 = Arrays.stream(in.nextLine().split(" ")).map(Integer::valueOf).mapToInt(n -> n).toArray();
            int[] a3 = Arrays.stream(in.nextLine().split(" ")).map(Integer::valueOf).mapToInt(n -> n).toArray();
            int[] res = new int[a1.length];
            res[0] = a1[0];
            for (int z = 1; z < a1.length; z++) {
                if (z < a1.length -1) {
                    if (a1[z] != res[z - 1]) {
                        res[z] = a1[z];
                    } else if (a2[z] != res[z - 1]) {
                        res[z] = a2[z];
                    } else if (a3[z] != res[z - 1]) {
                        res[z] = a3[z];
                    }
                } else {
                    if (a1[z] != res[z - 1] && a1[z] != res[0]) {
                        res[z] = a1[z];
                    } else if (a2[z] != res[z - 1] && a2[z] != res[0]) {
                        res[z] = a2[z];
                    } else if (a3[z] != res[z - 1] && a3[z] != res[0]) {
                        res[z] = a3[z];
                    }
                }
            }
            result[i] = Arrays.stream(res).mapToObj(String::valueOf).collect(Collectors.joining());
        }
        Arrays.stream(result).forEach(System.out::println);
    }
}


import java.util.*;
public class S
{
    public static void main(String args[])
    {
        Scanner scan=new Scanner(System.in);
        int test=scan.nextInt();
        while(test>0)
        {
            test--;
            int n=scan.nextInt();
            int a[]=new int[n];
            for(int i=0;i<n;i++)
            a[i]=scan.nextInt();
            int b[]=new int[n];
            for(int i=0;i<n;i++)
            b[i]=scan.nextInt();
            int c[]=new int[n];
            for(int i=0;i<n;i++)
            c[i]=scan.nextInt();
            int ans[]=new int[n];
            boolean check=true;
            int j=0;
            int present[]={a[j],b[j],c[j]};
            int current=present[0];
            ans[j]=current;
            int index=1;
            j++;
            for(int i=1;i<n;i++)
            {
                int next[]={a[i],b[i],c[i]};
                index=0;
                check=true;
                while(check)
                {
                  if(next[0]!=current)
                  {
                      current=next[0];
                      ans[j]=current;
                      check=false;
                      break;
                  }
                  else if(next[1]!=current)
                  {
                      current=next[1];
                      ans[j]=current;
                      check=false;
                      break;
                  }
                  else if(next[2]!=current)
                  {
                      current=next[2];
                      ans[j]=current;
                      check=false;
                      break;
                  }
                  else
                  {
                      if(index<3)
                      current=present[index];
                      else
                      {
                          current=present[0];
                          index=0;
                      }

                      index++;
                      check=true;ans[j-1]=current;
                  }
                }
                present=next;
                j++;
            }
            //check the first and last element ;
            int f=ans[0];
            int l=ans[n-1];
            if(f==l&&n>2)
            {
             int sc=ans[n-2];
             if(present[0]!=f&&present[0]!=sc)
             ans[n-1]=present[0];
             else if(present[1]!=f&&present[1]!=sc)
             ans[n-1]=present[1];
             else
             ans[n-1]=present[2];

            }
            for(int k:ans)
            System.out.print(k+" ");
            System.out.println();
        }

    }
}


import java.util.*;
public class S
{
    public static void main(String args[])
    {
        Scanner scan=new Scanner(System.in);
        int test=scan.nextInt();
        while(test>0)
        {
            test--;
            int n=scan.nextInt();
            int a[]=new int[n];
            for(int i=0;i<n;i++)
            a[i]=scan.nextInt();
            int b[]=new int[n];
            for(int i=0;i<n;i++)
            b[i]=scan.nextInt();
            int c[]=new int[n];
            for(int i=0;i<n;i++)
            c[i]=scan.nextInt();
            int ans[]=new int[n];
            boolean check=true;
            int j=0;
            int present[]={a[j],b[j],c[j]};
            int current=present[0];
            ans[j]=current;
            int index=1;
            j++;
            for(int i=1;i<n;i++)
            {
                int next[]={a[i],b[i],c[i]};
                index=0;
                check=true;
                while(check)
                {
                  if(next[0]!=current)
                  {
                      current=next[0];
                      ans[j]=current;
                      check=false;
                      break;
                  }
                  else if(next[1]!=current)
                  {
                      current=next[1];
                      ans[j]=current;
                      check=false;
                      break;
                  }
                  else if(next[2]!=current)
                  {
                      current=next[2];
                      ans[j]=current;
                      check=false;
                      break;
                  }
                  else
                  {
                      if(index<3)
                      current=present[index];
                      else
                      {
                          current=present[0];
                          index=0;
                      }

                      index++;
                      check=true;ans[j-1]=current;
                  }
                }
                present=next;
                j++;
            }
            for(int k:ans)
            System.out.print(k+" ");
            System.out.println();
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class Solution {

	public static void main(String[] args) {

		/*
		 * 3
6 10
1 3
4 4

		 */
		Solution sl=new Solution();
		FastScanner scan=new FastScanner();

//		int[] temp=getTimes(1151); if(true)return;

		int t = scan.nextInt();

		while(t-->0) {
			int n = scan.nextInt();
			int[] ans=new int[n];
			int[] a = scan.readArray(n);
			int[] b = scan.readArray(n);
			int[] c = scan.readArray(n);
			for(int i=0;i<n;i++) {
				if(i==0) {
					ans[i]=a[i];
				}else if(i==n-1) {
					if(a[i]==ans[i-1] || a[i]==ans[0]) {
						if(b[i]==ans[0] || b[i]==ans[i-1]) {
							ans[i]=c[i];
						}else {
							ans[i]=b[i];
						}
					}else {
						ans[i]=a[i];
					}
				}
				else {
					if(a[i]==ans[i-1]) {
						ans[i]=b[i];
					}else {
						ans[i]=a[i];
					}
				}
			}

			for(int i=0;i<n;i++) {
				if(i>0) System.out.print(" ");
				System.out.print(ans[i]);
			}
			System.out.println();
		}

	}

	static final Random random=new Random();

	  static void ruffleSort(int[] a) {
		  int n=a.length; //shuffle, then sort for
		  for(int i=0; i<n; i++)
		  	{ int oi=random.nextInt(n), temp=a[oi]; a[oi]=a[i]; a[i]=temp; }
		  Arrays.sort(a);
	  }

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class Solution {

	public static void main(String[] args) {

		/*
		 * 3
6 10
1 3
4 4

		 */
		Solution sl=new Solution();
		FastScanner scan=new FastScanner();

//		int[] temp=getTimes(1151); if(true)return;

		int t = scan.nextInt();

		while(t-->0) {
			int n = scan.nextInt();
			int[] ans=new int[n];
			for(int i=0;i<n;i++) {
				if(i==0) {
					ans[i]=scan.nextInt();
					scan.nextInt();
					scan.nextInt();
				}else if(i==n-1) {
					int a=scan.nextInt();
					int b=scan.nextInt();
					int c=scan.nextInt();
					if(a==ans[i-1] || a==ans[0]) {
						if(b==ans[0] || b==ans[i-1]) {
							ans[i]=c;
						}else {
							ans[i]=b;
						}
					}else {
						ans[i]=a;
					}
				}
				else {
					int a=scan.nextInt();
					int b=scan.nextInt();
					int c=scan.nextInt();
					if(a==ans[i-1]) {
						ans[i]=b;
					}else {
						ans[i]=a;
					}
				}
			}

			for(int i=0;i<n;i++) {
				if(i>0) System.out.print(" ");
				System.out.print(ans[i]);
			}
			System.out.println();
		}

	}

	static final Random random=new Random();

	  static void ruffleSort(int[] a) {
		  int n=a.length; //shuffle, then sort for
		  for(int i=0; i<n; i++)
		  	{ int oi=random.nextInt(n), temp=a[oi]; a[oi]=a[i]; a[i]=temp; }
		  Arrays.sort(a);
	  }

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

}


//package GraknLabs;

import java.util.*;
import java.io.*;

public class A {
    static Scanner sc;
    static PrintWriter out;

    public static void main(String[] args) {
        sc = new Scanner(System.in);
        out = new PrintWriter(System.out);

        int t = 1;
        t = sc.nextInt();
        while (t-- > 0) {
            forEachTestCase();
        }

        sc.close();
        out.close();
    }

    static void forEachTestCase() {
        int n=sc.nextInt();
        int a[][]=new int[3][n];
        for(int i=0;i<3;i++){
            for(int j=0;j<n;j++){
                a[i][j]=sc.nextInt();
            }
        }
        int last=-1;
        for (int i = 0; i <n ; i++) {
            for (int j = 0; j <3 ; j++) {
                if(last!=a[j][i]){
                    out.print(a[j][i]+" ");
                    last=a[j][i];
                    break;
                }
            }
        }
        out.println();
    }

    static long mod = 1000000007;

    static long add(long a, long b) {
        a %= mod;
        b %= mod;
        return (a + b) % mod;
    }

    static long mul(long a, long b) {
        a %= mod;
        b %= mod;
        return (a * b) % mod;
    }

    static long sub(long a, long b) {
        a %= mod;
        b %= mod;
        return (((a - b) % mod) + mod) % mod;
    }

    static long gcd(long a, long b) {
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    static long modPow(long a, long b) {
        long ans = 1;
        while (b > 0) {
            if (b % 2 == 1) {
                ans = mul(ans, a);
            }
            a = mul(a, a);
            b >>= 1;
        }
        return ans;
    }

    static long modInv(long a) {
        return modPow(a, mod - 2);
    }
}


package GraknLabs;

import java.util.*;
import java.io.*;

public class A {
    static Scanner sc;
    static PrintWriter out;

    public static void main(String[] args) {
        sc = new Scanner(System.in);
        out = new PrintWriter(System.out);

        int t = 1;
        t = sc.nextInt();
        while (t-- > 0) {
            forEachTestCase();
        }

        sc.close();
        out.close();
    }

    static void forEachTestCase() {
        int n=sc.nextInt();
        int a[][]=new int[3][n];
        for(int i=0;i<3;i++){
            for(int j=0;j<n;j++){
                a[i][j]=sc.nextInt();
            }
        }
        int last=-1;
        for (int i = 0; i <n ; i++) {
            for (int j = 0; j <3 ; j++) {
                if(last!=a[j][i]){
                    out.print(a[j][i]+" ");
                    last=a[j][i];
                    break;
                }
            }
        }
        out.println();
    }

    static long mod = 1000000007;

    static long add(long a, long b) {
        a %= mod;
        b %= mod;
        return (a + b) % mod;
    }

    static long mul(long a, long b) {
        a %= mod;
        b %= mod;
        return (a * b) % mod;
    }

    static long sub(long a, long b) {
        a %= mod;
        b %= mod;
        return (((a - b) % mod) + mod) % mod;
    }

    static long gcd(long a, long b) {
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    static long modPow(long a, long b) {
        long ans = 1;
        while (b > 0) {
            if (b % 2 == 1) {
                ans = mul(ans, a);
            }
            a = mul(a, a);
            b >>= 1;
        }
        return ans;
    }

    static long modInv(long a) {
        return modPow(a, mod - 2);
    }
}


//package GraknLabs;

import java.util.*;
import java.io.*;

public class A {
    static Scanner sc;
    static PrintWriter out;

    public static void main(String[] args) {
        sc = new Scanner(System.in);
        out = new PrintWriter(System.out);

        int t = 1;
        t = sc.nextInt();
        while (t-- > 0) {
            forEachTestCase();
        }

        sc.close();
        out.close();
    }

    static void forEachTestCase() {
        int n=sc.nextInt();
        int a[][]=new int[3][n];
        for(int i=0;i<3;i++){
            for(int j=0;j<n;j++){
                a[i][j]=sc.nextInt();
            }
        }
        int last=-1,first=-1;
        for (int i = 0; i <n ; i++) {
            for (int j = 0; j <3 ; j++) {
                if( i!=n-1 && last!=a[j][i]){
                    out.print(a[j][i]+" ");
                    if(i==0){
                        first=a[j][i];
                    }
                    last=a[j][i];
                    break;
                }
                else if(i==n-1 && last!=a[j][i] && first!=a[j][i]){
                    out.println(a[j][i]);
                    break;
                }
            }
        }
    }

    static long mod = 1000000007;

    static long add(long a, long b) {
        a %= mod;
        b %= mod;
        return (a + b) % mod;
    }

    static long mul(long a, long b) {
        a %= mod;
        b %= mod;
        return (a * b) % mod;
    }

    static long sub(long a, long b) {
        a %= mod;
        b %= mod;
        return (((a - b) % mod) + mod) % mod;
    }

    static long gcd(long a, long b) {
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    static long modPow(long a, long b) {
        long ans = 1;
        while (b > 0) {
            if (b % 2 == 1) {
                ans = mul(ans, a);
            }
            a = mul(a, a);
            b >>= 1;
        }
        return ans;
    }

    static long modInv(long a) {
        return modPow(a, mod - 2);
    }
}


import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int tt = sc.nextInt();
        while (tt-- > 0) {
            int n = sc.nextInt();
            int a[] = new int[n + 1], b[] = new int[n + 1], c[] = new int[n + 1];
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
            }
            for (int i = 0; i < n; i++) {
                b[i] = sc.nextInt();
            }
            for (int i = 0; i < n; i++) {
                c[i] = sc.nextInt();
            }

            int ans[] = new int[n + 1];
            ans[0] = a[0];
            for (int i = 1; i < n; ++i) {
                if (a[i] != ans[i - 1]) {
                    ans[i] = a[i];
                } else if (b[i] != ans[i - 1]) {
                    ans[i] = b[i];
                } else {
                    ans[i] = c[i];
                }

                if (a[n] != ans[n - 1] && a[n] != ans[1]) {
                    ans[n] = a[n];
                }
                else if (b[n] != ans[n - 1] && b[n] != ans[1]) {
                    ans[n] = b[n];
                }
                else {
                    ans[n] = c[n];
                }
            }
            for (int i=0;i<n;i++){
                System.out.print(ans[i]+" ");
            }
            System.out.println();
        }
    }
}


import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int tt = sc.nextInt();
        while (tt-- > 0) {
            int n = sc.nextInt();
            int a[] = new int[n +1], b[] = new int[n +1], c[] = new int[n+1];
            for (int i = 0; i < n; i++) {
                a[i+1] = sc.nextInt();
            }
            for (int i = 0; i < n; i++) {
                b[i+1] = sc.nextInt();
            }
            for (int i = 0; i < n; i++) {
                c[i+1] = sc.nextInt();
            }

            int ans[] = new int[n + 1];
            ans[0] = a[0];
            for (int i = 1; i < n; ++i) {
                if (a[i] != ans[i - 1]) {
                    ans[i] = a[i];
                } else if (b[i] != ans[i - 1]) {
                    ans[i] = b[i];
                } else {
                    ans[i] = c[i];
                }

                if (a[n] != ans[n - 1] && a[n] != ans[1]) {
                    ans[n] = a[n];
                }
                else if (b[n] != ans[n - 1] && b[n] != ans[1]) {
                    ans[n] = b[n];
                }
                else {
                    ans[n] = c[n];
                }
            }
            for (int i=0;i<n;i++){
                System.out.print(ans[i+1]+" ");
            }
            System.out.println();
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Tarek
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ACircleColoring solver = new ACircleColoring();
        solver.solve(1, in, out);
        out.close();
    }

    static class ACircleColoring {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int t = in.nextInt();
            while (t-- > 0) {
                int n = in.nextInt();
                int[] a = new int[n];
                int[] b = new int[n];
                int[] c = new int[n];
                for (int i = 0; i < n; i++) {
                    a[i] = in.nextInt();
                }
                for (int i = 0; i < n; i++) {
                    b[i] = in.nextInt();
                }
                for (int i = 0; i < n; i++) {
                    c[i] = in.nextInt();
                }
                int prev = -1;
                for (int i = 0; i < n; i++) {
                    if (a[i] != prev) {
                        out.print(a[i] + " ");
                        prev = a[i];
                    } else if (b[i] != prev) {
                        out.print(b[i] + " ");
                        prev = c[i];
                    } else {
                        out.print(c[i] + " ");
                        prev = c[i];
                    }
                }
                out.println();
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Tarek
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ACircleColoring solver = new ACircleColoring();
        solver.solve(1, in, out);
        out.close();
    }

    static class ACircleColoring {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int t = in.nextInt();
            while (t-- > 0) {
                int n = in.nextInt();
                int[] a = new int[n];
                int[] b = new int[n];
                int[] c = new int[n];
                for (int i = 0; i < n; i++) {
                    a[i] = in.nextInt();
                }
                for (int i = 0; i < n; i++) {
                    b[i] = in.nextInt();
                }
                for (int i = 0; i < n; i++) {
                    c[i] = in.nextInt();
                }
                int prev = a[0];
                out.print(a[0] + " ");
                for (int i = 1; i < n; i++) {
                    if (i == n - 1) {
                        if (b[i] != prev) {
                            out.print(b[i] + " ");
                            prev = b[i];
                        } else {
                            out.print(c[i] + " ");
                            prev = c[i];
                        }
                    } else {
                        if (a[i] != prev) {
                            out.print(a[i] + " ");
                            prev = a[i];
                        } else if (b[i] != prev) {
                            out.print(b[i] + " ");
                            prev = b[i];
                        } else {
                            out.print(c[i] + " ");
                            prev = c[i];
                        }
                    }
                }
                out.println();

            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Tarek
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ACircleColoring solver = new ACircleColoring();
        solver.solve(1, in, out);
        out.close();
    }

    static class ACircleColoring {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int t = in.nextInt();
            while (t-- > 0) {
                int n = in.nextInt();
                int[] a = new int[n];
                int[] b = new int[n];
                int[] c = new int[n];
                for (int i = 0; i < n; i++) {
                    a[i] = in.nextInt();
                }
                for (int i = 0; i < n; i++) {
                    b[i] = in.nextInt();
                }
                for (int i = 0; i < n; i++) {
                    c[i] = in.nextInt();
                }
                int prev = a[0];
                out.print(a[0] + " ");
                for (int i = 1; i < n; i++) {
                    if (i == n - 1) {
                        if (a[i] != prev && a[i] != a[0]) {
                            out.print(a[i] + " ");
                            prev = a[i];
                        } else if (b[i] != prev && b[i] != a[0]) {
                            out.print(b[i] + " ");
                            prev = b[i];
                        } else {
                            out.print(c[i] + " ");
                            prev = c[i];
                        }
                    } else {
                        if (a[i] != prev) {
                            out.print(a[i] + " ");
                            prev = a[i];
                        } else if (b[i] != prev) {
                            out.print(b[i] + " ");
                            prev = b[i];
                        } else {
                            out.print(c[i] + " ");
                            prev = c[i];
                        }
                    }
                }
                out.println();
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.*;
import java.util.*;

import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;

import static java.lang.System.*;

public class A {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st;
        int t = parseInt(in.readLine());
        for (int t1 = 0; t1 < t; t1++) {
            int n = parseInt(in.readLine());
            int[] a1 = new int[n];
            int[] a2 = new int[n];
            int[] a3 = new int[n];
            st = new StringTokenizer(in.readLine());
            for (int i = 0; i < n; i++) {
                a1[i] = parseInt(st.nextToken());
            }
            st = new StringTokenizer(in.readLine());
            for (int i = 0; i < n; i++) {
                a2[i] = parseInt(st.nextToken());
            }
            st = new StringTokenizer(in.readLine());
            for (int i = 0; i < n; i++) {
                a3[i] = parseInt(st.nextToken());
            }
            pw.println(solve(a1, a2, a3, n));
        }
        pw.close();
    }

    static StringBuilder solve(int[] a1, int[] a2, int[] a3, int n) {
        StringBuilder sb = new StringBuilder();
        int temp = 0;
        int one = 0;
        for (int i = 0; i < n; i++) {
            if (i == 0) {
                temp = a1[i];
                one = temp;
                sb.append(a1[i] + " ");
            } else if (i == (n - 1)) {
                if (temp != a1[i] && a1[i] != one) {
                    temp = a1[i];
                    sb.append(a1[i] + " ");
                } else if (temp != a2[i] && a2[i] != one) {
                    sb.append(a2[i] + " ");
                    temp = a2[i];
                } else if (temp != a3[i] && a3[i] != one) {
                    sb.append(a3[i] + " ");
                    temp = a3[i];
                }
            }else {
                if (temp != a1[i]) {
                    temp = a1[i];
                    sb.append(a1[i] + " ");
                } else if (temp != a2[i]) {
                    sb.append(a2[i] + " ");
                    temp = a2[i];
                } else if (temp != a3[i]) {
                    sb.append(a3[i] + " ");
                    temp = a3[i];
                }
            }
        }
        return sb;
    }
}


import java.io.*;
import java.util.*;

import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;

import static java.lang.System.*;

public class A {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st;
        int t = parseInt(in.readLine());
        for (int t1 = 0; t1 < t; t1++) {
            int n = parseInt(in.readLine());
            int[] a1 = new int[n];
            int[] a2 = new int[n];
            int[] a3 = new int[n];
            st = new StringTokenizer(in.readLine());
            for (int i = 0; i < n; i++) {
                a1[i] = parseInt(st.nextToken());
            }
            st = new StringTokenizer(in.readLine());
            for (int i = 0; i < n; i++) {
                a2[i] = parseInt(st.nextToken());
            }
            st = new StringTokenizer(in.readLine());
            for (int i = 0; i < n; i++) {
                a3[i] = parseInt(st.nextToken());
            }
            pw.println(solve(a1, a2, a3, n));
        }
        pw.close();
    }

    static StringBuilder solve(int[] a1, int[] a2, int[] a3, int n) {
        StringBuilder sb = new StringBuilder();
        int temp = 0;
        for (int i = 0; i < n; i++) {
            if (i == 0) {
                temp = a1[i];
                sb.append(a1[i] + " ");
            } else {
                if (temp != a1[i]) {
                    temp = a1[i];
                    sb.append(a1[i] + " ");
                } else if (temp != a2[i]) {
                    sb.append(a2[i] + " ");
                    temp = a2[i];
                } else if (temp != a3[i]) {
                    sb.append(a3[i] + " ");
                    temp = a3[i];
                }
            }
        }
        return sb;
    }
}


import java.util.*;
import java.io.*;

public class Codeforces
{
    public static void main(String[] args) throws Exception
    {
        FastReader scn =new FastReader();

        int test = scn.nextInt();

        StringBuilder sb = new StringBuilder();

        while(test > 0)
        {
            int n = scn.nextInt();
            int[] a = new int[n];
            int[] b = new int[n];
            int[] c = new int[n];

            for(int i=0; i<n; i++) a[i] = scn.nextInt();
            for(int i=0; i<n; i++) b[i] = scn.nextInt();
            for(int i=0; i<n; i++) c[i] = scn.nextInt();

            int[] ans = new int[n];
            ans[0] = a[0];

            for(int i=1; i<n; i++)
            {
                if(ans[i-1] != a[i]) ans[i] = a[i];
                else if(ans[i-1] != b[i]) ans[i] = b[i];
                else ans[i] = c[i];
            }

            if(ans[n-1] == ans[0])
            {
                if(a[n-1] != ans[0] && a[n-1] != ans[n-2]) ans[n-1] = a[n-1];
                else if(b[n-1] != ans[0] && b[n-1] != ans[n-2]) ans[n-1] = b[n-1];
                else ans[n-1] = c[n-1];
            }

            for(int i=0; i<n; i++)
            {
                sb.append(ans[i] + " ");
            }

            sb.append("\n");
            test--;
        }
        System.out.print(sb);
    }

    public static int func(int[] arr, int k)
    {
        int n = arr.length;

        int[] leftmin = new int[n];
        for(int i=0; i<n; i++)
        {
            if(i % k == 0) leftmin[i] = arr[i];
            else leftmin[i] = Math.min(leftmin[i-1] , arr[i]);
        }

        int[] rightmin = new int[n];
        rightmin[n-1] = arr[n-1];
        for(int i=n-2; i>=0; i--)
        {
            if((i+1) % k == 0) rightmin[i] = arr[i];
            else rightmin[i] = Math.min(rightmin[i+1] , arr[i]);
        }

        int[] ans = new int[n - k + 1];
        for(int i=0; i<=n-k; i++)
        {
            ans[i] = Math.min(rightmin[i] , leftmin[i + k - 1]);
        }

        for(int i=1; i<ans.length; i++)
        {
            if(ans[i] != ans[0]) return -1;
        }

        // System.out.println(Arrays.toString(ans));

        return ans[0];
    }

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.util.*;
import java.io.*;

public class Codeforces
{
    public static void main(String[] args) throws Exception
    {
        FastReader scn =new FastReader();

        int test = scn.nextInt();

        StringBuilder sb = new StringBuilder();

        while(test > 0)
        {
            int n = scn.nextInt();
            int[] a = new int[n];
            int[] b = new int[n];
            int[] c = new int[n];

            for(int i=0; i<n; i++) a[i] = scn.nextInt();
            for(int i=0; i<n; i++) b[i] = scn.nextInt();
            for(int i=0; i<n; i++) c[i] = scn.nextInt();

            int[] ans = new int[n];
            ans[0] = a[0];

            for(int i=1; i<n; i++)
            {
                if(ans[i-1] != a[i]) ans[i] = a[i];
                else if(ans[i-1] != b[i]) ans[i] = b[i];
                else ans[i] = c[i];
            }

            if(ans[n-1] == ans[0])
            {
                if(a[n-1] != ans[0] && a[n-1] != a[n-2]) ans[n-1] = a[n-1];
                else if(b[n-1] != ans[0] && b[n-1] != b[n-2]) ans[n-1] = b[n-1];
                else ans[n-1] = c[n-1];
            }

            for(int i=0; i<n; i++)
            {
                sb.append(ans[i] + " ");
            }

            sb.append("\n");
            test--;
        }
        System.out.print(sb);
    }

    public static int func(int[] arr, int k)
    {
        int n = arr.length;

        int[] leftmin = new int[n];
        for(int i=0; i<n; i++)
        {
            if(i % k == 0) leftmin[i] = arr[i];
            else leftmin[i] = Math.min(leftmin[i-1] , arr[i]);
        }

        int[] rightmin = new int[n];
        rightmin[n-1] = arr[n-1];
        for(int i=n-2; i>=0; i--)
        {
            if((i+1) % k == 0) rightmin[i] = arr[i];
            else rightmin[i] = Math.min(rightmin[i+1] , arr[i]);
        }

        int[] ans = new int[n - k + 1];
        for(int i=0; i<=n-k; i++)
        {
            ans[i] = Math.min(rightmin[i] , leftmin[i + k - 1]);
        }

        for(int i=1; i<ans.length; i++)
        {
            if(ans[i] != ans[0]) return -1;
        }

        // System.out.println(Arrays.toString(ans));

        return ans[0];
    }

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.util.*;
import java.io.*;

public class Codeforces
{
    public static void main(String[] args) throws Exception
    {
        FastReader scn =new FastReader();

        int test = scn.nextInt();

        StringBuilder sb = new StringBuilder();

        while(test > 0)
        {
            int n = scn.nextInt();
            int[] a = new int[n];
            int[] b = new int[n];
            int[] c = new int[n];

            for(int i=0; i<n; i++) a[i] = scn.nextInt();
            for(int i=0; i<n; i++) b[i] = scn.nextInt();
            for(int i=0; i<n; i++) c[i] = scn.nextInt();

            int[] ans = new int[n];
            ans[0] = a[0];

            for(int i=1; i<n; i++)
            {
                if(ans[i-1] != a[i]) ans[i] = a[i];
                else if(ans[i-1] != b[i]) ans[i] = b[i];
                else ans[i] = c[i];
            }

            for(int i=0; i<n; i++)
            {
                sb.append(ans[i] + " ");
            }

            sb.append("\n");
            test--;
        }
        System.out.print(sb);
    }

    public static int func(int[] arr, int k)
    {
        int n = arr.length;

        int[] leftmin = new int[n];
        for(int i=0; i<n; i++)
        {
            if(i % k == 0) leftmin[i] = arr[i];
            else leftmin[i] = Math.min(leftmin[i-1] , arr[i]);
        }

        int[] rightmin = new int[n];
        rightmin[n-1] = arr[n-1];
        for(int i=n-2; i>=0; i--)
        {
            if((i+1) % k == 0) rightmin[i] = arr[i];
            else rightmin[i] = Math.min(rightmin[i+1] , arr[i]);
        }

        int[] ans = new int[n - k + 1];
        for(int i=0; i<=n-k; i++)
        {
            ans[i] = Math.min(rightmin[i] , leftmin[i + k - 1]);
        }

        for(int i=1; i<ans.length; i++)
        {
            if(ans[i] != ans[0]) return -1;
        }

        // System.out.println(Arrays.toString(ans));

        return ans[0];
    }

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.util.*;
public class Solution {
    public static ArrayList<Integer> solve(int[][] arr,int n){
        ArrayList<Integer> ans=new ArrayList<>();
        ans.add(arr[0][0]);
      for(int j=1;j<n;j++){
          boolean flag=false;
         for(int i=0;i<3;i++){
              if(ans.get(ans.size()-1)!=arr[i][j] && flag==false){
                  ans.add(arr[i][j]);
                  flag=true;
              }
          }
      }
      return ans;
    }
    public static void main(String args[]) {
     Scanner sc=new Scanner(System.in);
      int t=sc.nextInt();
      while(t-->0){
           int n=sc.nextInt();
         int[][] arr=new int[3][n];
         for(int i=0;i<3;i++){
             for(int j=0;j<n;j++){
                  arr[i][j]=sc.nextInt();
             }

         }
        ArrayList<Integer> res= solve(arr,n);
         for(int i=0;i<res.size();i++){
             System.out.print(res.get(i)+" ");
         }
         System.out.println();
      }

    }
}


import java.util.*;
public class Solution {
    public static ArrayList<Integer> solve(int[][] arr,int n){
        ArrayList<Integer> ans=new ArrayList<>();
        ans.add(arr[0][0]);
        for(int j=1;j<n;j++){
          boolean flag=false;
         for(int i=0;i<3;i++){
             if(j==n-1 && (arr[i][j]!=arr[0][0]) && arr[i][j]!=ans.get(ans.size()-1)){
                 ans.add(arr[i][j]);
                 break;
             }
             if(ans.get(ans.size()-1)!=arr[i][j] && flag==false && j!=n-1){
                  ans.add(arr[i][j]);
                  flag=true;
              }
          }
      }
      return ans;
    }
    public static void main(String args[]) {
     Scanner sc=new Scanner(System.in);
      int t=sc.nextInt();
      while(t-->0){
           int n=sc.nextInt();
         int[][] arr=new int[3][n];
         for(int i=0;i<3;i++){
             for(int j=0;j<n;j++){
                  arr[i][j]=sc.nextInt();
             }

         }
        ArrayList<Integer> res= solve(arr,n);
         for(int i=0;i<res.size();i++){
             System.out.print(res.get(i)+" ");
         }
         System.out.println();
      }

    }
}


import java.util.*;
public class Solution {
    public static ArrayList<Integer> solve(int[][] arr,int n){
        ArrayList<Integer> ans=new ArrayList<>();
        ans.add(arr[0][0]);
        for(int j=1;j<n;j++){
          boolean flag=false;
         for(int i=0;i<3;i++){
             if(j==n-1 && (arr[i][j]!=arr[0][0]) && arr[i][j]!=ans.get(ans.size()-1)){
                 ans.add(arr[i][j]);
             }
             if(ans.get(ans.size()-1)!=arr[i][j] && flag==false && j!=n-1){
                  ans.add(arr[i][j]);
                  flag=true;
              }
          }
      }
      return ans;
    }
    public static void main(String args[]) {
     Scanner sc=new Scanner(System.in);
      int t=sc.nextInt();
      while(t-->0){
           int n=sc.nextInt();
         int[][] arr=new int[3][n];
         for(int i=0;i<3;i++){
             for(int j=0;j<n;j++){
                  arr[i][j]=sc.nextInt();
             }

         }
        ArrayList<Integer> res= solve(arr,n);
         for(int i=0;i<res.size();i++){
             System.out.print(res.get(i)+" ");
         }
         System.out.println();
      }

    }
}