codeparrot/codecomplex huggingface dataset:
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant
import java.io.*;
import java.util.*;


public class A {
    public static void main(String[] args) throws Exception {
        new A().solve();
    }
    void solve() throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        if (n == 0) {
            System.out.println("0 0 0");
            return;
        }
        int p2 = 0;
        int p1 = 1;
        while (true) {
            int now = p2 + p1;
            if (n == now) {
                System.out.println("0 " + p1 + " " + p2);
                return;
            } else {
                p2 = p1;
                p1 = now;
            }
        }
    }
}
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class HexTheorem {
    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
        int x = Integer.parseInt(read.readLine());
        System.out.println("0 0 "+x);
    }
}
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant
import java.io.*;
import java.text.*;
import java.math.*;
import java.util.*;

public class Hexadec implements Runnable {

    final static String taskname = "filename";

    public void solve() throws Exception {
    //	int n = iread();	
    	int n = Integer.parseInt(in.readLine());
    	
    	
    	
    	out.write(n + " "+0+" "+0);
    //    out.write(ans_path + "\n");
    }

    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new BufferedWriter(new OutputStreamWriter(System.out));
//             in = new BufferedReader(new FileReader(taskname + ".in"));
//             out = new BufferedWriter(new FileWriter(taskname + ".out"));
            solve();
            out.flush();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    public int iread() throws Exception {
        return Integer.parseInt(readword());
    }

    public double dread() throws Exception {
        return Double.parseDouble(readword());
    }

    public long lread() throws Exception {
        return Long.parseLong(readword());
    }

    BufferedReader in;

    BufferedWriter out;

    public String readword() throws IOException {
        StringBuilder b = new StringBuilder();
        int c;
        c = in.read();
        while (c >= 0 && c <= ' ')
            c = in.read();
        if (c < 0)
            return "";
        while (c > ' ') {
            b.append((char) c);
            c = in.read();
        }
        return b.toString();
    }

    public static void main(String[] args) {
        // Locale.setDefault(Locale.US);
        new Thread(new Hexadec()).start();
    }
}
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant
import java.util.Scanner;
public class Fibonacci {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long num =0;
		num = input.nextLong();
		while (num<0 || num>Math.pow(10,9))
		{
			System.out.println("Invalid");
			num = input.nextLong();
		}
		System.out.println("0 0 "+num);
	}
}
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.StringTokenizer;


public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(in, out);
        out.close();
    }
}

class TaskA {
    int n;
    int m;
    String answer = "I'm too stupid to solve this problem";
    public void solve(InputReader in, PrintWriter out) {
        n = in.nextInt();
        out.println("0 0 " + n);        
    }
    
        
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

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

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

    public int nextInt() {
        return Integer.parseInt(next());
    }
}
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant
import java.util.Scanner;

public class N1_CF_199A {
    public static void main(String[] args) {
    int n = new Scanner(System.in).nextInt();
    if( n == 0)
    {
        System.out.println(0);
        System.out.println(0);
        System.out.println(0);
        return;
    }
    int i = 0 , j = 1;
    while(true)
    {
        int t = i + j;
        if( t == n)
        break;
        i = j;
        j = t;
    }
    System.out.println(i);
    System.out.println(j);
    System.out.println(0);
    }
}
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant

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

public class a extends Thread {

	BufferedReader bf;
	PrintWriter out;
	FastScanner in;

	void solve() throws Exception {
		long n = in.nextLong();
		long f[] = new long[2001];
		int i = 2;
		f[0] = 0;
		f[1] = 1;
		while (true){
			f[i] = f[i-1] + f[i-2];
			if (f[i] < n) i++;
			else break;
		}
		if (n == 1) out.println("1 0 0");
		else if (n == 0) out.println("0 0 0");
		else 
		if (i - 3 >= 0) out.println(f[i-2] +" " + f[i-2] + " " +f[i-3]);
		else out.println("I'm too stupid to solve this problem");
	}
	
	public void run() {
		try {
			bf = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			in = new FastScanner(bf);
			solve();
			out.flush();
		} catch (Exception ex) {
			ex.printStackTrace();
		} finally {
			out.close();
		}
	}

	public static void main(String args[]) {
		new a().start();
	}

	class FastScanner {
		BufferedReader bf;
		StringTokenizer st;

		public FastScanner(BufferedReader bf) {
			this.bf = bf;
		}

		public String nextToken() throws Exception {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(bf.readLine());
			}
			return st.nextToken();
		}

		public int nextInt() throws Exception {
			return Integer.parseInt(nextToken());
		}

		public long nextLong() throws Exception {
			return Long.parseLong(nextToken());
		}

		public Double nextDouble() throws Exception {
			return Double.parseDouble(nextToken());
		}

		public BigInteger nextBigInteger() throws Exception {
			return new BigInteger(nextToken());
		}
	}
}
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant
import java.util.*;

public class A {

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

        long n = sc.nextLong();
        
        List<Long> fi = new ArrayList<Long>(); 
        
        fi.add((long) 0);
        fi.add((long) 1);
        
        while (fi.get(fi.size()-1)<n) {
            fi.add(fi.get(fi.size()-1)+fi.get(fi.size()-2));
        }
        
        int last = fi.size()-1;

        long z = last-1>=0 ? fi.get(last-1) : 0;
        long y = last-3>=0 ? fi.get(last-3) : 0;
        long x = last-4>=0 ? fi.get(last-4) : 0;

        if (x+y+z<n)
            x=1;
        
        System.out.println(x+" "+y+" "+z);
    }
    
}
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import java.io.*;
import java.math.*;
import java.util.*;

@SuppressWarnings("unused")
public class A {
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		System.out.println("0 0 " + n);
	}
}
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant
import java.io.IOException;
import java.util.Scanner;


public class A199 {
	static int n[][] = new int[][] { { -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 } };

	public static void main(String[] args) throws IOException {
		new A199().solve();
	}

	public void solve() throws IOException {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
//		int f1 = 0;
//		int f2 = 1;
//		
//		while(true){
//			int t = f1 + f2;
//			if(t == N){
//				//guaranteed that n is a Fibonacci number
//				break;
//			}
//			f1 = f2;
//			f2 = t;
//		}
		System.out.println("0 0 " + N );
	}
}
// Problem: 199_A. Hexadecimal's theorem
// Time complexity: constant
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: vaibhav mittal
 * Date: 23/6/12
 * Time: 1:15 AM
 * To change this template use File | Settings | File Templates.
 */
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        long n = in.nextLong();
        out.println(0 + " " + 0 + " " + n);

        in.close();
        out.close();
    }
}
// Problem: 387_D. George and Interesting Graph
// Time complexity: cubic
import java.io.*;
import java.util.*;

public class CF387D {
	static class A {
		ArrayList<Integer> list = new ArrayList<>();
		int u, v, d;
	}
	static final int INF = Integer.MAX_VALUE;
	static boolean bfs(A[] aa, int n) {
		ArrayDeque<Integer> q = new ArrayDeque<>();
		for (int u = 1; u <= n; u++)
			if (aa[u].v > 0)
				aa[u].d = INF;
			else {
				aa[u].d = 0;
				q.addLast(u);
			}
		aa[0].d = INF;
		while (!q.isEmpty()) {
			int u = q.removeFirst();
			for (int v : aa[u].list) {
				int w = aa[v].u;
				if (aa[w].d == INF) {
					aa[w].d = aa[u].d + 1;
					if (w == 0)
						return true;
					q.addLast(w);
				}
			}
		}
		return false;
	}
	static boolean dfs(A[] aa, int n, int u) {
		if (u == 0)
			return true;
		for (int v : aa[u].list) {
			int w = aa[v].u;
			if (aa[w].d == aa[u].d + 1 && dfs(aa, n, w)) {
				aa[u].v = v;
				aa[v].u = u;
				return true;
			}
		}
		aa[u].d = INF;
		return false;
	}
	static int matchings(A[] aa, int n) {
		int cnt = 0;
		while (bfs(aa, n))
			for (int u = 1; u <= n; u++)
				if (aa[u].v == 0 && dfs(aa, n, u))
					cnt++;
		return cnt;
	}
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		int[] eu = new int[m];
		int[] ev = new int[m];
		for (int j = 0; j < m; j++) {
			st = new StringTokenizer(br.readLine());
			eu[j] = Integer.parseInt(st.nextToken());
			ev[j] = Integer.parseInt(st.nextToken());
		}
		A[] aa = new A[n + 1];
		int min = m + n * 3;
		for (int ctr = 1; ctr <= n; ctr++) {
			boolean loop = false;
			boolean[] ci = new boolean[n + 1];
			boolean[] co = new boolean[n + 1];
			for (int i = 0; i <= n; i++)
				aa[i] = new A();
			int m_ = 0;
			for (int j = 0; j < m; j++) {
				int u = eu[j];
				int v = ev[j];
				if (u == ctr && v == ctr)
					loop = true;
				else if (u == ctr && v != ctr)
					ci[v] = true;
				else if (u != ctr && v == ctr)
					co[u] = true;
				else {
					aa[u].list.add(v);
					m_++;
				}
			}
			int cnt = loop ? 0 : 1;
			for (int i = 1; i <= n; i++)
				if (i != ctr) {
					if (!ci[i])
						cnt++;
					if (!co[i])
						cnt++;
				}
			int m2 = matchings(aa, n);
			cnt += (m_ - m2) + (n - 1 - m2);
			if (min > cnt)
				min = cnt;
		}
		System.out.println(min);
	}
}
// Problem: 387_D. George and Interesting Graph
// Time complexity: cubic
import java.io.*;
import java.util.*;

public class CF387D {
	static class A {
		ArrayList<Integer> list = new ArrayList<>();
		int u, v, d;
	}
	static int INF = Integer.MAX_VALUE;
	static boolean bfs(A[] aa, int n) {
		LinkedList<Integer> q = new LinkedList<>();
		for (int u = 1; u <= n; u++)
			if (aa[u].v > 0)
				aa[u].d = INF;
			else {
				aa[u].d = 0;
				q.addLast(u);
			}
		aa[0].d = INF;
		while (!q.isEmpty()) {
			int u = q.removeFirst();
			for (int v : aa[u].list) {
				int w = aa[v].u;
				if (aa[w].d == INF) {
					aa[w].d = aa[u].d + 1;
					if (w == 0)
						return true;
					q.addLast(w);
				}
			}
		}
		return false;
	}
	static boolean dfs(A[] aa, int n, int u) {
		if (u == 0)
			return true;
		for (int v : aa[u].list) {
			int w = aa[v].u;
			if (aa[w].d == aa[u].d + 1 && dfs(aa, n, w)) {
				aa[u].v = v;
				aa[v].u = u;
				return true;
			}
		}
		aa[u].d = INF;
		return false;
	}
	static int matchings(A[] aa, int n) {
		int cnt = 0;
		while (bfs(aa, n))
			for (int u = 1; u <= n; u++)
				if (aa[u].v == 0 && dfs(aa, n, u))
					cnt++;
		return cnt;
	}
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		int[] eu = new int[m];
		int[] ev = new int[m];
		for (int j = 0; j < m; j++) {
			st = new StringTokenizer(br.readLine());
			eu[j] = Integer.parseInt(st.nextToken());
			ev[j] = Integer.parseInt(st.nextToken());
		}
		A[] aa = new A[n + 1];
		int min = m + n * 3;
		for (int ctr = 1; ctr <= n; ctr++) {
			boolean loop = false;
			boolean[] ci = new boolean[n + 1];
			boolean[] co = new boolean[n + 1];
			for (int i = 0; i <= n; i++)
				aa[i] = new A();
			int m_ = 0;
			for (int j = 0; j < m; j++) {
				int u = eu[j];
				int v = ev[j];
				if (u == ctr && v == ctr)
					loop = true;
				else if (u == ctr && v != ctr)
					ci[v] = true;
				else if (u != ctr && v == ctr)
					co[u] = true;
				else {
					aa[u].list.add(v);
					m_++;
				}
			}
			int cnt = loop ? 0 : 1;
			for (int i = 1; i <= n; i++)
				if (i != ctr) {
					if (!ci[i])
						cnt++;
					if (!co[i])
						cnt++;
				}
			int m2 = matchings(aa, n);
			cnt += (m_ - m2) + (n - 1 - m2);
			if (min > cnt)
				min = cnt;
		}
		System.out.println(min);
	}
}
// Problem: 387_D. George and Interesting Graph
// Time complexity: cubic
import java.util.ArrayList;
import java.util.Scanner;



public class Main {
    
    static ArrayList<Edge> graph;
    static ArrayList<ArrayList<Integer>> graphForKuhn;
    static int n, m, u = 0;
    static int mt[];
    static int used[];

    public static void main(String[] args) {
        formGraph();
        System.out.println(getAnswer()); 
    }
    
    static boolean kuhn(int start) {
        if (used[start] == u)
            return false;
        used[start] = u;
        for (int i=0; i< graphForKuhn.get(start).size(); i++) {
            int to = graphForKuhn.get(start).get(i);
            if (mt[to] == -1 || kuhn(mt[to])) {
                mt[to] = start;
                return true;
            }
        }
        return false;
    }

    private static int getAnswer() {
        int currentAnswer = Integer.MAX_VALUE;
        for (int cur= 0; cur<n; cur++) {
            int adj = 0, otheradj = 0, answer = 0;
            for (int j=0; j<n; j++) {
                graphForKuhn.get(j).clear();
                mt[j] = -1;
            }
            for (int j=0; j<m; j++) {
                if (graph.get(j).from == cur || graph.get(j).to == cur)
                    adj++;
                else {
                    graphForKuhn.get(graph.get(j).from).add(graph.get(j).to);
                    otheradj++;
                }
            }
            for (int j=0; j<n; j++) {
                u++;
                kuhn(j);
            }
            int tsz = 0;
            for (int j=0; j<n; j++) {
                if (mt[j] != -1)
                    tsz++;
            }
            answer = 2*(n-1)+1-adj+otheradj-2*tsz+(n-1);
            currentAnswer = Math.min(answer, currentAnswer);
        }
        return currentAnswer;
    }

    private static void formGraph() {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        graph = new ArrayList<Edge>(m);
        for (int i=0; i<m; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            graph.add(new Edge(x-1, y-1));
        }
        graphForKuhn = new ArrayList<ArrayList<Integer>>(n);
        for (int i=0; i<n; i++) graphForKuhn.add(new ArrayList<Integer>(n));
        mt = new int[n];
        used = new int[n];
        in.close();
    }

    
}

class Edge {
    int from;
    int to;
    
    public Edge(int from, int to) {
        this.from = from;
        this.to = to;
    }
}
// Problem: 387_D. George and Interesting Graph
// Time complexity: cubic
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class GeorgeInterestingGraph {
    
    int N = 505;
    int INF = (int) 1e9;
    
    List<Integer>[] G = new List[N];
    int[] match = new int[N];
    int[] used = new int[N];
    int cur = 0;
    
    {
        for (int i = 0; i < N; i++) G[i] = new ArrayList<>(1);
    }
    
    void solve() {
        int n = in.nextInt(), m = in.nextInt();
        int[] fr = new int[m], to = new int[m];
        for (int i = 0; i < m; i++) {
            fr[i] = in.nextInt() - 1;
            to[i] = in.nextInt() - 1;
        }
        
        int ans = INF;
        for (int i = 0; i < n; i++) {
            int cnt = 0;
            for (int j = 0; j < n; j++) {
                G[j].clear();
                match[j] = -1;
            }
            for (int j = 0; j < m; j++) {
                if (fr[j] == i || to[j] == i) {
                    cnt++;
                } else {
                    G[fr[j]].add(to[j]);
                }
            }
            
            int other = m - cnt;
            
            int max = 0;
            for (int j = 0; j < n; j++) {
                cur++;
                if (augment(j)) max++;
            }
            
            ans = Math.min(ans, 2 * (n - 1) + 1 - cnt + other - max + (n - 1) - max);
        }
        out.println(ans);
    }
    
    boolean augment(int u) {
        if (used[u] == cur) return false;
        used[u] = cur;
        for (int v : G[u]) {
            if (match[v] < 0 || augment(match[v])) {
                match[v] = u;
                return true;
            }
        }
        return false;
    }
    
    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new GeorgeInterestingGraph().solve();
        out.close();
    }
    
    static FastScanner in;
    static PrintWriter out;
    
    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;
        
        public FastScanner(BufferedReader in) {
            this.in = in;
        }
        
        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        public int nextInt() {
            return Integer.parseInt(nextToken());
        }
        
        public long nextLong() {
            return Long.parseLong(nextToken());
        }
        
        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}
// Problem: 387_D. George and Interesting Graph
// Time complexity: cubic
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class GeorgeInterestingGraph {
    
    int N = 505;
    int INF = (int) 1e9;
    
    List<Integer>[] G = new List[N];
    int[] match = new int[N];
    int[] used = new int[N];
    int cur = 0;
    
    {
        for (int i = 0; i < N; i++) G[i] = new ArrayList<>(1);
    }
    
    void solve() {
        int n = in.nextInt(), m = in.nextInt();
        int[] fr = new int[m], to = new int[m];
        for (int i = 0; i < m; i++) {
            fr[i] = in.nextInt() - 1;
            to[i] = in.nextInt() - 1;
        }
        
        int ans = INF;
        for (int i = 0; i < n; i++) {
            int cnt = 0;
            for (int j = 0; j < n; j++) {
                G[j].clear();
                match[j] = -1;
            }
            for (int j = 0; j < m; j++) {
                if (fr[j] == i || to[j] == i) {
                    cnt++;
                } else {
                    G[fr[j]].add(to[j]);
                }
            }
            
            int other = m - cnt;
            
            int max = 0;
            for (int j = 0; j < n; j++) {
                cur++;
                augment(j);
            }
            for (int j = 0; j < n; j++) if (match[j] >= 0) max++;
            
            ans = Math.min(ans, 2 * (n - 1) + 1 - cnt + other - max + (n - 1) - max);
        }
        out.println(ans);
    }
    
    boolean augment(int u) {
        if (used[u] == cur) return false;
        used[u] = cur;
        for (int v : G[u]) {
            if (match[v] < 0 || augment(match[v])) {
                match[v] = u;
                return true;
            }
        }
        return false;
    }
    
    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new GeorgeInterestingGraph().solve();
        out.close();
    }
    
    static FastScanner in;
    static PrintWriter out;
    
    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;
        
        public FastScanner(BufferedReader in) {
            this.in = in;
        }
        
        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        public int nextInt() {
            return Integer.parseInt(nextToken());
        }
        
        public long nextLong() {
            return Long.parseLong(nextToken());
        }
        
        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}