Problem: Valera takes part in the Berland Marathon. The marathon race starts at the stadium that can be represented on the plane as a square whose lower left corner is located at point with coordinates (0, 0) and the length of the side equals a meters. The sides of the square are parallel to coordinate axes.

As the length of the marathon race is very long, Valera needs to have extra drink during the race. The coach gives Valera a bottle of drink each d meters of the path. We know that Valera starts at the point with coordinates (0, 0) and runs counter-clockwise. That is, when Valera covers a meters, he reaches the point with coordinates (a, 0). We also know that the length of the marathon race equals nd + 0.5 meters. 

Help Valera's coach determine where he should be located to help Valera. Specifically, determine the coordinates of Valera's positions when he covers d, 2·d, ..., n·d meters.

Input

The first line contains two space-separated real numbers a and d (1 ≤ a, d ≤ 105), given with precision till 4 decimal digits after the decimal point. Number a denotes the length of the square's side that describes the stadium. Number d shows that after each d meters Valera gets an extra drink.

The second line contains integer n (1 ≤ n ≤ 105) showing that Valera needs an extra drink n times.

Output

Print n lines, each line should contain two real numbers xi and yi, separated by a space. Numbers xi and yi in the i-th line mean that Valera is at point with coordinates (xi, yi) after he covers i·d meters. Your solution will be considered correct if the absolute or relative error doesn't exceed 10 - 4.

Note, that this problem have huge amount of output data. Please, do not use cout stream for output in this problem.

Examples

Input

2 5
2


Output

1.0000000000 2.0000000000
2.0000000000 0.0000000000


Input

4.147 2.8819
6


Output

2.8819000000 0.0000000000
4.1470000000 1.6168000000
3.7953000000 4.1470000000
0.9134000000 4.1470000000
0.0000000000 2.1785000000
0.7034000000 0.0000000000

Solution (in JAVA):

Solution:
import java.io.*;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Math.*;
 
public class solver implements Runnable {
        final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
        BufferedReader in;
        PrintWriter out;
        StringTokenizer tok = new StringTokenizer("");
       
        void init() throws FileNotFoundException{
            if (ONLINE_JUDGE){
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
           }else{
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
           }
        }       
        String readString() throws IOException{
                while(!tok.hasMoreTokens()){
                        try{
                                tok = new StringTokenizer(in.readLine());
                        }catch (Exception e){
                                return null;
                        }
                }
                return tok.nextToken();
        }
        String readString(String delim) throws IOException{
            while(!tok.hasMoreTokens()){
                    try{
                            tok = new StringTokenizer(in.readLine());
                    }catch (Exception e){
                            return null;
                    }
            }
            return tok.nextToken(delim);
    }
       
        int readInt() throws IOException{
                return Integer.parseInt(readString());
        } 
        int readInt(String delim) throws IOException{
            return Integer.parseInt(readString(delim));
        } 
        long readLong() throws IOException{
                return Long.parseLong(readString());
        }  
        long readLong(String delim) throws IOException{
            return Long.parseLong(readString(delim));
        }      
        double readDouble() throws IOException{
                return Double.parseDouble(readString());
        }      
        double readDouble(String delim) throws IOException{
            return Double.parseDouble(readString(delim));
        } 
        char readChar() throws IOException {
            char val = 0;
            do{
                val = (char) in.read();
            }while(val == '\n' || val == '\r');
            return val;
        }
        char readChar(String skipChars)throws IOException{
            char val = 0;
            boolean ret;
            do{
                val = (char) in.read();
                ret = false;
                for (int i = skipChars.length()-1; i >= 0; i--){
                    if (skipChars.charAt(i) == val){
                        ret = true;
                        break;
                    }
                }
            }while(ret);
            return val;
        }
        
        public class Pair<T1,T2> {
            public T1 x1;
            public T2 x2;
            public Pair(){};
            public Pair(T1 x1, T2 x2){
                this.x1 = x1;
                this.x2 = x2;
            }
        }
        public class Point implements Comparable<Point>{
            public int x1, x2;
            public Point(){}
            public Point(int a, int b){x1 = a;x2=b;}
            public int compareTo(Point o) {
                return x1-o.x1;
            }
        }
 //----------------------------------------
        
         public void solve() throws IOException {
            long a = round(readDouble()*1e4),
                    d = round(readDouble()*1e4);
            int n = readInt();
            long len = 0;
            for (int i = 1; i <= n; i++){
                len += d;
                len%=4*a;
                long k = (long)(len/a)%4;
                
                if (k == 0){
                    out.println((len%a)/1e4 + " 0.0");
                }
                if (k == 1){
                    out.println(a/1e4 + " " + (len%a)/1e4);
                }
                if (k == 2){
                    out.println((a - len%a)/1e4 + " " + a/1e4);
                }
                if (k == 3){
                    out.println("0.0  " + (a - len%a)/1e4);
                }
            }
//            int n = readInt(),
//                  k = readInt();
//            int[] d = new int[n];
//            for (int i = 0; i < n; i++){
//              
//              
//            }
        }
//----------------------------------------
        public static void main(String[] args){
                new Thread(null, new solver(), "", 256 * (1L << 20)).start();
        }
       
        long timeBegin, timeEnd;
 
        void time(){
                timeEnd = System.currentTimeMillis();
                System.err.println("Time = " + (timeEnd - timeBegin));
        }
       
        public void run(){
                try{
                        timeBegin = System.currentTimeMillis();
                        init();
                        solve();
                        out.close();
                        time();
                }catch (Exception e){
                        e.printStackTrace(System.err);
                        System.exit(-1);
                }
        }
}