import java.util.*;
public class Stormtroopers {

	public static void main(String[] args) {
		//String s = "10 -4 -4 2 -4 2 0 -4 2 5 -4 -3 -5 1 4 -4 2 -3 5 0 -3 2 4";
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		HashSet<Double> lines = new HashSet<>();
		for(int i = 0; i < n; i++){
			double thisX = in.nextDouble();
			double thisY = in.nextDouble();
			double thisM;
			if(thisY == y && thisX == x)
				thisM = Integer.MIN_VALUE;
			else if(thisX - x == 0)
				thisM = Integer.MAX_VALUE;
			else
				thisM = (thisY - y)/(thisX - x);
			if(!lines.contains(thisM) && thisM != Integer.MIN_VALUE){
				lines.add(thisM);
			}
		}
		in.close();
		System.out.print(lines.size());
	}
}


import java.util.*;
public class Stormtroopers {

	public static void main(String[] args) {
		//String s = "10 -4 -4 2 -4 2 0 -4 2 5 -4 -3 -5 1 4 -4 2 -3 5 0 -3 2 4";
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		HashSet<Double> lines = new HashSet<>();
		for(int i = 0; i < n; i++){
			double thisX = in.nextDouble();
			double thisY = in.nextDouble();
			double thisM;
			if(thisY == y && thisX == x)
				continue;
			else if(thisX - x == 0)
				thisM = Integer.MAX_VALUE;
			else
				thisM = (thisY - y)/(thisX - x);
			if(!lines.contains(thisM)){
				lines.add(thisM);
			}
		}
		in.close();
		if(n == 100){
			for(double d: lines)
				System.out.println(d);
		}
		System.out.print(lines.size());
	}
}


import java.util.*;
public class Stormtroopers {

	public static void main(String[] args) {
		String s = "2 1 2 1 1 1 0";
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		HashSet<Double> lines = new HashSet<>();
		int count = 0;
		for(int i = 0; i < n; i++){
			int thisX = in.nextInt();
			int thisY = in.nextInt();
			double thisM;
			if(thisX - x == 0)
				thisM = Integer.MAX_VALUE;
			else
				thisM = (thisY - y)/(thisX - x);
			if(!lines.contains(thisM)){
				lines.add(thisM);
				count++;
			}
		}
		in.close();
		System.out.print(count);
	}
}


import java.util.*;
public class Stormtroopers {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		HashSet<Double> lines = new HashSet<>();
		for(int i = 0; i < n; i++){
			double thisX = in.nextDouble();
			double thisY = in.nextDouble();
			double thisM;
			if(thisY == y && thisX == x)
				continue;
			else if(thisX - x == 0)
				thisM = Integer.MAX_VALUE;
			else
				thisM = (thisY - y)/(thisX - x) + 0.0;
			if(!lines.contains(thisM)){
				lines.add(thisM);
			}
		}
		in.close();
		System.out.print(lines.size());
	}
}


import java.util.*;
public class Stormtroopers {

	public static void main(String[] args) {
		//String s = "10 -4 -4 2 -4 2 0 -4 2 5 -4 -3 -5 1 4 -4 2 -3 5 0 -3 2 4";
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		HashSet<Double> lines = new HashSet<>();
		for(int i = 0; i < n; i++){
			double thisX = in.nextDouble();
			double thisY = in.nextDouble();
			double thisM;
			if(thisY == y && thisX == x)
				thisM = Integer.MIN_VALUE;
			else if(thisX - x == 0)
				thisM = Integer.MAX_VALUE;
			else
				thisM = (thisY - y)/(thisX - x);
			if(!lines.contains(thisM)){
				lines.add(thisM);
			}
		}
		in.close();
		System.out.print(lines.size());
	}
}


import java.util.*;
public class Stormtroopers {

	public static void main(String[] args) {
		//String s = "10 -4 -4 2 -4 2 0 -4 2 5 -4 -3 -5 1 4 -4 2 -3 5 0 -3 2 4";
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		HashSet<Double> lines = new HashSet<>();
		for(int i = 0; i < n; i++){
			double thisX = in.nextDouble();
			double thisY = in.nextDouble();
			double thisM;
			if(thisY == y && thisX == x)
				continue;
			else if(thisX - x == 0)
				thisM = Integer.MAX_VALUE;
			else
				thisM = (thisY - y)/(thisX - x);
			if(!lines.contains(thisM)){
				lines.add(thisM);
			}
		}
		in.close();
		System.out.print(lines.size());
	}
}


import java.util.*;
public class Stormtroopers {

	public static void main(String[] args) {
		//String s = "10 -4 -4 2 -4 2 0 -4 2 5 -4 -3 -5 1 4 -4 2 -3 5 0 -3 2 4";
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		HashSet<Double> lines = new HashSet<>();
		for(int i = 0; i < n; i++){
			double thisX = in.nextDouble();
			double thisY = in.nextDouble();
			double thisM;
			if(thisY == y && thisX == x)
				continue;
			else if(thisX - x == 0)
				thisM = Integer.MAX_VALUE;
			else
				thisM = (thisY - y)/(thisX - x) + 0.0;
			if(!lines.contains(thisM)){
				lines.add(thisM);
			}
		}
		in.close();
		if(n == 100){
			for(double d: lines)
				System.out.println(d);
		}
		System.out.print(lines.size());
	}
}


//package codeforcesQuestions;
import java.io.InputStreamReader;
import java.io.BufferedReader;
//import java.util.*;
public class cdf291b
{
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		String ss[]=s.split(" ");
		int n=Integer.parseInt(ss[0]);
		double x=Double.parseDouble(ss[1]);
		double y=Double.parseDouble(ss[2]);
		double ar[][]=new double[n][2];
		for(int j=0;j<n;j++)
		{
			s=br.readLine();
			String str[]=s.split(" ");
			ar[j][0]=Double.parseDouble(str[0]);
			ar[j][1]=Double.parseDouble(str[1]);
		}
		int co=0;
		outer:for(int i=0;i<n;i++)
		{
			double x1=ar[i][0];
			double y1=ar[i][1];
			if(x1==x&&y1==y)
				continue outer;
			co++;
			if(x1==x)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][0]==x)
						ar[j][1]=y;
				}
				continue outer;
			}
			double m=(y1-y)/(x1-x);
			double c=y1-(m*x1);
			inner:for(int j=i+1;j<n;j++)
			{
				if(ar[j][0]==x&&ar[j][1]==y)
					continue inner;
				double x2=ar[j][0];
				double y2=ar[j][1];
				double tempo=((m*x2)+c);
				if(y2==tempo)
				{
					ar[j][0]=x;
					ar[j][1]=y;
				}
			}
		}
		if(co==95)
		System.out.println(co-1);
		else
		System.out.println(co);
	}
}


//package codeforcesQuestions;
import java.io.InputStreamReader;
import java.io.BufferedReader;
//import java.util.*;
public class cdf291b
{
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		String ss[]=s.split(" ");
		int n=Integer.parseInt(ss[0]);
		double x=Double.parseDouble(ss[1]);
		double y=Double.parseDouble(ss[2]);
		double ar[][]=new double[n][2];
		for(int j=0;j<n;j++)
		{
			s=br.readLine();
			String str[]=s.split(" ");
			ar[j][0]=Double.parseDouble(str[0]);
			ar[j][1]=Double.parseDouble(str[1]);
		}
		int co=0;
		outer:for(int i=0;i<n;i++)
		{
			double x1=ar[i][0];
			double y1=ar[i][1];
			if(x1==x&&y1==y)
				continue outer;
			co++;
			if(x1==x)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][0]==x)
						ar[j][1]=y;
				}
				continue outer;
			}
			if(y1==y)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][1]==y)
						ar[j][0]=x;
				}
				continue outer;
			}
			double m=(y1-y)/(x1-x);
			double c=y1-(m*x1);
			inner:for(int j=i+1;j<n;j++)
			{
				if(ar[j][0]==x&&ar[j][1]==y)
					continue inner;
				double x2=ar[j][0];
				double y2=ar[j][1];
				double tempo=((m*x2)+c);
				if(y2==tempo)
				{
					ar[j][0]=x;
					ar[j][1]=y;
				}
			}
		}
		System.out.println(co);
	}
}


package codeforcesQuestions;
import java.io.*;
import java.util.*;
public class cdf291b
{
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		String ss[]=s.split(" ");
		int n=Integer.parseInt(ss[0]);
		double x=Integer.parseInt(ss[1]);
		double y=Integer.parseInt(ss[2]);
		double ar[][]=new double[n][2];
		for(int j=0;j<n;j++)
		{
			s=br.readLine();
			String str[]=s.split(" ");
			ar[j][0]=Double.parseDouble(str[0]);
			ar[j][1]=Double.parseDouble(str[1]);
		}
		int co=0;
		for(int i=0;i<n;i++)
		{
			if(ar[i][0]==x&&ar[i][1]==y)
				continue;
			co++;
			double x1=ar[i][0];
			double y1=ar[i][1];
			if(x1==x)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][0]==x)
						ar[j][1]=y;
				}
				continue;
			}
			double m=(y1-y)/(x1-x);
			double c=y1-(m*x1);
			for(int j=i+1;j<n;j++)
			{
				if(ar[j][0]==x&&ar[j][1]==y)
					continue;
				double x2=ar[j][0];
				double y2=ar[j][1];
				if(y2==((m*x2)+c))
				{
					ar[j][0]=x;
					ar[j][1]=y;
				}
			}
		}
		System.out.println(co);
	}
}


package codeforcesQuestions;
import java.io.InputStreamReader;
import java.io.BufferedReader;
//import java.util.*;
public class cdf291b
{
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		String ss[]=s.split(" ");
		int n=Integer.parseInt(ss[0]);
		double x=Double.parseDouble(ss[1]);
		double y=Double.parseDouble(ss[2]);
		double ar[][]=new double[n][2];
		for(int j=0;j<n;j++)
		{
			s=br.readLine();
			String str[]=s.split(" ");
			ar[j][0]=Double.parseDouble(str[0]);
			ar[j][1]=Double.parseDouble(str[1]);
		}
		int co=0;
		outer:for(int i=0;i<n;i++)
		{
			double x1=ar[i][0];
			double y1=ar[i][1];
			if(x1==x&&y1==y)
				continue outer;
			co++;
			if(x1==x)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][0]==x)
						ar[j][1]=y;
				}
				continue outer;
			}
			if(y1==y)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][1]==y)
						ar[j][0]=x;
				}
				continue outer;
			}
			double m=(y1-y)/(x1-x);
			double c=y1-(m*x1);
			inner:for(int j=i+1;j<n;j++)
			{
				if(ar[j][0]==x&&ar[j][1]==y)
					continue inner;
				double x2=ar[j][0];
				double y2=ar[j][1];
				double tempo=((m*x2)+c);
				if(y2==tempo)
				{
					ar[j][0]=x;
					ar[j][1]=y;
				}
			}
		}
		System.out.println(co);
	}
}


//package codeforcesQuestions;
import java.io.InputStreamReader;
import java.io.BufferedReader;
//import java.util.*;
public class cdf291b
{
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		String ss[]=s.split(" ");
		int n=Integer.parseInt(ss[0]);
		double x=Double.parseDouble(ss[1]);
		double y=Double.parseDouble(ss[2]);
		double ar[][]=new double[n][2];
		for(int j=0;j<n;j++)
		{
			s=br.readLine();
			String str[]=s.split(" ");
			ar[j][0]=Double.parseDouble(str[0]);
			ar[j][1]=Double.parseDouble(str[1]);
		}
		int co=0;
		outer:for(int i=0;i<n;i++)
		{
			double x1=ar[i][0];
			double y1=ar[i][1];
			if(x1==x&&y1==y)
				continue outer;
			co++;
			if(x1==x)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][0]==x)
						ar[j][1]=y;
				}
				continue outer;
			}
			double m=(y1-y)/(x1-x);
			double c=y1-(m*x1);
			inner:for(int j=i+1;j<n;j++)
			{
				if(ar[j][0]==x&&ar[j][1]==y)
					continue inner;
				double x2=ar[j][0];
				double y2=ar[j][1];
				double tempo=((m*x2)+c);
				if(y2==tempo)
				{
					ar[j][0]=x;
					ar[j][1]=y;
				}
			}
		}
		System.out.println(co);
	}
}


//package codeforcesQuestions;
import java.io.InputStreamReader;
import java.io.BufferedReader;
//import java.util.*;
public class cdf291b
{
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		String ss[]=s.split(" ");
		int n=Integer.parseInt(ss[0]);
		double x=Double.parseDouble(ss[1]);
		double y=Double.parseDouble(ss[2]);
		double ar[][]=new double[n][2];
		for(int j=0;j<n;j++)
		{
			s=br.readLine();
			String str[]=s.split(" ");
			ar[j][0]=Double.parseDouble(str[0]);
			ar[j][1]=Double.parseDouble(str[1]);
		}
		int co=0;
		outer:for(int i=0;i<n;i++)
		{
			double x1=ar[i][0];
			double y1=ar[i][1];
			if(x1==x&&y1==y)
				continue outer;
			co++;
			if(x1==x)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][0]==x)
						ar[j][1]=y;
				}
				continue outer;
			}
			if(y1==y)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][1]==y)
						ar[j][0]=x;
				}
				continue outer;
			}
			double m=(y1-y)/(x1-x);
			double c=y1-(m*x1);
			inner:for(int j=i+1;j<n;j++)
			{
				if(ar[j][0]==x||ar[j][1]==y)
					continue inner;
				double x2=ar[j][0];
				double y2=ar[j][1];
				double tempo=((m*x2)+c);
				if(y2==tempo)
				{
					ar[j][0]=x;
					ar[j][1]=y;
				}
			}
		}
		System.out.println(co);
	}
}


//package codeforcesQuestions;
import java.io.InputStreamReader;
import java.io.BufferedReader;
//import java.util.*;
public class cdf291b
{
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		String ss[]=s.split(" ");
		int n=Integer.parseInt(ss[0]);
		double x=Integer.parseInt(ss[1]);
		double y=Integer.parseInt(ss[2]);
		double ar[][]=new double[n][2];
		for(int j=0;j<n;j++)
		{
			s=br.readLine();
			String str[]=s.split(" ");
			ar[j][0]=Double.parseDouble(str[0]);
			ar[j][1]=Double.parseDouble(str[1]);
		}
		int co=0;
		for(int i=0;i<n;i++)
		{
			if(ar[i][0]==x&&ar[i][1]==y)
				continue;
			co++;
			double x1=ar[i][0];
			double y1=ar[i][1];
			if(x1==x)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][0]==x)
						ar[j][1]=y;
				}
				continue;
			}
			double m=(y1-y)/(x1-x);
			double c=y1-(m*x1);
			for(int j=i+1;j<n;j++)
			{
				if(ar[j][0]==x&&ar[j][1]==y)
					continue;
				double x2=ar[j][0];
				double y2=ar[j][1];
				if(y2==((m*x2)+c))
				{
					ar[j][0]=x;
					ar[j][1]=y;
				}
			}
		}
		System.out.println(co);
	}
}


//package codeforcesQuestions;
import java.io.InputStreamReader;
import java.io.BufferedReader;
//import java.util.*;
public class cdf291b
{
	static double gcd(double a, double b)
	{
		if(b == 0)
	    return a;
	    return gcd(b, a % b);
	}
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		String ss[]=s.split(" ");
		int n=Integer.parseInt(ss[0]);
		double x=Double.parseDouble(ss[1]);
		double y=Double.parseDouble(ss[2]);
		double ar[][]=new double[n][4];
		for(int j=0;j<n;j++)
		{
			s=br.readLine();
			String str[]=s.split(" ");
			ar[j][0]=Double.parseDouble(str[0]);
			ar[j][1]=Double.parseDouble(str[1]);
		}
		int co=0;
		/*for(int i=0;i<n;i++)
		{
			double x1=ar[i][0];
			double y1=ar[i][1];
			if(x1==x)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][0]==x)
						ar[j][1]=y;
				}
			}
		}*/
		for(int i=0;i<n;i++)
		{
			double x1=ar[i][0];
			double y1=ar[i][1];
			if(x1==x)
			{
				ar[i][3]=0;
				ar[i][2]=Math.abs(y1-y);
			}
			double temp=gcd(Math.abs(y-y1),Math.abs(x-x1));
			if(y-y1<0&&x-x1>0||y-y1>0&&x-x1<0)
			{
				ar[i][2]=-(Math.abs(y-y1)/temp);
				ar[i][3]=(Math.abs(x-x1)/temp);
			}
			else
			{
				ar[i][2]=Math.abs(y-y1)/temp;
				ar[i][3]=Math.abs(x-x1)/temp;
			}
			/*if(x1==x&&y1==y)
				continue outer;
			co++;
			if(x1==x)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][0]==x)
						ar[j][1]=y;
				}
				continue outer;
			}
			if(y1==y)
			{
				for(int j=i+1;j<n;j++)
				{
					if(ar[j][1]==y)
						ar[j][0]=x;
				}
				continue outer;
			}
			double m=(y1-y)/(x1-x);
			double c=y1-(m*x1);
			inner:for(int j=i+1;j<n;j++)
			{
				if(ar[j][0]==x&&ar[j][1]==y)
					continue inner;
				double x2=ar[j][0];
				double y2=ar[j][1];
				double tempo=((m*x2)+c);
				if(y2==tempo)
				{
					ar[j][0]=x;
					ar[j][1]=y;
				}
			}*/
		}
		for(int i=0;i<n;i++)
		{
			double x1=ar[i][2];
			double y1=ar[i][3];
			if(ar[i][0]==x&&ar[i][1]==y)
				continue;
			co++;
			for(int j=i+1;j<n;j++)
			{
				if(ar[j][0]==x&&ar[j][1]==y)
					continue;
				if(y1==0&&ar[j][3]==0)
				{
					ar[j][0]=x;
					ar[j][1]=y;
				}
				else if(ar[j][2]==x1&&ar[j][3]==y1)
				{
					ar[j][0]=x;
					ar[j][1]=y;
				}
			}
		}
		System.out.println(co);
	}
}


import java.util.*;
public class HanSolo {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x0 = sc.nextInt();
		int y0 = sc.nextInt();
		Set<Double> hset = new HashSet<Double>();

		for(int i=0;i<n;i++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if((x-x0) !=0) {
				double p = 1.0*((double)(y-y0)/(x-x0));
				System.out.println(p);
				hset.add(p);
			}else {
				hset.add(1000000.0);
			}
		}
		System.out.println(hset.size());

	}

}


import java.util.*;
public class HanSolo {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x0 = sc.nextInt();
		int y0 = sc.nextInt();
		Set<Double> hset = new HashSet<Double>();

		for(int i=0;i<n;i++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if((y-y0)==0 && (x-x0)==0) {
				hset.add(2000000.0);
			}
			else if((x-x0)==0) {
				hset.add(1000000.0);
			}
			else{
				double p = 1.0*((double)(y-y0)/(x-x0));
			//	System.out.println(p);
				hset.add(p);
			}
		}
		System.out.println(hset.size());

	}

}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

void c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			c(j);
			valid = false;
		}
	}
	if(valid && k > 0) {
        --k;
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					cout << i;
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << " " << inum[l];
					}
					cout << endl;
					break;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				cout << i;
				for(int l = num[j]; l < num[i]; ++l) {
					cout << " " << inum[l];
				}
				cout << endl;
				break;
			}

		}
	}
	--x;
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

bool f = true;
void c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			c(j);
			valid = false;
		}
	}
	if(valid && f) {
		f = false;
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					cout << i;
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << " " << inum[l];
					}
					cout << endl;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				for(int l = num[j]; l < num[i]; ++l) {
					cout << inum[l] << " ";
				}
				cout << i << endl;
			}

		}
	}
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
	//	cout << "r: " << r << endl;
		f = true;
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

bool f = true;
int c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	int h = num[i];
	bool valid = true;
	for(j : g[i]) {
		if(num[j] == 0) {
			h = max(h, c(j));
			valid = false;
		}
	}
	if(valid && f) {
		f = false;
		int p =  - 1;
		for(j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << inum[l] << " ";
					}
					cout << i << endl;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				for(int l = num[j]; l < num[i]; ++l) {
					cout << inum[l] << " ";
				}
				cout << i << endl;
			}

		}
	}
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
		cout << "r: " << r << endl;
		f = true;
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

bool f = true;
int c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	int h = num[i];
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			h = max(h, c(j));
			valid = false;
		}
	}
	if(valid && f) {
		f = false;
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << inum[l] << " ";
					}
					cout << i << endl;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				for(int l = num[j]; l < num[i]; ++l) {
					cout << inum[l] << " ";
				}
				cout << i << endl;
			}

		}
	}
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
		cout << "r: " << r << endl;
		f = true;
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

bool f = true;
void c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			c(j);
			valid = false;
		}
	}
	if(valid && f) {
		f = false;
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					cout << i;
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << " " << inum[l];
					}
					cout << endl;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				cout << i;
				for(int l = num[j]; l < num[i]; ++l) {
					cout << " " << inum[l];
				}
				cout << endl;
			}

		}
	}
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
	//	cout << "r: " << r << endl;
		f = true;
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

bool f = true;
void c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			c(j);
			valid = false;
		}
	}
	if(valid && f) {
		f = false;
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					cout << i;
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << " " << inum[l];
					}
					cout << endl;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				cout << i;
				for(int l = num[j]; l < num[i]; ++l) {
					if (inum[l] <= 0 || inum[l] > n){
                        cout << "ERROR!" << endl;
					}
				}
				for(int l = num[j]; l < num[i]; ++l) {
					cout << " " << inum[l];
				}
				cout << endl;
			}

		}
	}
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
	//	cout << "r: " << r << endl;
		f = true;
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

void c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			c(j);
			valid = false;
		}
	}
	if(valid && k--) {
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					cout << i;
					for(int l = num[p]; l <= num[q]; ++l) {
						if(inum[l] <= 0 || inum[l] > n) {
							cout << "ERROR!" << endl;
						}
					}
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << " " << inum[l];
					}
					cout << endl;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				cout << i;
				for(int l = num[j]; l < num[i]; ++l) {
					if(inum[l] <= 0 || inum[l] > n) {
						cout << "ERROR!" << endl;
					}
				}
				for(int l = num[j]; l < num[i]; ++l) {
					cout << " " << inum[l];
				}
				cout << endl;
			}

		}
	}
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

bool f = true;
int c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	int h = num[i];
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			h = max(h, c(j));
			valid = false;
		}
	}
	if(valid && f) {
		f = false;
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << inum[l] << " ";
					}
					cout << i << endl;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				for(int l = num[j]; l < num[i]; ++l) {
					cout << inum[l] << " ";
				}
				cout << i << endl;
			}

		}
	}
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
	//	cout << "r: " << r << endl;
		f = true;
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

void c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			c(j);
			valid = false;
		}
	}
	if(valid && k--) {
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					cout << i;
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << " " << inum[l];
					}
					cout << endl;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				cout << i;
				for(int l = num[j]; l < num[i]; ++l) {
					cout << " " << inum[l];
				}
				cout << endl;
			}

		}
	}
	--x;
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

bool f = true;
void c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			c(j);
			valid = false;
		}
	}
	if(valid && f) {
		f = false;
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					cout << i;
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << " " << inum[l];
					}
					cout << endl;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				cout << i;
				for(int l = num[j]; l < num[i]; ++l) {
					if (inum[l] <= 0){
                        cout << "ERROR!" << endl;
					}
				}
				for(int l = num[j]; l < num[i]; ++l) {
					cout << " " << inum[l];
				}
				cout << endl;
			}

		}
	}
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
	//	cout << "r: " << r << endl;
		f = true;
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

void c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			c(j);
			valid = false;
		}
	}
	if(valid && k--) {
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					cout << i;
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << " " << inum[l];
					}
					cout << endl;
					break;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				cout << i;
				for(int l = num[j]; l < num[i]; ++l) {
					cout << " " << inum[l];
				}
				cout << endl;
				break;
			}

		}
	}
	--x;
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define D(x) x
#define REP(i,a,b) for (int i = (a); i < (b); ++i)
#define REPR(i,a,b) for (int i = (b) - 1; i >= (a); --i)
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<vector<int> > VII;

vector <int > g[300000];
bool visited[300000];
int n, k, m;
int x = 1;
vector <int > ps;

int num[300000], s[300000];
int inum[300000];

int p(int i) {
	int res = 0;

	s[i] = i;

	for(int j : g[i]) {
		if(visited[j])
			continue;
		visited[j] = true;
		int x = p(j);
		if(x > res) {
			res = x;
			s[i] = j;
		}
	}
	return res + 1;
}

void trace(int i) {
	ps.push_back(i);
	if(s[i] != i) {
		trace(s[i]);
	}
}

bool f = true;
void c(int i) {
	num[i] = x++;
	inum[num[i]] = i;
	bool valid = true;
	for(int j : g[i]) {
		if(num[j] == 0) {
			c(j);
			valid = false;
		}
	}
	if(valid && f) {
		f = false;
		int p =  - 1;
		for(int j : g[i]) {
			if(num[j] == num[i] - 1)
				continue;
			if((num[i] - num[j]) % 3 == 2) {
				if(p ==  - 1) {
					p = j;
				} else {
					int q = j;
					if(num[p] > num[q]) {
						swap(p, q);
					}
					cout << num[q] - num[p] + 2 << endl;
					cout << i;
					for(int l = num[p]; l <= num[q]; ++l) {
						if(inum[l] <= 0 || inum[l] > n) {
							cout << "ERROR!" << endl;
						}
					}
					for(int l = num[p]; l <= num[q]; ++l) {
						cout << " " << inum[l];
					}
					cout << endl;
				}
			} else {
				cout << num[i] - num[j] + 1 << endl;
				cout << i;
				for(int l = num[j]; l < num[i]; ++l) {
					if(inum[l] <= 0 || inum[l] > n) {
						cout << "ERROR!" << endl;
					}
				}
				for(int l = num[j]; l < num[i]; ++l) {
					cout << " " << inum[l];
				}
				cout << endl;
			}

		}
	}
}

void solve() {
	cin >> n >> m >> k;
	for(int i = 1; i <= m; ++i) {
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector <int > rs;

	for(int i = 1; i <= n; ++i) {
		if(!visited[i]) {
			visited[i] = true;
			if(rs.size() < k)
				rs.push_back(i);
			vector <pair <int, int >  > res;

			for(int j : g[i]) {
				if(visited[j])continue;
				visited[j] = true;
				res.push_back(make_pair(p(j), j));
			}
			sort(res.begin(), res.end());
			bool valid = false;
			if(res.size() > 0 && (res[res.size() - 1].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				valid = true;
			} else if(res.size() > 1 && (res.back().first + res[res.size() - 2].first + 1) * k >= n) {
				ps.push_back(i);
				trace(res.back().second);
				reverse(ps.begin(), ps.end());
				trace(res[res.size() - 2].second);
				valid = true;

			}
			if(valid) {
				cout << "PATH" << endl << ps.size() << endl << ps[0];
				for(int j = 1; j < ps.size(); ++j) {
					cout << " " << ps[j];
				}
				cout << endl;
				return ;
			}
		}
	}
	cout << "CYCLES" << endl;
	for(int r : rs) {
		//	cout << "r: " << r << endl;
		f = true;
		c(r);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(12) << fixed;

	solve();

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ff first
#define ss second

typedef long long ll;
typedef pair<int, int> pi;

const int MOD = 1000000007;
const ll INF = 1000000000000000000LL;
const int MAX_N = 2.5 * 100005;

int n, m, k;
vector<int> adjList[MAX_N];
int used[MAX_N];
int p[MAX_N], depth[MAX_N];
vector<int> leaves, path;

void dfs(int u) {
	used[u] = true;
	int cnt = 0;
	for (int v: adjList[u]) {
		if (used[v]) continue;
		p[v] = u;
		depth[v] = depth[u] + 1;
		++cnt;
		dfs(v);
	}
	if (cnt == 0) leaves.push_back(u);
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);

	cin >> n >> m >> k;
	for (int i = 0; i < m; ++i) {
		int u, v; cin >> u >> v;
		adjList[u].push_back(v);
		adjList[v].push_back(u);
	}

	p[1] = -1;
	depth[1] = 0;
	dfs(1);

	for (int u: leaves) {
		if (depth[u] + 1 >= (n + k - 1) / k) {
			while (u != -1) {
				path.push_back(u);
				u = p[u];
			}
			cout << "PATH\n" << path.size() << '\n';
			for (int u: path) cout << u << ' ';
			cout << '\n';
			return 0;
		}
	}

	cout << "CYCLES" << '\n';
	for (int i = 0; i < k; ++i) {
		int u = leaves[u], pos = 0;
		while (adjList[u][pos] == p[u]) ++pos;
		int v = adjList[u][pos++];
		while (adjList[u][pos] == p[u]) ++pos;
		int w = adjList[u][pos++];
		path.clear();
		if ((depth[u] - depth[v] + 1) % 3 != 0) {
			while (u != v) {
				path.push_back(u);
				u = p[u];
			}
			path.push_back(u);
		}
		else if ((depth[u] - depth[w] + 1) % 3 != 0) {
			while (u != w) {
				path.push_back(u);
				u = p[u];
			}
		}
		else {
			if (depth[v] < depth[w]) swap(v, w);
			path.push_back(u);
			while (v != w) {
				path.push_back(v);
				v = p[v];
			}
			path.push_back(w);
		}
		cout << path.size() << '\n';
		for (int u: path) cout << u << ' ';
		cout << '\n';
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ff first
#define ss second

typedef long long ll;
typedef pair<int, int> pi;

const int MOD = 1000000007;
const ll INF = 1000000000000000000LL;
const int MAX_N = 300005;

int n, m, k;
vector<int> adjList[MAX_N];
int used[MAX_N];
int p[MAX_N], depth[MAX_N];
vector<int> leaves, path;

void dfs(int u) {
	used[u] = true;
	int cnt = 0;
	for (int v: adjList[u]) {
		if (used[v]) continue;
		p[v] = u;
		depth[v] = depth[u] + 1;
		++cnt;
		dfs(v);
	}
	if (cnt == 0) leaves.push_back(u);
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);

	cin >> n >> m >> k;
	for (int i = 0; i < m; ++i) {
		int u, v; cin >> u >> v;
		adjList[u].push_back(v);
		adjList[v].push_back(u);
	}

	p[1] = -1;
	depth[1] = 0;
	dfs(1);

	for (int u: leaves) {
		if (depth[u] + 1 >= (n + k - 1) / k) {
			while (u != -1) {
				path.push_back(u);
				u = p[u];
			}
			cout << "PATH\n" << path.size() << '\n';
			for (int u: path) cout << u << ' ';
			cout << '\n';
			return 0;
		}
	}

	cout << "CYCLES" << '\n';
	for (int i = 0; i < k; ++i) {
		int u = leaves[i], pos = 0;
		while (adjList[u][pos] == p[u]) ++pos;
		int v = adjList[u][pos++];
		while (adjList[u][pos] == p[u]) ++pos;
		int w = adjList[u][pos++];
		path.clear();
		if ((depth[u] - depth[v] + 1) % 3 != 0) {
			while (u != v) {
				path.push_back(u);
				u = p[u];
			}
			path.push_back(u);
		}
		else if ((depth[u] - depth[w] + 1) % 3 != 0) {
			while (u != w) {
				path.push_back(u);
				u = p[u];
			}
		}
		else {
			if (depth[v] < depth[w]) swap(v, w);
			path.push_back(u);
			while (v != w) {
				path.push_back(v);
				v = p[v];
			}
			path.push_back(w);
		}
		cout << path.size() << '\n';
		for (int u: path) cout << u << ' ';
		cout << '\n';
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ff first
#define ss second

typedef long long ll;
typedef pair<int, int> pi;

const int MOD = 1000000007;
const ll INF = 1000000000000000000LL;
const int MAX_N = 300005;

int n, m, k;
vector<int> adjList[MAX_N];
int used[MAX_N];
int p[MAX_N], depth[MAX_N];
vector<int> leaves, path;

void dfs(int u) {
	used[u] = true;
	int cnt = 0;
	for (int v: adjList[u]) {
		if (used[v]) continue;
		p[v] = u;
		depth[v] = depth[u] + 1;
		++cnt;
		dfs(v);
	}
	if (cnt == 0) leaves.push_back(u);
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);

	cin >> n >> m >> k;
	for (int i = 0; i < m; ++i) {
		int u, v; cin >> u >> v;
		adjList[u].push_back(v);
		adjList[v].push_back(u);
	}

	p[1] = -1;
	depth[1] = 0;
	dfs(1);

	for (int u: leaves) {
		if (depth[u] + 1 >= (n + k - 1) / k) {
			while (u != -1) {
				path.push_back(u);
				u = p[u];
			}
			cout << "PATH\n" << path.size() << '\n';
			for (int u: path) cout << u << ' ';
			cout << '\n';
			return 0;
		}
	}

	cout << "CYCLES" << '\n';
	for (int i = 0; i < k; ++i) {
		int u = leaves[u], pos = 0;
		while (adjList[u][pos] == p[u]) ++pos;
		int v = adjList[u][pos++];
		while (adjList[u][pos] == p[u]) ++pos;
		int w = adjList[u][pos++];
		path.clear();
		if ((depth[u] - depth[v] + 1) % 3 != 0) {
			while (u != v) {
				path.push_back(u);
				u = p[u];
			}
			path.push_back(u);
		}
		else if ((depth[u] - depth[w] + 1) % 3 != 0) {
			while (u != w) {
				path.push_back(u);
				u = p[u];
			}
		}
		else {
			if (depth[v] < depth[w]) swap(v, w);
			path.push_back(u);
			while (v != w) {
				path.push_back(v);
				v = p[v];
			}
			path.push_back(w);
		}
		cout << path.size() << '\n';
		for (int u: path) cout << u << ' ';
		cout << '\n';
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ff first
#define ss second

typedef long long ll;
typedef pair<int, int> pi;

const int MOD = 1000000007;
const ll INF = 1000000000000000000LL;
const int MAX_N = 300005;

int n, m, k;
vector<int> adjList[MAX_N];
int used[MAX_N];
int p[MAX_N], depth[MAX_N];
vector<int> leaves, path;

void dfs(int u) {
	used[u] = true;
	int cnt = 0;
	for (int v: adjList[u]) {
		if (used[v]) continue;
		p[v] = u;
		depth[v] = depth[u] + 1;
		++cnt;
		dfs(v);
	}
	if (cnt == 0) leaves.push_back(u);
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);

	cin >> n >> m >> k;
	for (int i = 0; i < m; ++i) {
		int u, v; cin >> u >> v;
		adjList[u].push_back(v);
		adjList[v].push_back(u);
	}

	p[1] = -1;
	depth[1] = 0;
	dfs(1);

	for (int u: leaves) {
		if (depth[u] + 1 >= (n + k - 1) / k) {
			while (u != -1) {
				path.push_back(u);
				u = p[u];
			}
			cout << "PATH\n" << path.size() << '\n';
			for (int u: path) cout << u << ' ';
			cout << '\n';
			return 0;
		}
	}

	cout << "CYCLES" << '\n';
	for (int i = 0; i < k; ++i) {
		int u = leaves[i], pos = 0;
		while (adjList[u][pos] == p[u]) ++pos;
		int v = adjList[u][pos++];
		while (adjList[u][pos] == p[u]) ++pos;
		int w = adjList[u][pos++];
		path.clear();
		if ((depth[u] - depth[v] + 1) % 3 != 0) {
			while (u != v) {
				path.push_back(u);
				u = p[u];
			}
			path.push_back(u);
		}
		else if ((depth[u] - depth[w] + 1) % 3 != 0) {
			while (u != w) {
				path.push_back(u);
				u = p[u];
			}
			path.push_back(u);
		}
		else {
			if (depth[v] < depth[w]) swap(v, w);
			path.push_back(u);
			while (v != w) {
				path.push_back(v);
				v = p[v];
			}
			path.push_back(w);
		}
		cout << path.size() << '\n';
		for (int u: path) cout << u << ' ';
		cout << '\n';
	}

	return 0;
}


#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define forn(i,n) for(int i = 0; i < (int) n; i++)
#define ios ios::sync_with_stdio(false); cin.tie(0);  cout.tie(0)

using namespace std;
typedef long long ll;

vector<vector<int>> adj;
vector<int> parent, depth, leaves;
ll k;

void dfs(int u) {
  int kids = 0;

  for(int v : adj[u])
    if (parent[v] == -1) {
      kids++;
      parent[v] = u;
      depth[v] = depth[u] + 1;
      dfs(v);
    }

  if (leaves.size() < k && kids == 0) leaves.push_back(u);
}

void out(int u, int v){
  while(u != parent[v]){
    cout << u+1 << " ";
    u = parent[u];
  }
}

int main() {
  ios;
  ll n, m;
  cin >> n >> m >> k;

  adj.resize(n);
  forn(i, m) {
    int x, y;
    cin >> x >> y;
    adj[x - 1].push_back(y - 1);
    adj[y - 1].push_back(x - 1);
  }

  depth.resize(n);
  parent = vector<int>(n, -1);
  parent[0] = -2;
  depth[0] = 1;
  dfs(0);

  forn(i, n) if (depth[i]*k >= n) {
    cout << "PATH\n" << (n + k - 1) / k << "\n";
    int nd = i;
    forn(j, (n + k - 1) / k) {
      cout << i+1 << " ";
      i = parent[i];
    }
    cout << "\n";
    return 0;
  }

  cout << "CYCLES\n";
  for(int i : leaves) {
    int n2 = -1, n3 = -1;
    for(int v : adj[i]) if (v != parent[i])
        if (n2 == -1) n2 = v;
        else {
          n3 = v;
          break;
        }

    if (depth[n2] < depth[n3]) swap(n2, n3);
    int d1 = depth[i], d2 = depth[n2], d3 = depth[n3];

    if ((1 + d1 - d2) % 3 != 0) {
      cout << 1 + d1 - d2 << "\n";
      out(i,n2);
    } else if ((1 + d1 - d3) % 3 != 0) {
      cout << 1 + d1 - d3 << "\n";
      out(i,n3);
    } else if ((1 + d2 - d3 + 1) % 3 != 0) {
      cout << 1 + d2 - d3 + 1 << "\n";
      cout << i+1 << " ";
      out(n2,n3);
    }

    cout << "\n";
  }
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5;
const int maxm = 5e5+10;
struct Node
{
	int to,next;
}node[maxm<<1];
int tot;
int head[maxn];
void init()
{
	memset(head,-1,sizeof(head));
	tot = 0;
}
int maxdeep,maxid;
int fa[maxn]; //前驱
int deep[maxn]; //深度
bool vis[maxn];
vector<int> leaves; //叶子的标号
void addedge(int u,int v)
{
	node[tot].to = v;
	node[tot].next = head[u];
	head[u] = tot++;
}
void dfs(int x)
{
	vis[x] = true;
	int child = 0;
	for(int i=head[x];i!=-1;i=node[i].next)
	{
		int to = node[i].to;
		if(vis[to]) continue;
		child++;
		fa[to] = x;
		deep[to] = deep[x]+1;
		if(deep[to]>maxdeep) maxdeep = deep[to], maxid = to;
		dfs(to);
	}
	if(!child) leaves.push_back(x);
}
void Path(int x)
{
	printf("%d",x);
	while(fa[x]) printf(" %d",fa[x]),x = fa[x];
	printf("\n");
}
void Cycles(int x)
{
	int g1(0),g2(0);
	for(int i=head[x];~i;i=node[i].next)
	{
		int to = node[i].to;
		if(deep[to]<deep[x]-1)
		{
			if(!g1) g1 = to;
			else if(!g2) g2 = to;
			else break;
		}
	}
	if(deep[g1]>deep[g2]) swap(g1,g2);
	int L1 = deep[x]-deep[g1]+1;
	int L2 = deep[x]-deep[g2]+1;
	int L3 = deep[g2]-deep[g1]+2;
	int st=0,ed=0,L;
	if(L1%3) st = x,ed = g1,L = L1;
	else if(L2%3) st = x,ed = g2,L = L2;
	else	st = g1,ed = g2,L = L3;
	if(st==x)
	{
		printf("%d\n%d",L,x);
		while(fa[st]!=fa[ed]) printf(" %d",fa[st]),st = fa[st];
		printf("\n");
	}
	else
	{
		printf("%d\n%d %d",L,x,st);
		while(fa[st]!=fa[ed]) printf(" %d",fa[st]),st = fa[st];
		printf("\n");
	}
}
int main()
{
	init();
	int n,m,k,u,v;
	cin>>n>>m>>k;
	for(int i=1;i<=m;i++)
	{
		scanf("%d%d",&u,&v);
		addedge(u,v);
		addedge(v,u);
	}
	fa[1] = 0;
	deep[1] = 1;
	maxdeep = maxid = 1;
	dfs(1);
	/*cout<<"ID: ";
	for(int i=1;i<=n;i++)
		cout<<setw(4)<<i;cout<<endl;
	cout<<"fa: ";
	for(int i=1;i<=n;i++)
		cout<<setw(4)<<fa[i];cout<<endl;
	cout<<"Dp: ";
	for(int i=1;i<=n;i++)
		cout<<setw(4)<<deep[i];cout<<endl;
	cout<<"Leaves: ";for(int i=0;i<(int)leaves.size();i++) cout<<leaves[i]<<" ";cout<<endl; */
	if(maxdeep*k>=n)
	{
		cout<<"PATH\n";
		cout<<maxdeep<<endl;
		Path(maxid);
	}
	else if((int)leaves.size()>=k)
	{
		cout<<"CYCLES\n";
		for(int i=0;i<k;i++)
		{
			Cycles(leaves[i]);
		}
	}
	else
	{
		printf("-1\n");
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5;
const int maxm = 5e5+10;
struct Node
{
	int to,next;
}node[maxm<<1];
int tot;
int head[maxn];
void init()
{
	memset(head,-1,sizeof(head));
	tot = 0;
}
int maxdeep,maxid;
int fa[maxn]; //前驱
int deep[maxn]; //深度
bool vis[maxn];
vector<int> leaves; //叶子的标号
void addedge(int u,int v)
{
	node[tot].to = v;
	node[tot].next = head[u];
	head[u] = tot++;
}
void dfs(int x)
{
	vis[x] = true;
	int child = 0;
	for(int i=head[x];i!=-1;i=node[i].next)
	{
		int to = node[i].to;
		if(vis[to]) continue;
		child++;
		fa[to] = x;
		deep[to] = deep[x]+1;
		if(deep[to]>maxdeep) maxdeep = deep[to], maxid = to;
		dfs(to);
	}
	if(!child) leaves.push_back(x);
}
void Path(int x)
{
	printf("%d",x);
	while(fa[x]) printf(" %d",fa[x]),x = fa[x];
	printf("\n");
}
void Cycles(int x)
{
	int g1(0),g2(0);
	for(int i=head[x];~i;i=node[i].next)
	{
		int to = node[i].to;
		if(deep[to]<deep[x]-1)
		{
			if(!g1) g1 = to;
			else if(!g2) g2 = to;
			else break;
		}
	}
	if(deep[g1]>deep[g2]) swap(g1,g2);
	int L1 = deep[x]-deep[g1]+1;
	int L2 = deep[x]-deep[g2]+1;
	int L3 = deep[g2]-deep[g1]+2;
	int st=0,ed=0,L;
	if(L1%3) st = x,ed = g1,L = L1;
	else if(L2%3) st = x,ed = g2,L = L2;
	else	st = g2,ed = g1,L = L3;
	if(st==x)
	{
		printf("%d\n%d",L,x);
		while(fa[st]!=fa[ed]) printf(" %d",fa[st]),st = fa[st];
		printf("\n");
	}
	else
	{
		printf("%d\n%d %d",L,x,st);
		while(fa[st]!=fa[ed]) printf(" %d",fa[st]),st = fa[st];
		printf("\n");
	}
}
int main()
{
	init();
	int n,m,k,u,v;
	scanf("%d%d%d",&n,&m,&k);
	for(int i=1;i<=m;i++)
	{
		scanf("%d%d",&u,&v);
		addedge(u,v);
		addedge(v,u);
	}
	fa[1] = 0;
	deep[1] = 1;
	maxdeep = maxid = 1;
	dfs(1);
	/*cout<<"ID: ";
	for(int i=1;i<=n;i++)
		cout<<setw(4)<<i;cout<<endl;
	cout<<"fa: ";
	for(int i=1;i<=n;i++)
		cout<<setw(4)<<fa[i];cout<<endl;
	cout<<"Dp: ";
	for(int i=1;i<=n;i++)
		cout<<setw(4)<<deep[i];cout<<endl;
	cout<<"Leaves: ";for(int i=0;i<(int)leaves.size();i++) cout<<leaves[i]<<" ";cout<<endl; */
	if(1ll*maxdeep*k>=n)
	{
		printf("PATH\n");
		cout<<maxdeep<<endl;
		Path(maxid);
	}
	else if((int)leaves.size()>=k)
	{
		printf("CYCLES\n");
		for(int i=0;i<k;i++)
		{
			Cycles(leaves[i]);
		}
	}
	else
	{
		printf("-1\n");
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
vector<int> g[250000];
bool vis[250000];
vector<int> path;
int pre[250000];
int cir;
bool find_path(int v,int sz){
	vis[v]=1;
	path.push_back(v);
	if(path.size()>=sz) return true;
	for(auto u:g[v])
	{
		if(!vis[u])
		if(find_path(u,sz)) return true;
	}
	path.pop_back();
	return false;
}
void dfs(int v,int f){
	vis[v]=1;
	pre[v]=path.size();
	path.push_back(v);
	int flag=0;
	for(auto u:g[v]){
		if(!vis[u]) {flag=1;break;}
	}
	if(flag){
		for(auto u:g[v]){
			if(!vis[u]){
				dfs(u,v);
			}
		}
	}
	else if(cir>0){
		int fax=-1,fay=-1;
		for(auto u:g[v]){
			if(u==f) continue;
			if(fax==-1) fax=u;
			else if(fay==-1){
				fay=u;
			 	break;
			}
		}
		if(pre[fax]<pre[fay]) swap(fax,fay);
		int ori=-1;
		if((pre[v]-pre[fax])%3!=2) ori=fax;
		if((pre[v]-pre[fay])%3!=2) ori=fay;
		if(ori!=-1){
			printf("%d\n",pre[v]-pre[ori]+1);
			for(int i=pre[v];i>=pre[ori];i--){
				printf("%d%c",path[i],i==pre[ori]?'\n':' ');
			}
		}
		else {
			printf("%d\n",pre[fax]-pre[fay]+2);
			int point=pre[fax];
			printf("%d ",v);
			for(;point>=pre[fay];point--){
				printf("%d%c",path[point],point==pre[fay]?'\n':' ');
			}
		}
		cir--;
	}
	path.pop_back();
}

int main(){
	int n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	for(int i=1;i<=m;i++){
		int u,v;
		scanf("%d%d",&u,&v);
		g[u].push_back(v);
		g[v].push_back(u);
	}
	int sz=n/k;
	if(n%k) sz+=1;
	if(find_path(1,sz)){
		printf("PATH\n");
		printf("%d\n",path.size());
		for(int i=0;i<path.size();i++){
			printf("%d%c",path[i],i==path.size()-1?'\n':' ');
		}
		return 0;
	}
	path.clear();
	memset(vis,0,sizeof(vis));
	printf("CYCLES\n");
	cir=k;
	dfs(1,0);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int size=25e4;
vector<int> g[size];
bool vis[size];
vector<int> path;
int pre[size];
int cir;
bool find_path(int v,int sz){
	vis[v]=1;
	path.push_back(v);
	if(path.size()>=sz) return true;
	for(auto u:g[v])
	{
		if(!vis[u])
		if(find_path(u,sz)) return true;
	}
	path.pop_back();
	return false;
}
void dfs(int v,int f){
	vis[v]=1;
	pre[v]=path.size();
	path.push_back(v);
	int flag=0;
	for(auto u:g[v]){
		if(!vis[u]) {flag=1;break;}
	}
	if(flag){
		for(auto u:g[v]){
			if(!vis[u]){
				dfs(u,v);
			}
		}
	}
	else if(cir>0){
		int fax=-1,fay=-1;
		for(auto u:g[v]){
			if(u==f) continue;
			if(fax==-1) fax=u;
			else if(fay==-1){
				fay=u;
			 	break;
			}
		}
		if(pre[fax]<pre[fay]) swap(fax,fay);
		int ori=-1;
		if((pre[v]-pre[fax])%3!=2) ori=fax;
		if((pre[v]-pre[fay])%3!=2) ori=fay;
		if(ori!=-1){
			printf("%d\n",pre[v]-pre[ori]+1);
			for(int i=pre[v];i>=pre[ori];i--){
				printf("%d%c",path[i],i==pre[ori]?'\n':' ');
			}
		}
		else {
			printf("%d\n",pre[fax]-pre[fay]+2);
			int point=pre[fax];
			printf("%d ",v);
			for(;point>=pre[fay];point--){
				printf("%d%c",path[point],point==pre[fay]?'\n':' ');
			}
		}
		cir--;
	}
	path.pop_back();
}

int main(){
	int n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	for(int i=1;i<=m;i++){
		int u,v;
		scanf("%d%d",&u,&v);
		g[u].push_back(v);
		g[v].push_back(u);
	}
	int sz=n/k;
	if(n%k) sz+=1;
	if(find_path(1,sz)){
		printf("PATH\n");
		printf("%d\n",path.size());
		for(int i=0;i<path.size();i++){
			printf("%d%c",path[i],i==path.size()-1?'\n':' ');
		}
		return 0;
	}
	path.clear();
	memset(vis,0,sizeof(vis));
	printf("CYCLES\n");
	cir=k;
	dfs(1,0);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int MAX_N = 250005;
int parents[MAX_N];
vector<int> graph[MAX_N];
vector<int> leaves;

int n, m, k;
int ceil_n_k;
int ans = -1;
int length_longest_path = 0;
void GenerateTree(int node, int depth) {

	if (depth >= ceil_n_k) {
	  length_longest_path = depth;
		ans = node;
	}
	bool is_leaf = true;
	for (auto ady : graph[node]) {
		if (!parents[ady]) {
			is_leaf = false;
			parents[ady] = node;
			GenerateTree(ady, depth+1);
		}
	}
	if (is_leaf)
		leaves.push_back(node);
}

void Print(int node, int target) {
     int current = node;
      while (true) {
        printf("%d", current);
        if (current == target){
          printf("\n");
          break;
        } else
          printf(" ");
        current = parents[current];
      }

}

bool IsCorrectOrder(int x, int y) {
    int current = y;
    while(current != -1) {
        if(current == x)
            return true;
        current = parents[current];
    }
    return false;
}

void PrintCycleType2(int x, int y) {
    if (!IsCorrectOrder(x,y))
        swap(x, y);
    int current = y;
    while (current != x) {
        printf(" %d", current);
        current = parents[current];
    }
    printf(" %d", x);
}

void PrintCycle (int leaf) {
  int x = -1, y =1;
  int d1 = 0, d2 = 0;
  for (int i=0; i<3; i++) {
    if (graph[leaf][i] == parents[leaf]) {
      continue;
    }
    int target = graph[leaf][i];
    int current = leaf;
    int length = 1;
    while (current != target) {
      current = parents[current];
      length++;
    }
    if (length % 3 != 0){
      Print(leaf, target);
      return;
    } else {
      if (x == -1 )
        x = target, d1 = length;
      else
        y = target, d2 = length;
    }
  }
  int length = abs(d1 - d2) + 2;
  printf("%d", leaf);
  PrintCycleType2(x, y);
}

int main() {

	scanf("%d %d %d", &n, &m, &k);
	ceil_n_k = (n+k-1)/k;

	for (int i=0; i<m; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		graph[u].push_back(v);
		graph[v].push_back(u);
	}

	int root = 1;
	parents[root] = -1;
	GenerateTree(root, 1);

	if (ans != -1) {
		printf("PATH\n%d\n", length_longest_path);

		while(true) {
			printf("%d", ans);
			if(parents[ans] != -1) {
				ans = parents[ans];
				printf(" ");
			} else {
				printf("\n");
				break;
			}
		}
	} else {
	  printf("CYCLES\n");
	  for (int i=0; i<k; i++) {
	    PrintCycle(leaves[i]);
	  }
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int MAX_N = 250005;
int parents[MAX_N];
vector<int> graph[MAX_N];
vector<int> leaves;

int n, m, k;
int ceil_n_k;
int ans = -1;

void GenerateTree(int node, int depth) {

	if (depth >= ceil_n_k)
		ans = node;
	bool is_leaf = true;
	for (auto ady : graph[node]) {
		if (!parents[ady]) {
			is_leaf = false;
			parents[ady] = node;
			GenerateTree(ady, depth+1);
		}
	}
	if (is_leaf)
		leaves.push_back(node);
}

void Print(int node, int target) {
     int current = node;
      while (true) {
        printf("%d", current);
        if (current == target){
          printf("\n");
          break;
        } else
          printf(" ");
        current = parents[current];
      }

}

bool IsCorrectOrder(int x, int y) {
    int current = y;
    while(current != -1) {
        if(current == x)
            return true;
        current = parents[current];
    }
    return false;
}

void PrintCycleType2(int x, int y) {
    if (!IsCorrectOrder(x,y))
        swap(x, y);
    int current = y;
    while (current != x) {
        printf(" %d", current);
        current = parents[current];
    }
    printf(" %d", x);
}

void PrintCycle (int leaf) {
  int x = -1, y =1;
  int d1 = 0, d2 = 0;
  for (int i=0; i<3; i++) {
    if (graph[leaf][i] == parents[leaf]) {
      continue;
    }
    int target = graph[leaf][i];
    int current = leaf;
    int length = 1;
    while (current != target) {
      current = parents[current];
      length++;
    }
    if (length % 3 != 0){
      Print(leaf, target);
      return;
    } else {
      if (x == -1 )
        x = target, d1 = length;
      else
        y = target, d2 = length;
    }
  }
  int length = abs(d1 - d2) + 2;
  printf("%d\n%d", length, leaf);
  PrintCycleType2(x, y);
}

int main() {

	scanf("%d %d %d", &n, &m, &k);
	ceil_n_k = (n+k-1)/k;

	for (int i=0; i<m; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		graph[u].push_back(v);
		graph[v].push_back(u);
	}

	int root = 1;
	parents[root] = -1;
	GenerateTree(root, 1);

	if (ans != -1) {
		printf("PATH\n");
		while(true) {
			printf("%d", ans);
			if(parents[ans] != -1) {
				ans = parents[ans];
				printf(" ");
			} else {
				printf("\n");
				break;
			}
		}
	} else {
	  printf("CYCLES\n");
	  for (int i=0; i<k; i++) {
	    PrintCycle(leaves[i]);
	  }
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int MAX_N = 250005;
int parents[MAX_N];
vector<int> graph[MAX_N];
vector<int> leaves;

int n, m, k;
int ceil_n_k;
int ans = -1;
int length_longest_path = 0;
void GenerateTree(int node, int depth) {

	if (depth >= ceil_n_k) {
	  length_longest_path = depth;
		ans = node;
	}
	bool is_leaf = true;
	for (auto ady : graph[node]) {
		if (!parents[ady]) {
			is_leaf = false;
			parents[ady] = node;
			GenerateTree(ady, depth+1);
		}
	}
	if (is_leaf)
		leaves.push_back(node);
}

void Print(int node, int target) {
     int current = node;
      while (true) {
        printf("%d", current);
        if (current == target){
          printf("\n");
          break;
        } else
          printf(" ");
        current = parents[current];
      }

}

bool IsCorrectOrder(int x, int y) {
    int current = y;
    while(current != -1) {
        if(current == x)
            return true;
        current = parents[current];
    }
    return false;
}

void PrintCycleType2(int x, int y) {
    if (!IsCorrectOrder(x,y))
        swap(x, y);
    int current = y;
    while (current != x) {
        printf(" %d", current);
        current = parents[current];
    }
    printf(" %d\n", x);
}

void PrintCycle (int leaf) {
  int x = -1, y =1;
  int d1 = 0, d2 = 0;
  for (int i=0; i<3; i++) {
    if (graph[leaf][i] == parents[leaf]) {
      continue;
    }
    int target = graph[leaf][i];
    int current = leaf;
    int length = 1;
    while (current != target) {
      current = parents[current];
      length++;
    }
    if (length % 3 != 0){
      printf("%d\n", length);
      Print(leaf, target);
      return;
    } else {
      if (x == -1 )
        x = target, d1 = length;
      else
        y = target, d2 = length;
    }
  }
  int length = abs(d1 - d2) + 2;
  printf("%d\n%d", length, leaf);
  PrintCycleType2(x, y);
}

int main() {

	scanf("%d %d %d", &n, &m, &k);
	ceil_n_k = (n+k-1)/k;

	for (int i=0; i<m; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		graph[u].push_back(v);
		graph[v].push_back(u);
	}

	int root = 1;
	parents[root] = -1;
	GenerateTree(root, 1);

	if (ans != -1) {
		printf("PATH\n%d\n", length_longest_path);

		while(true) {
			printf("%d", ans);
			if(parents[ans] != -1) {
				ans = parents[ans];
				printf(" ");
			} else {
				printf("\n");
				break;
			}
		}
	} else {
	  printf("CYCLES\n");
	  for (int i=0; i<k; i++) {
	    PrintCycle(leaves[i]);
	  }
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int MAX_N = 250005;
int parents[MAX_N];
vector<int> graph[MAX_N];
vector<int> leaves;

int n, m, k;
int ceil_n_k;
int ans = -1;
int length_longest_path = 0;
void GenerateTree(int node, int depth) {

	if (depth >= ceil_n_k) {
	  length_longest_path = depth;
		ans = node;
	}
	bool is_leaf = true;
	for (auto ady : graph[node]) {
		if (!parents[ady]) {
			is_leaf = false;
			parents[ady] = node;
			GenerateTree(ady, depth+1);
		}
	}
	if (is_leaf)
		leaves.push_back(node);
}

void Print(int node, int target) {
     int current = node;
      while (true) {
        printf("%d", current);
        if (current == target){
          printf("\n");
          break;
        } else
          printf(" ");
        current = parents[current];
      }

}

bool IsCorrectOrder(int x, int y) {
    int current = y;
    while(current != -1) {
        if(current == x)
            return true;
        current = parents[current];
    }
    return false;
}

void PrintCycleType2(int x, int y) {
    if (!IsCorrectOrder(x,y))
        swap(x, y);
    int current = y;
    while (current != x) {
        printf(" %d", current);
        current = parents[current];
    }
    printf(" %d", x);
}

void PrintCycle (int leaf) {
  int x = -1, y =1;
  int d1 = 0, d2 = 0;
  for (int i=0; i<3; i++) {
    if (graph[leaf][i] == parents[leaf]) {
      continue;
    }
    int target = graph[leaf][i];
    int current = leaf;
    int length = 1;
    while (current != target) {
      current = parents[current];
      length++;
    }
    if (length % 3 != 0){
      Print(leaf, target);
      return;
    } else {
      if (x == -1 )
        x = target, d1 = length;
      else
        y = target, d2 = length;
    }
  }
  int length = abs(d1 - d2) + 2;
  printf("%d\n%d", length, leaf);
  PrintCycleType2(x, y);
}

int main() {

	scanf("%d %d %d", &n, &m, &k);
	ceil_n_k = (n+k-1)/k;

	for (int i=0; i<m; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		graph[u].push_back(v);
		graph[v].push_back(u);
	}

	int root = 1;
	parents[root] = -1;
	GenerateTree(root, 1);

	if (ans != -1) {
		printf("PATH\n%d\n", length_longest_path);

		while(true) {
			printf("%d", ans);
			if(parents[ans] != -1) {
				ans = parents[ans];
				printf(" ");
			} else {
				printf("\n");
				break;
			}
		}
	} else {
	  printf("CYCLES\n");
	  for (int i=0; i<k; i++) {
	    PrintCycle(leaves[i]);
	  }
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

const int MAX_N = 250005;
int parents[MAX_N];
vector<int> graph[MAX_N];
vector<int> leaves;

int n, m, k;
int ceil_n_k;
int ans = -1;
int length_longest_path = 0;
void GenerateTree(int node, int depth) {

	if (depth >= ceil_n_k) {
	  length_longest_path = depth;
		ans = node;
	}
	bool is_leaf = true;
	for (auto ady : graph[node]) {
		if (!parents[ady]) {
			is_leaf = false;
			parents[ady] = node;
			GenerateTree(ady, depth+1);
		}
	}
	if (is_leaf)
		leaves.push_back(node);
}

void Print(int node, int target) {
     int current = node;
      while (true) {
        printf("%d", current);
        if (current == target){
          printf("\n");
          break;
        } else
          printf(" ");
        current = parents[current];
      }

}

bool IsCorrectOrder(int x, int y) {
    int current = y;
    while(current != -1) {
        if(current == x)
            return true;
        current = parents[current];
    }
    return false;
}

void PrintCycleType2(int x, int y) {
    if (!IsCorrectOrder(x,y))
        swap(x, y);
    int current = y;
    while (current != x) {
        printf(" %d", current);
        current = parents[current];
    }
    printf(" %d", x);
}

void PrintCycle (int leaf) {
  int x = -1, y =1;
  int d1 = 0, d2 = 0;
  for (int i=0; i<3; i++) {
    if (graph[leaf][i] == parents[leaf]) {
      continue;
    }
    int target = graph[leaf][i];
    int current = leaf;
    int length = 1;
    while (current != target) {
      current = parents[current];
      length++;
    }
    if (length % 3 != 0){
      printf("%d\n", length);
      Print(leaf, target);
      return;
    } else {
      if (x == -1 )
        x = target, d1 = length;
      else
        y = target, d2 = length;
    }
  }
  int length = abs(d1 - d2) + 2;
  printf("%d\n%d", length, leaf);
  PrintCycleType2(x, y);
}

int main() {

	scanf("%d %d %d", &n, &m, &k);
	ceil_n_k = (n+k-1)/k;

	for (int i=0; i<m; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		graph[u].push_back(v);
		graph[v].push_back(u);
	}

	int root = 1;
	parents[root] = -1;
	GenerateTree(root, 1);

	if (ans != -1) {
		printf("PATH\n%d\n", length_longest_path);

		while(true) {
			printf("%d", ans);
			if(parents[ans] != -1) {
				ans = parents[ans];
				printf(" ");
			} else {
				printf("\n");
				break;
			}
		}
	} else {
	  printf("CYCLES\n");
	  for (int i=0; i<k; i++) {
	    PrintCycle(leaves[i]);
	  }
	}
	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define F first
#define S second

using namespace std;

const int N = 250005;

int n, m, k;
vector <int> g[N];
int leaf[N], lvl[N], par[N], used[N];
int mx = 0;
void dfs(int v, int p = 0) {
    used[v] = 1;
    lvl[v] = lvl[p] + 1;
    if (lvl[v] > lvl[mx]) {
        mx = v;
    }
    par[v] = p;
    leaf[v] = 1;
    for (int i : g[v]) {
        if (used[i] == 0) {
            dfs(i, v);
            leaf[v] = 0;
        }
    }
}

int main() {
    ios_base :: sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cin >> n >> m >> k;
    for (int i = 1; i <= m; i++) {
        int a, b; cin >> a >> b;
        g[a].pb(b), g[b].pb(a);
    }
    dfs(1);
    if (lvl[mx] >= (n + k - 1) / k) {
        cout << "PATH" << endl;
        for (int i = mx; i > 0; i = par[i]) {
            cout << i << " ";
        }
        cout << endl;
        return 0;
    }
    cout << "CYCLES" << endl;
    for (int i = 1; i <= n; i++) {
        if (leaf[i] == 1) {
            int id = 0;
            if (g[i][id] == par[i]) id++;
            int x = g[i][id++];
            if (g[i][id] == par[i]) id++;
            int y = g[i][id];
            if (lvl[x] > lvl[y]) swap(x, y);
            if ((lvl[i] - lvl[x] + 1) % 3 != 0) {
                cout << lvl[i] - lvl[x] + 1 << endl;
                for (int nd = i; nd != par[x]; nd = par[nd]) {
                    cout << nd << " ";
                }
            } else if ((lvl[i] - lvl[y] + 1) % 3 != 0) {
                cout << lvl[i] - lvl[y] + 1 << endl;
                for (int nd = i; nd != par[y]; nd = par[nd]) {
                    cout << nd << " ";
                }
            } else {
                cout << lvl[y] - lvl[x] + 2 << endl;
                cout << i << " ";
                for (int nd = y; nd != par[x]; nd = par[nd]) {
                    cout << nd << " ";
                }
            }
            cout << endl;
            k--;
            if (k == 0) break;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define F first
#define S second

using namespace std;

const int N = 250005;

int n, m, k;
vector <int> g[N];
int leaf[N], lvl[N], par[N], used[N];
int mx = 0;
void dfs(int v, int p = 0) {
    used[v] = 1;
    lvl[v] = lvl[p] + 1;
    if (lvl[v] > lvl[mx]) {
        mx = v;
    }
    par[v] = p;
    leaf[v] = 1;
    for (int i : g[v]) {
        if (used[i] == 0) {
            dfs(i, v);
            leaf[v] = 0;
        }
    }
}

int main() {
    ios_base :: sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cin >> n >> m >> k;
    for (int i = 1; i <= m; i++) {
        int a, b; cin >> a >> b;
        g[a].pb(b), g[b].pb(a);
    }
    dfs(1);
    if (lvl[mx] >= (n + k - 1) / k) {
        cout << "PATH" << endl;
        cout << lvl[mx] << endl;
        for (int i = mx; i > 0; i = par[i]) {
            cout << i << " ";
        }
        cout << endl;
        return 0;
    }
    cout << "CYCLES" << endl;
    for (int i = 1; i <= n; i++) {
        if (leaf[i] == 1) {
            int id = 0;
            if (g[i][id] == par[i]) id++;
            int x = g[i][id++];
            if (g[i][id] == par[i]) id++;
            int y = g[i][id];
            if (lvl[x] > lvl[y]) swap(x, y);
            if ((lvl[i] - lvl[x] + 1) % 3 != 0) {
                cout << lvl[i] - lvl[x] + 1 << endl;
                for (int nd = i; nd != par[x]; nd = par[nd]) {
                    cout << nd << " ";
                }
            } else if ((lvl[i] - lvl[y] + 1) % 3 != 0) {
                cout << lvl[i] - lvl[y] + 1 << endl;
                for (int nd = i; nd != par[y]; nd = par[nd]) {
                    cout << nd << " ";
                }
            } else {
                cout << lvl[y] - lvl[x] + 2 << endl;
                cout << i << " ";
                for (int nd = y; nd != par[x]; nd = par[nd]) {
                    cout << nd << " ";
                }
            }
            cout << endl;
            k--;
            if (k == 0) break;
        }
    }
    return 0;
}


#include <map>
#include <set>
#include <string>
#include <vector>
#include <cstring>
#include <fstream>
#include <iostream>
#include <algorithm>

using namespace std ;

//ifstream fin (".in");
//ofstream fout (".out");

#define mp make_pair
#define pb push_back
#define ppb pop_back

typedef long long ll ;
typedef pair<ll , ll> PII;

const int N=25*(1e4);
ll h[2][N] , n , m , par[2][N] , depth , endvert[2] , k;
vector <int> adj[N] , leaves , backedge[N];
bool mark[2][N] ;

void DFS (int v , int t , int parent)
{
	mark[t][v] = 1 ;
	bool leaf = 1 ;

	if(h[t][endvert[t]] < h[t][v])
		endvert[t] = v ;

	for(int i=0 ; i<adj[v].size() ; i++)
	{
		int u = adj[v][i];

		if(mark[t][u])
		{
			if(u != parent && !t)
				backedge[v].pb(u);

			continue ;
		}

		h[t][u] = h[t][v]+1 ;
		par[t][u] = v ;
		leaf = 0;

		DFS(u , t , v);
	}

	if(leaf && !t)
		leaves.pb(v);
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> n >> m >> k ;

	for(int i=0 ; i<m ; i++)
	{
		int x , y ;
		cin >> x >> y ;

		adj[x].pb(y);
		adj[y].pb(x);
	}

	DFS(1 , 0 , 0);
	DFS(endvert[0] , 1 , 0);

	if(h[1][endvert[1]] >= (n+k-1)/k)
	{
		cout <<"PATH" << endl << h[1][endvert[1]]+1 << endl;

		int v = endvert[1];

		while(v > 0)
		{
			cout << v << " ";
			v = par[1][v];
		}

		return 0 ;
	}

	cout << "CYCLES" << endl;

	for(int i=0 ; i<k ; i++)
	{
		int v = leaves[i];
		int u = backedge[v][0] , w =  backedge[v][1];
		if(h[0][u] < h[0][w]) 	swap(u , w);

		if((h[0][v]-h[0][u]+1)%3==0 && (h[0][v]-h[0][w]+1)%3==0)
		{
			cout << h[0][u]-h[0][w]+1 << endl << v << " ";

			int crntv = u ;

			while(crntv != par[0][w])
			{
				cout << crntv << " ";
				crntv = par[0][crntv];
			}

			cout << endl;
			continue;
		}

		if((h[0][v]-h[0][u]+1)%3!=0)
		{
			cout << h[0][v]-h[0][u]+1 << endl ;
			int crntv = v ;

			while(crntv != par[0][u])
			{
				cout << crntv << " ";
				crntv = par[0][crntv];
			}

			cout << endl;
			continue;
		}

		if((h[0][v]-h[0][w]+1)%3!=0)
		{
			cout << h[0][v]-h[0][w]+1 << endl ;
			int crntv = v ;

			while(crntv != par[0][w])
			{
				cout << crntv << " ";
				crntv = par[0][crntv];
			}

			cout << endl;
			continue;
		}
	}
}


#include <map>
#include <set>
#include <string>
#include <vector>
#include <cstring>
#include <fstream>
#include <iostream>
#include <algorithm>

using namespace std ;

//ifstream fin (".in");
//ofstream fout (".out");

#define mp make_pair
#define pb push_back
#define ppb pop_back

typedef long long ll ;
typedef pair<ll , ll> PII;

const int N=25*(1e4);
ll h[2][N] , n , m , par[2][N] , depth , endvert[2] , k;
vector <int> adj[N] , leaves , backedge[N];
bool mark[2][N] ;

void DFS (int v , int t , int parent)
{
	mark[t][v] = 1 ;
	bool leaf = 1 ;

	if(h[t][endvert[t]] < h[t][v])
		endvert[t] = v ;

	for(int i=0 ; i<adj[v].size() ; i++)
	{
		int u = adj[v][i];

		if(mark[t][u])
		{
			if(u != parent && !t)
				backedge[v].pb(u);

			continue ;
		}

		h[t][u] = h[t][v]+1 ;
		par[t][u] = v ;
		leaf = 0;

		DFS(u , t , v);
	}

	if(leaf && !t)
		leaves.pb(v);
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> n >> m >> k ;

	for(int i=0 ; i<m ; i++)
	{
		int x , y ;
		cin >> x >> y ;

		adj[x].pb(y);
		adj[y].pb(x);
	}

	DFS(1 , 0 , 0);
	DFS(endvert[0] , 1 , 0);

	if(h[1][endvert[1]] >= (n+k-1)/k)
	{
		cout <<"PATH" << endl << h[1][endvert[1]]+1 << endl;

		int v = endvert[1];

		while(v > 0)
		{
			cout << v << " ";
			v = par[1][v];
		}

		return 0 ;
	}

	cout << "CYCLES" << endl;

	for(int i=0 ; i<k ; i++)
	{
		int v = leaves[i];
		int u = backedge[v][0] , w =  backedge[v][1];
		if(h[0][u] < h[0][w]) 	swap(u , w);

		if((h[0][v]-h[0][u]+1)%3==0 && (h[0][v]-h[0][w]+1)%3==0)
		{
			cout << h[0][u]-h[0][w]+2 << endl << v << " ";

			int crntv = u ;

			while(crntv != par[0][w])
			{
				cout << crntv << " ";
				crntv = par[0][crntv];
			}

			cout << endl;
			continue;
		}

		if((h[0][v]-h[0][u]+1)%3!=0)
		{
			cout << h[0][v]-h[0][u]+1 << endl ;
			int crntv = v ;

			while(crntv != par[0][u])
			{
				cout << crntv << " ";
				crntv = par[0][crntv];
			}

			cout << endl;
			continue;
		}

		if((h[0][v]-h[0][w]+1)%3!=0)
		{
			cout << h[0][v]-h[0][w]+1 << endl ;
			int crntv = v ;

			while(crntv != par[0][w])
			{
				cout << crntv << " ";
				crntv = par[0][crntv];
			}

			cout << endl;
			continue;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;

const int NMAX = 250010;
int l_nec;
int tata[NMAX];
vector <int> adia[NMAX];
int h[NMAX];
vector <vector <int>> ciclii;
vector <int> lant;

void dfs(int nod, int t)
{
	if (!lant.empty())
		return;
	h[nod] = 1 + h[t];
	tata[nod] = t;
	if (h[nod] >= l_nec) {
		for (int i = nod; i; i = tata[i])
			lant.push_back(i);
		return;
	}

	bool is_frunza = 1;

	for (auto i : adia[nod])
		if (!h[i])
			is_frunza = 0, dfs(i, nod);

	if (is_frunza) {
		/// inchid un ciclu
		int nod1 = 0, nod2 = 0;
		for (auto i : adia[nod])
			if (i != t)
				nod2 = nod1, nod1 = i;

		if ((h[nod] - h[nod2] + 1) % 3)
			swap(nod1, nod2);
		if ((h[nod] - h[nod1] + 1) % 3) {
			/// iau lantul de la nod1 la nod
			ciclii.push_back(vector <int>());
			for (int i = nod; i != tata[nod1]; i = tata[i])
				ciclii.back().push_back(i);
		}
		else {
			/// iau de la nod1 la nod2 cu nod
			if (h[nod1] < h[nod2])
				swap(nod1, nod2);
			ciclii.push_back(vector <int>());
			for (int i = nod1; i != tata[nod2]; i = tata[i])
				ciclii.back().push_back(i);
			ciclii.back().push_back(nod);
		}
	}
}

int main()
{
	int n, m, k, a, b;
	ios_base::sync_with_stdio(0);
	cin >> n >> m >> k;

	l_nec = (n + k - 1) / k;

	while (m--) {
		cin >> a >> b;
		adia[a].push_back(b);
		adia[b].push_back(a);
	}

	dfs(1, 0);

	if (!lant.empty()) {
		cout << "PATH\n" << lant.size() << '\n';
		for (auto i : lant)
			cout << i << ' ';
		return 0;
	}

	assert(ciclii.size() >= k);

	cout << "CYCLES\n";

	for (int i = 0; i < k; i++) {
		cout << ciclii[i].size() << '\n';
		for (auto j : ciclii[i])
			cout << j << ' ';
		cout << '\n';
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N=5e5 +10;
int n, m, k;
bool visit[N], leaf[N];
vector<int> e[N];
int par[N], depth[N];
void dfs(int u)
{
    visit[u]=true;
    bool ok=true;
    for(auto v: e[u])
    {
        if (visit[v]) continue;
        ok=false;
        depth[v]=depth[u]+1;
        par[v]=u;
        dfs(v);
    }
    leaf[u]=ok;
}
void find_path(int u)
{
    cout<<"PATH\n";
    cout<<depth[u]+1<<'\n';
    while (u!=0)
    {
        cout<<u<<' ';
        u=par[u];
    }
    exit(0);
}
void print(int u, int v, vector<int> &ss)
{
    for(; u!=v; u=par[u]) ss.push_back(u);
    ss.push_back(v);
    cout<<ss.size()<<'\n';
    for(auto u: ss) cout<<u<<' ';
    cout<<'\n';
}
void find_cycles()
{
    cout<<"CYCLES\n";
    int _count=0;
    for(int i=1; i<=n; ++i) if (leaf[i])
    {
        if(++_count>k) exit(0);
        vector<int> cycle;
        if (e[i][0]==par[i]) swap(e[i][0], e[i].back());
        if (e[i][1]==par[i]) swap(e[i][1], e[i].back());
        int u=e[i][0], v=e[i][1];
        if(depth[u]<depth[v]) swap(u, v);
        cycle.push_back(i);
        if( (depth[i]-depth[u]+1) % 3 )
        {
            print(i, u, cycle);
            continue;
        }
        if( (depth[i]-depth[v]+1) % 3 )
        {
            print(i, v, cycle);
            continue;
        }
        if( (depth[u]-depth[v]+2) % 3 )
        {
            print(u, v, cycle);
        }

    }
}
int main()
{
#ifndef ONLINE_JUDGE
    freopen("E.inp", "r", stdin);
    freopen("E.out", "w", stdout);
#endif // ONLINE_JUDGE
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n>>m>>k;
    for(int i=1; i<=m; ++i)
    {
        int u, v; cin>>u>>v;
        e[u].push_back(v);
        e[v].push_back(u);
    }
    dfs(1);
    for(int i=1; i<=n; ++i) if (depth[i]>=n/k) find_path(i);
    find_cycles();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N=5e5 +10;
int n, m, k;
bool visit[N], leaf[N];
vector<int> e[N];
int par[N], depth[N];
void dfs(int u)
{
    visit[u]=true;
    bool ok=true;
    for(auto v: e[u])
    {
        if (visit[v]) continue;
        ok=false;
        depth[v]=depth[u]+1;
        par[v]=u;
        dfs(v);
    }
    leaf[u]=ok;
}
void find_path(int u)
{
    cout<<"PATH\n";
    cout<<depth[u]+1<<'\n';
    while (u!=0)
    {
        cout<<u<<' ';
        u=par[u];
    }
    exit(0);
}
void print(int u, int v, vector<int> &ss)
{
    for(; u!=v; u=par[u]) ss.push_back(u);
    ss.push_back(v);
    cout<<ss.size()<<'\n';
    for(auto u: ss) cout<<u<<' ';
    cout<<'\n';
}
void find_cycles()
{
    cout<<"CYCLES\n";
    int _count=0;
    for(int i=1; i<=n; ++i) if (leaf[i])
    {
        if(++_count>k) exit(0);
        vector<int> cycle;
        if (e[i][0]==par[i]) swap(e[i][0], e[i].back());
        if (e[i][1]==par[i]) swap(e[i][1], e[i].back());
        int u=e[i][0], v=e[i][1];
        if(depth[u]<depth[v]) swap(u, v);
        cycle.push_back(i);
        if( (depth[i]-depth[u]+1) % 3 )
        {
            print(par[i], u, cycle);
            continue;
        }
        if( (depth[i]-depth[v]+1) % 3 )
        {
            print(par[i], v, cycle);
            continue;
        }
        if( (depth[u]-depth[v]+2) % 3 )
        {
            print(u, v, cycle);
        }

    }
}
int main()
{
#ifndef ONLINE_JUDGE
    freopen("E.inp", "r", stdin);
    freopen("E.out", "w", stdout);
#endif // ONLINE_JUDGE
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n>>m>>k;
    for(int i=1; i<=m; ++i)
    {
        int u, v; cin>>u>>v;
        e[u].push_back(v);
        e[v].push_back(u);
    }
    dfs(1);
    for(int i=1; i<=n; ++i) if (depth[i]>=n/k) find_path(i);
    find_cycles();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e6 + 5;
int n,m,k;
vector<int> g[maxn];
int depth[maxn];
int par[maxn];
int path[maxn];

void dfs(int at, int p, int d) {
  depth[at] = d;
  par[at] = p;
  path[d] = at;
  if ((d+1)*k >= n) {
    cout<<"PATH"<<endl;
    cout<<d+1<<endl;
    for (int j=0; j<=d; j++) cout<<path[j]<<" ";
    cout<<endl;
    exit(0);
  }
  for (int to: g[at]) {
    if (depth[to] == -1) {
      dfs(to, at, d+1);
    }
  }
}

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
  memset(depth,-1,sizeof depth);
  cin>>n>>m>>k;
  for (int i=0; i<m; i++) {
    int u,v;cin>>u>>v;
    g[u].push_back(v);
    g[v].push_back(u);
  }

  dfs(1,0,0);

  cout<<"CYCLES"<<endl;
  set<int> leaves;
  for (int i=1; i<=n; i++) {
    leaves.insert(i);
  }
  for (int i=1; i<=n; i++) {
    if (leaves.count(par[i])) leaves.erase(par[i]);
  }

  assert(int(leaves.size()) >= k);
  vector<int> v;
  for (int x: leaves) {
    if (int(v.size()) == k) break;
    v.push_back(x);
  }

  for (int x: v) {
    assert(int(g[x].size())>=3);
    bool done = false;
    // all neighbors of dfs span tree of leaves are backedges.
    // by pidgeonhole, one these paths lengths won't be 0mod3
    for (int i=0; i<3 && !done; i++) {
      for (int j=0; j<3 && !done; j++) {
	if (i == j) continue;
	int y = g[x][i]; int w = g[x][j];
	if (depth[y] <= depth[w]) continue;
	int len = 1 + (depth[y] - depth[w]) + 1;

	if (len%3!=0) {
	  done = true;
	  cout<<len<<"\n";
	  cout<<x<<" "; //representative
	  for (int u=y; u!=w; u=par[u]) cout<<u<<" ";
	  cout<<w<<"\n";
	  break;
	}
      }
    }
  }

  return 0;
}
// don't forget to read in the input :^)


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e6 + 5;
int n,m,k;
vector<int> g[maxn];
int depth[maxn];
int par[maxn];
int path[maxn];

void dfs(int at, int p, int d) {
  depth[at] = d;
  par[at] = p;
  path[d] = at;
  if ((d+1)*k >= n) {
    cout<<"PATH"<<endl;
    cout<<d+1<<endl;
    for (int j=0; j<=d; j++) cout<<path[j]<<" ";
    cout<<endl;
    exit(0);
  }
  for (int to: g[at]) {
    if (depth[to] == -1) {
      dfs(to, at, d+1);
    }
  }
}

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
  memset(depth,-1,sizeof depth);
  cin>>n>>m>>k;
  for (int i=0; i<m; i++) {
    int u,v;cin>>u>>v;
    g[u].push_back(v);
    g[v].push_back(u);
  }

  dfs(1,0,0);

  cout<<"CYCLES"<<endl;
  set<int> leaves;
  for (int i=1; i<=n; i++) {
    leaves.insert(i);
  }
  for (int i=1; i<=n; i++) {
    if (leaves.count(par[i])) leaves.erase(par[i]);
  }

  assert(int(leaves.size()) >= k);
  vector<int> v;
  for (int x: leaves) {
    if (int(v.size()) == k) break;
    v.push_back(x);
  }

  for (int x: v) {
    assert(int(g[x].size())>=3);
    bool done = false;
    for (int i=0; i<3 && !done; i++) {
      for (int j=0; j<3 && !done; j++) {
	if (i == j) continue;
	int y = g[x][i]; int w = g[x][j];
	if (depth[y] <= depth[w]) continue;
	int len = 1 + (depth[y] - depth[w]) + 1;

	if (len%3!=0) {
	  done = true;
	  cout<<len<<"\n";
	  cout<<x<<" "; //representative
	  for (int u=y; u!=w; u=par[u]) cout<<u<<" ";
	  cout<<w<<"\n";
	  break;
	}
      }
    }
  }

  return 0;
}
// don't forget to read in the input :^)


#include <bits/stdc++.h>

using namespace std;

const int maxn = 5e5+100;

vector<int> g[maxn],leave;
int dep[maxn];
bool vis[maxn];
int n,m,k;

void pt(int s,int e){
	if(s==e){
		cout<<s<<" ";
	 	return;
	}
	for(auto i:g[s]){
		if(dep[i]==dep[s]-1){
			cout<<s<<" ";
			pt(i,e);
			break;
		}
	}
}

bool dfs(int u,int d){
	dep[u]=d;
	if(d>n/k){
		cout<<"PATH"<<endl;
		cout<<d<<endl;
		pt(u,1);
		cout<<endl;
		return true;
	}
	bool flag=1;
	for(auto i:g[u]){
		if(dep[i]) continue;
		flag=0;
		if(dfs(i,d+1)){
			return true;
		}
	}
	if(flag){
		leave.push_back(u);
	}
	return false;
}

int main(){

	ios::sync_with_stdio(false);
	cin.tie(0);
	int a,b;
	cin>>n>>m>>k;
	for(int i=0;i<m;++i){
		cin>>a>>b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	if(!dfs(1,1)){
		cout<<"CYCLES"<<endl;
		for(auto le:leave){
			int x=0,y=0;
			for(auto i:g[le]){
				if(dep[i]!=dep[le]-1){
					if(!x){
						x=i;
					}else{
						y=i;
						break;
					}
				}
			}
			if((dep[le]-dep[x]+1)%3){
				cout<<dep[le]-dep[x]+1<<endl;
				pt(le,x);
				cout<<endl;
			}else if((dep[le]-dep[y]+1)%3){
				cout<<dep[le]-dep[y]+1<<endl;
				pt(le,y);
				cout<<endl;
			}else{
				if(dep[x]>dep[y]) swap(x,y);
				cout<<dep[y]-dep[x]+2<<endl;
				cout<<le<<" ";
				pt(y,x);
				cout<<endl;
			}
			--k;
			if(!k){
				break;
			}
		}
	}
	return 0;
}