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

public class elevator_gk_square {
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();

        int[] q = new int[c];

        Arrays.fill(q, Integer.MAX_VALUE);
        for (int x = 0; x < c; x++) {
            for (int y = 0; y < c; y++) {
                int v = a * x + b * y;
                int f = v % c;
                q[f] = Math.min(q[f], v);
            }
        }

        PrintWriter w = new PrintWriter(System.out);
        for (int i = 0; i < c; i++) {
            w.println(q[i]);
        }
        w.close();
    }
}
