jiahuimbzuai/CoQuIR huggingface dataset:
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(ll i = 0; i < n; i++)
#define CloseIO std::ios::sync_with_stdio(false)
const ll N = 8e6+1000;
const ll Mod = 100;
const ll INF = 0x3f3f3f3f3f;
vector<pair<ll,ll> > mp(N);
int main(){
  ll n,m;
  cin>>n>>m;
  ll sum = 0;
  int flag = 0;
  int mi = 0x3f3f;
  int mx = -INF;
  for(int i = 1; i <= n; i++){
    ll k = m+i-1;
    sum += k;
    if(k == 0){
      flag = 1;
    }
    if(k < mi) mi = k;
    if(k > mx) mx = k;
  }
  if(abs(mx) != min(abs(mx),abs(mi))){
    mx = mi;
  }
  if(flag) cout<<sum;
  else cout<<sum - mx;
    return 0;
}
//  [c]
#include<stdio.h>

int main(void){
    int L,N;
    scanf("%d %d", &N,&L);
    if (L>0) {
        printf("%d", ((2*L+N-1)*N)/2-L);
        return 0;
    }
    else if(L+N-1<0){
        printf("%d", ((2*L+N-1)*N)/2-(L+N-1));
        return 0;
    }
    else{
        printf("%d", ((2*L+N-1)*N)/2);
        return 0;       
    }
}
//  [c]
#include<stdio.h>
#include<math.h>
typedef long long ll;
int main()
{
	ll n,l;
	scanf("%lld %lld",&n,&l);
	l--;
	ll ans = l*n + (n*(n+1))/2;
	ll min= l+1;
	ll temp;
	for(ll i=1;i<n+1;i++)
	{
		temp = l+i;
		if(abs(temp) < abs(min))
		{
			min = temp;
		}
	}
	ans -= min;
	printf("%lld\n",ans);
	return 0;
}
//  [c]
#include <stdio.h>
int main(){
    int n,a;
    scanf("%d %d\n", &n, &a);

    int l = a;
    int r = a+n-1;

    int x;
    if(r<=0) x = r;
    else if(l>=0) x =l;
    else x = 0;

    int answer=(r+l)*(r-l+1)/2-x;

    printf("%d\n", answer);

}
//  [javascript]
function Main(input) {
  'use strict';

  const temp = input.split(" ");
  const n = parseInt(temp[0]);
  const startTaste = parseInt(temp[1]);
  const endTaste = startTaste + n - 1;
  const sum = (startTaste + endTaste) * n / 2;
  const product = startTaste * endTaste;
  if(product <= 0) console.log(sum)
  else if(startTaste > 0) console.log(sum - startTaste)
  else console.log(sum - endTaste)
  
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var n = o.a();
  var l = o.a();
  var s = 0, z = l;
  for(var i = 1; i <= n; i++){
    var t = l+i-1;
    s += t;
  }
  if(l>0)s-=l;
  else if(t<0)s -= t;
  return s;
}
//  [javascript]
"use strict";

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }

function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

require("fs");

!function () {
  "use strict";

  !function () {
    function splitNum(line) {
      return (Array.isArray(line) ? line : line.split(/\s+/)).map(function (n) {
        return parseInt(n);
      });
    }

    function* range(start, end) {
      for (var i = start; i < end; i++) {
        yield i;
      }
    }

    !function (input) {
      var lines = input.split("\n");

      var _splitNum = splitNum(lines[0]),
          _splitNum2 = _slicedToArray(_splitNum, 2),
          N = _splitNum2[0],
          L = _splitNum2[1];

      var sum = 0;
      var min = 1 / 0;
      var _iteratorNormalCompletion = true;
      var _didIteratorError = false;
      var _iteratorError = undefined;

      try {
        for (var _iterator = range(L, L + N)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
          var l = _step.value;
          if (Math.abs(l) < Math.abs(min)) min = l;
          sum += l;
        }
      } catch (err) {
        _didIteratorError = true;
        _iteratorError = err;
      } finally {
        try {
          if (!_iteratorNormalCompletion && _iterator.return != null) {
            _iterator.return();
          }
        } finally {
          if (_didIteratorError) {
            throw _iteratorError;
          }
        }
      }

      console.log(sum - min);
    }(require("fs").readFileSync("/dev/stdin", "utf8"));
  }();
}();
//  [go]
package main

import "fmt"

var (
	finv, inv, fac [MAX]int
)

func COM(n, k int) int {
	if n < k {
		return 0
	}
	if n < 0 || k < 0 {
		return 0
	}
	return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD
}

func init() {
	fac[0] = 1
	fac[1] = 1
	finv[0] = 1
	finv[1] = 1
	inv[1] = 1
	for i := 2; i < MAX; i++ {
		fac[i] = fac[i-1] * i % MOD
		inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD
		finv[i] = finv[i-1] * inv[i] % MOD
	}
}

const (
	MOD = 1000000007
	MAX = 510000
)

func ModAdd(a, b int64) int64 {
	return (a + b) % MOD
}

func ModMul(a, b int64) int64 {
	return a * b % MOD
}

func ModSub(a, b int64) int64 {
	r := (a%MOD - b%MOD) % MOD
	if r < 0 {
		r += MOD
	}
	return r
}

func ModDiv(a, b int64) int64 {
	return a % MOD * ModInv(b) % MOD
}

func ModPow(a, n int64) int64 {
	var r int64 = 1
	for n > 0 {
		if n&1 == 1 {
			r = r * a % MOD
		}
		a = a * a % MOD
		n >>= 1
	}
	return r
}

func ModInv(a int64) int64 {
	var b, u, v int64 = MOD, 1, 0
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= MOD
	if u < 0 {
		u += MOD
	}
	return u
}

type Q struct {
	idx, value int
	a, b       int
	index      int
}

type QS []*Q

func (p QS) Len() int           { return len(p) }
func (p QS) Less(i, j int) bool { return p[i].value > p[j].value }
func (pq QS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *QS) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Q)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *QS) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // avoid memory leak
	item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}

func FactoredPrimeNumber(num int) map[int]int {
	m := map[int]int{}
	return factor(m, num, 2)
}

func factor(result map[int]int, num, pnum int) map[int]int {
	if pnum*pnum > num {
		if num != 1 {
			result[num] += 1
		}
		return result
	}

	if num%pnum == 0 {
		num /= pnum
		result[pnum]++
	} else {
		pnum++
	}
	return factor(result, num, pnum)
}

func GCD(a, b int) int {
	if b == 0 {
		return a
	}
	return GCD(b, a%b)
}

func LCM(a, b int) int {
	return a * b / GCD(a, b)
}

type Po struct {
	i       int
	cnt     int
	counter int
}

func main() {
	var N, L int
	fmt.Scanf("%d %d\n", &N, &L)

	sum := 0
	min := int(1e9)

	for i := 1; i <= N; i++ {
		v := L + i - 1
		sum += v
		mr := min
		r := v
		if r < 0 {
			r = -r
		}
		if mr < 0 {
			mr = -min
		}
		if mr > r {
			min = v
		}

	}
	fmt.Println(sum - min)

}

func Reverse(runes []rune) []rune {
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return runes
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func main() {
	list := getStdinIntArr()
	N := list[0]
	L := list[1]

	min := math.MaxInt32
	minIdx := -1
	for i := 1; i <= N; i++ {
		n := L + i - 1
		if n < 0 {
			n = -n
		}
		if n < min {
			min = n
			minIdx = i
		}
	}

	sum := 0
	for i := 1; i <= N; i++ {
		if minIdx != i {
			sum += L + i - 1
		}
	}
	fmt.Printf("%d\n", sum)
}

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}

func getStdinArr() []string {
	str := getStdin()
	list := strings.Split(str, " ")
	return list
}

func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}

func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, e := sc.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
//  [go]
package main
 
import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
	"math"
)
 
func run() {

	var N int;
    N = nextInt();
    var L int;
    L = nextInt();
	solve(N, L);

}

func solve(N int, L int){
	ans := 0.0
	for i := 1; i <= int(N); i++ {
		ans += float64(i+L-1)
	}
	if L > 0 {
		Println(int(ans)-L)
	}else if int(math.Abs(float64(L))) < N {
		Println(ans)
	}else {
		Println(ans + math.Abs(float64(L+N)-1))
	}
}


// --- template ---
// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
// Caution: You will get unexpected result if a single token is larger than this size.
const BufferSize = 64 * 1024 * 1024
 
func Print(a ...interface{}) (n int, err error) {
	return fmt.Fprint(out, a...)
}
 
func Printf(format string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, format, a...)
}
 
func Println(a ...interface{}) (n int, err error) {
	return fmt.Fprintln(out, a...)
}
 
func next() string {
	sc.Scan()
	return sc.Text()
}
 
func nextInt() int {
	a, err := strconv.Atoi(next())
	if err != nil {
		log.Fatal(err)
	}
	return a
}

func nextFloat() float64 {
	a, err := strconv.ParseFloat(next(), 64)
	if err != nil {
		log.Fatal(err)
	}
	return a
}


type IntHeap []int
func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] > h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }

func (h *IntHeap) Push(x interface{}) {
	// Push and Pop use pointer receivers because they modify the slice's length,
	// not just its contents.
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

/////数字と文字
// 基本クラス
type NS struct {
    Num int
    Str string
}

//////　数字と数字
// 基本クラス
type NN struct {
    Num1 int
    Num2 int
}

 
func main() {
	sc.Buffer(make([]byte, 0, BufferSize), BufferSize)
	sc.Split(bufio.ScanWords)
	run()
	out.Flush()
}
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

N, L = get_ints

wa = L * N + ((N * (N-1)) /2)

sa = 10**9
[*1..N].each do |i|
  x = L + i - 1
  sa = x if x.abs < sa.abs
end

puts wa - sa
//  [ruby]
eval"N,L="+`tr ' ' ,`
r=L...L+N
p r.sum-r.min_by(&:abs)
//  [ruby]
n, l = gets.split(' ').map(&:to_i)
puts (l...l+n).sum - (l ... l + n).min_by{|i| i.abs}
//  [rust]
use proconio::{fastout, input};
use std::io::*;
use std::str::FromStr;

use std::cmp::{max, min};

fn main() {
    input! {
        n: i64,
        l: i64,
    }
    let mut ans = 0;
    let mut close0 = std::i64::MAX;

    for i in l..l + n {
        ans += i;
        if close0.abs() > i.abs() {
            close0 = i;
        }
    }
    // println!("close0: {}", close0);
    println!("{}", ans - close0);
}
//  [rust]
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::f64::consts::*;

#[allow(unused)]
const INF: usize = std::usize::MAX / 4;
#[allow(unused)]
const M: usize = 1000000007;

fn main() {
    input! {
        n: usize,
        l: isize,
    }
    let t = (0..n).map(|i| l + i as isize).collect::<Vec<_>>();
    let e = t.iter().min_by_key(|&ti| (ti.abs(), ti)).unwrap();
    println!("{}", t.iter().sum::<isize>() - e);
}
//  [rust]
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:i64 = read();
    let l:i64 = read();
    let left = l;
    let right = l + n - 1;

    let eat = if right <= 0 {
        right
    } else if left >= 0 {
        left
    } else {
        0
    };
    let ans = (right+left) * (right - left + 1) / 2 - eat;
    println!("{}", ans);
}
//  [swift]
let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (N, L) = (input[0], input[1])
let apples = (0..<N).map{$0+L}
let tmp = L>=0 ? apples[0] : N+L-1<0 ? apples[N-1] : 0
print(apples.reduce(0){$0+$1} - tmp)
//  [swift]
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

var n = arr[0]
var l = arr[1]
var i = 0
var min : Int
var o = 0

min = abs( l )
for i in 1...n {
  o += l + i - 1
  if( abs( l + i - 1)  < abs(min) ) { min = l + i - 1   }
}

print( o - min )
//  [typescript]
// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): { N: number, L: number } => {
  const [N, L] = lines[0].split(' ').map(line => +line)
  const obj = { N, L }
  debug(obj)
  return obj
}
// solver
export const solve = (lines: string[]): string => {
  const { N, L } = parseLines(lines)

  const tastes = []
  for (let i = 1; i <= N; i++) {
    const taste = L + i - 1
    tastes.push(taste)
  }
  tastes.sort((a, b) => Math.abs(a) - Math.abs(b))
  const ateTastes = tastes.splice(1, N)
  const result = ateTastes.reduce((prev, current) => prev += current, 0)
  return `${result}`
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const [n, l] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const ans = () => {
  const ajis = Array(n)
    .fill(0)
    .map((e, i) => {
      return l + i
    })

  let sum = 0

  if (ajis[0] > 0) {
    for (let i = 1; i < ajis.length; i++) {
      sum += ajis[i]
    }
    return sum
  } else if (ajis[ajis.length - 1] < 0) {
    for (let i = 0; i < ajis.length - 1; i++) {
      sum += ajis[i]
    }
    return sum
  } else {
    return ajis.reduce((p, c) => p + c)
  }
}

console.log(ans())
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc131 {
    class ProgramB {
        args: string[];

        constructor(args: string[]) {
            this.args = args;
        }

        main(this: ProgramB) {
            const [n, l]: number[] = this.args[0].split(' ').map(Number);

            let sum: number = 0;
            let moreSmall: number = Infinity;
            for (let i = 1; i <= n; i++) {
                sum += l + i - 1;
                if (Math.abs(moreSmall) > Math.abs(l + i - 1)) {
                    moreSmall = l + i - 1;
                }
            }

            if (sum >= 0 && moreSmall >= 0 || sum < 0 && moreSmall < 0) {
                console.log(sum - moreSmall);
            } else {
                console.log(sum + moreSmall);
            }
        }
    }

    new ProgramB(fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n')).main();
}
//  [python]
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

sys.setrecursionlimit(10000)
INF = float('inf')


r, d , x = list(map(int, input().split()))
for i in range(10):
    x = r*x - d
    print(x)
//  [python]
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 

r, D, x_s = [ int(x) for x in input().split() ]

x = x_s
for _i in range(10):
    x = r * x - D
    print (x)
//  [python]
from sys import stdin
import numpy as np

r, D, x2000 = [int(x) for x in stdin.readline().rstrip().split()]

x = x2000

for i in range(10):
    x = r * x -D
    print(x)
//  [java]
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        Integer r = sc.nextInt(); // 2 < 5
        Integer D = sc.nextInt(); // 1 <= 1000
        Integer x = sc.nextInt(); // D <= 200

        List<Integer> results = new ArrayList<>(10);
        for (int i = 0; i < 10; i++) {
            int tmp = r * x - D;
            results.add(tmp);
            x = tmp;
        }

        results.stream().peek(System.out::println).count();
    }

}
//  [java]
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int r = scanner.nextInt();
        int D = scanner.nextInt();
        int x2000 = scanner.nextInt();

        List<Long> list = new ArrayList<>();
        long x = x2000 * r - D;
        list.add(x);
        for (int i=2002; i <= 2010; i++) {
            x = x * r - D;
            list.add(x);
        }

        list.forEach(System.out::println);
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    //final List<Integer> list = new ArrayList<>();
    //final List<Long> list2 = new ArrayList<>();

    long r = sc.nextLong();
    long d = sc.nextLong();
    long x = sc.nextLong();

    for(int i = 0; i < 10 ; i++){
        x = r * x - d;
        System.out.println(x);
    }



    



   
    





}
}
//  [cpp]
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define arr array

using namespace std;

const int e = 2e6 + 69;
const ll mod = 1e9 + 7;

ll a[e];
int n, m;
vector<int>adj[e];
bool vs[e];

//beginner 1999 127

int main()
{
    int r, d, x;
    cin >> r >> d >> x;
    for(int i=1; i<=10; i++){
        x = r*x - d;
        cout << x <<"\n";
    }
}
//  [cpp]
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#include <algorithm>
using namespace std;
namespace mp = boost::multiprecision;
using llll = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
using ll = long long;
const double EPS = 1e-10;
const ll MOD = 7+(1e+9);

int main(){
  ll r,d,x;
  cin>>r>>d>>x;
  for(ll i=0;i<10;i++){
    x=x*r-d;
    cout<<x<<endl;
  }
}
//  [c]
#include <stdio.h>
int main()
{
    int r,x,xnew[100],i,d,sum=0;
    scanf("%d%d%d",&r,&d,&x);

    for(i=0;i<10;i++)
    {
        {
        sum=(r*x-d);
        printf("%d\n",sum);
        x=sum;
        }
    }
}
//  [c]
#include <stdio.h>

int main(){
  int r,D,x;
  scanf("%d %d %d",&r,&D,&x);
  for(int i=1;i<=10;i++){
    x=r*x-D;
    printf("%d\n",x);
  }
  
  return 0;
}
//  [c]
#include <stdio.h>

int main(void){
  int r,d,x;

  scanf("%d %d %d",&r,&d,&x);

  for(int i = 0; i < 10; i++){
    x = r*x - d;
    printf("%d\n", x);
  }
}
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    input = input.split("\n");
    tmp0 = input[0].split(" ");
    r = Number(tmp0[0]);
    D = Number(tmp0[1]);
    x = Number(tmp0[2])
   
    beforex = x
    for(var i=0; i<10; i++){
        newx = r * beforex - D
        console.log(newx)
        beforex = newx
    }
  }
  //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//   Main("4 40 60\n");
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8'); 
var lines = [];
var reader = require('readline').createInterface({
	input: process.stdin,
	output: process.stdout
});
 
reader.on('line', (line) => {
	lines.push(line);
});

reader.on('close', () => {
	"use strict"
	const r = +lines[0].split(" ")[0];
	const D = +lines[0].split(" ")[1];
	const x = +lines[0].split(" ")[2];
	
	const ans = [];
	let last = x;
	for(let i=0; i<10; i++){
		last = r*last - D;
		ans.push(last);
	}
	
	console.log(ans.join("\n"));
});
//  [javascript]


function Main(input) {
  input = input.split("\n");
  var r = parseInt(input[0].split(" ")[0]);
  var D = parseInt(input[0].split(" ")[1]);
  var x = parseInt(input[0].split(" ")[2]);
  var anss = new Array(10);
  anss[0]=x*r-D;
  for(var i=1;i<10;i++){
    anss[i]=anss[i-1]*r-D;
  }
  var ans=anss.join("\n");

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)

func main() {
	list := getStdinIntArr()
	r := list[0]
	D := list[1]
	x2000 := list[2]
	xList := make([]int, 11)

	xList[0] = x2000
	for i := 1; i <= 10; i++ {
		xList[i] = r*xList[i-1] - D
		fmt.Printf("%d\n", xList[i])
	}
}

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}

func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}

func readLine() string {
	buf := make([]byte, 0, 1024*1024*10)
	for {
		l, p, e := sc.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var r, D, x int
	fmt.Scan(&r, &D, &x)

	var nx int
	for i := 0; i < 10; i++ {
		nx = r*x - D
		fmt.Println(nx)
		x = nx
	}

}
//  [ruby]
r,d,x = gets.chomp.split(' ').map(&:to_i)
10.times do
  x = r * x - d
  puts x
end
//  [ruby]
r,d,x=gets.split.map &:to_i
ans=x
10.times do |i|
  kai=r*ans-d
  puts kai=r*ans-d
  ans=kai
end
//  [ruby]
r,d,x = gets.chomp.split(" ").map(&:to_i)
10.times do
  x = r * x - d
  puts x
end
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    input! {
    a:usize,
    b:usize,
    c:usize,
    }
    let mut ans:usize=c;
    for i in 0..10 {
        ans=ans*a-b;
        println!("{}",ans);
    }
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        r: u128,
        d: u128,
        x: u128
    };

    let mut x = r * x - d;
    for _ in 0..10 {
        println!("{}", x);
        x = r * x - d;
    }
}
//  [rust]
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("Failed to read bytes") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let r:usize = read();
    let d:usize = read();
    let mut x:usize = read();
    for _ in 0..10 {
        x = r*x - d;
        println!("{}", x);
    }
}
//  [swift]
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
//    func enumerated() -> [(Int, Element)] {
//        return self.enumerate()
//    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

//func gcd(x: Int, _ y: Int) -> Int {
//    if y == 0 {
//        return x
//    } else {
//        return gcd(y, x%y)
//    }
//}
//func lcm(x: Int, _ y: Int) -> Int {
//    return x * y / gcd(x, y)
//}

/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
var (r, D, x) = (input[0], input[1], input[2])
for _ in 0..<10 {
    x = r * x - D
    print(x)
}
//  [swift]
import Foundation

extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
}

func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}


/************** main *****************/

let rdx = readIntSplit(by: " ")
var (r, d, x) = (rdx[0], rdx[1], rdx[2])
for i in 0 ..< 10 {
    x = r * x - d
    print(x)
}
//  [typescript]
import { readFileSync } from 'fs'

const range = (start: number, end: number) =>
  Array(end - start).fill(null).map((v, i) => i + start)

function main(input: string) {
  const [r, D, x] = input.split(' ').map(Number)

  const memo = { 2000: x }

  const recurrence = (year: number) =>
    memo[year] = r * memo[year - 1] - D

  range(2001, 2011).forEach(year =>
    console.log(recurrence(year))
  )
}

main(readFileSync('/dev/stdin', 'utf8').trim())
//  [typescript]
const t={input:require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/),n:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.n())}return a}else{const a=t.input[0];t.input.shift();return Number(a)}},s:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.s())}return a}else{const a=t.input[0];t.input.shift();return String(a)}},c:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.c())}return a}else{let a=t.input[0].split('');const b=a[0];a.shift();if(a.length>0){t.input[0]=a.join('')}else{t.input.shift()}return String(b)}},o:(...arg)=>{console.log(...arg)},abs:(a)=>{return Math.abs(a)},min:(...a)=>{return Math.min(...a)},max:(...a)=>{return Math.max(...a)},floor:(a)=>{return Math.floor(a)},asc:(ar:number[])=>{return ar.sort((a,b)=>{return a-b})},desc:(ar:number[])=>{return ar.sort((a,b)=>{return b-a})},sw:(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]}};
const main=()=>{
  let [a,b,c]=t.n(3)
  for(let i=0;i<10;i++){
    c=c*a-b
    t.o(c)
  }
}
main()
//  [typescript]
{
  const process = (r: number, d: number, x: number): string => {
    const weights = []
    weights[0] = r * x - d
    for (let i = 1; i < 10; i++) {
      weights[i] = r * weights[i - 1] - d
    }
    return weights.join("\n")
  }

  const Main = (input: string): string => {
    const a: string[] = input.split(" ")
    const na: number[] = a.map((e) => parseInt(e))
    const res = process(na[0], na[1], na[2])
    console.log(res)
    return res
  }
  Main(require("fs").readFileSync("/dev/stdin", "utf8"))
}
//  [python]
for i in range(365):
  print((i+3)%26+1)
//  [python]
a=int(input())
for i in range(a):
  print(1)
//  [python]
for i in range(365):
  print(i%26+1)
//  [python]
from copy import copy
import random
import math
import sys
input = sys.stdin.readline
D = int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for _ in range(D)]
last = [0]*26
ans = [0]*D
score = 0
for i in range(D):
    ps = [0]*26
    for j in range(26):
        pl = copy(last)
        pl[j] = i+1
        ps[j] += s[i][j]
        for k in range(26):
            ps[j] -= c[k]*(i+1-pl[k])
    idx = ps.index(max(ps))
    last[idx] = i+1
    ans[i] = idx+1
    score += max(ps)
T = 300
for k in range(42000):
    na = copy(ans)
    x = random.randint(1,365)
    y = random.randint(1,365)
    if x == y:
        continue
    na[x-1],na[y-1] = na[y-1],na[x-1]
    last = [0]*26
    ns = 0
    for i in range(D):
        last[na[i]-1] = i+1
        ns += s[i][na[i]-1]
        for j in range(26):
            ns -= c[j]*(i+1-last[j])
    if k%80 == 0:
        T *= 0.99
    p = pow(math.e,-abs(ns-score)/T)
    if ns > score or random.random() < p:
        ans = na
        score = ns
for a in ans:
    print(a)
//  [python]
import sys
import heapq
from typing import List, Tuple, Dict
from dataclasses import dataclass, field

import scipy
import numpy as np
from numba import njit

D = int(input())  # 日数 D = 365
C = np.array(list(map(int, input().split())), dtype='int32')  # 満足度の下がりやすさ 26個
S = np.array([list(map(int, input().split())) for _ in range(D)], dtype='int32')  # d日目にコンテストiを行ったときの満足度

@dataclass()
class Node:
    value: int
    plan: List[int]
    last: List[int]

    def __lt__(self, other) -> bool:
        return self.value > other.value  # PriorityQueueで最大値が欲しいので逆に

CAPACITY = 20

queue: List[Node] = [Node(0, [], [0 for _ in range(26)])]
for d in range(D):
    next_queue: List[Node] = []

    heapq.heapify(queue)
    while queue:
        node = heapq.heappop(queue)

        for i in range(26):
            s = S[d][i] + C[i] * (d + 1 - node.last[i])

            next_queue.append(
                Node(
                    node.value + s,
                    node.plan + [i + 1],
                    node.last[:i] + [d + 1] + node.last[i + 1:]
                ),
            )

    queue = sorted(next_queue)[:CAPACITY]

res_node = heapq.heappop(queue)
print(res_node, file=sys.stderr)
print('\n'.join(map(str, res_node.plan)))
//  [java]
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	static void solve(){//Here is the main function
		int D = nextInt();
		ArrayList<Integer> clist = nextIntArray();
		String[] output = new String[D];
		for(int i = 1; i <= D; i++){
			output[i - 1] = String.valueOf((i % 26) + 1);
		}
		myout(myconv(output, 9));
	}
	//Method addition frame start



	//Method addition frame end

	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
}
//  [java]
import java.io.PrintWriter;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		Random r = new Random();
		
		long startMilli = System.currentTimeMillis();
		
		final int N = 26;

		int D = sc.nextInt();
		int[] c = new int[N];
		for(int i=0; i<N; i++)
			c[i] = sc.nextInt();
		
		int[][] s = new int[D][N];
		for(int i=0; i<D; i++)
			for(int j=0; j<N; j++)
				s[i][j] = sc.nextInt();
		
		int[] t = new int[D];
		for(int i=0; i<D; i++)
			t[i] = r.nextInt(N);
		
//		int score = 0;
//		int[] last = new int[N];
//		for(int i=0; i<D; i++) {
//			score += s[i][t[i]];
//			last[t[i]]=i+1;
//			for(int j=0; j<N; j++)
//				score -= c[j]*(i+1-last[j]);
//		}
		
		long currentMilli = System.currentTimeMillis();

		while(currentMilli - startMilli < 1900) {
			for(int i=0; i<10000; i++) {
				int d = r.nextInt(D)+1;
				int to = r.nextInt(N);
				int from = t[d-1];
				if(from==to)
					continue;
	
				int scoreDiff = s[d-1][to] + c[to]*(d-getIndex(t, to, d, false))*(getIndex(t, to, d, true)-d);
				scoreDiff -= s[d-1][from] + c[from]*(d-getIndex(t, from, d, false))*(getIndex(t, from, d, true)-d);
				if(scoreDiff>0)
					t[d-1] = to;
			}
			currentMilli = System.currentTimeMillis();
		}
		for(int i=0; i<D; i++)
			pw.println(t[i]+1);

		sc.close();
		pw.close();
	}
	
	static int getIndex(int[] t, int type, int base, boolean isForward) {
		int ans = base;
		int diff = isForward ? 1 : -1;
		ans += diff;
		while(1 <= ans && ans <= t.length) {
			if(t[ans-1]==type)
				return ans;
			ans += diff;
		}
		return ans;
	}
}
//  [cpp]
#include<stdio.h>
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
int c[26],s[365][26]={{0}},type[365];
void solve(int d)
{
  int since[26]={0};
  for(int i=0;i<d;i++)
  {
    int max=1<<31,now=-1,keep;
    for(int j=0;j<26;j++){keep=s[i][j]-c[j]*(i-since[j]);if(max<keep){max=keep;now=j;}}
    type[i]=now;since[now]=i;
  }
}
int main()
{
  int D=IN(),i=0,j=0;
  while(i<26){c[i++]=IN();}i=0;
  while(i<D){while(j<26){s[i][j++]=IN();}i++,j=0;}i=0;
  solve(D);
  while(i<D){printf("%d\n",type[i++]+1);}
}
//  [cpp]
#pragma GCC optimize("O3")
#include<stdio.h>
int main(void){
  printf("1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1");
  return 0;
}
//  [cpp]
#include <stdio.h>
int main() {
  for (int i = 1; i <= 365; i++) printf("1\n");
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define len(s) (int)s.size()
#define pb push_back

template<class T> inline bool chmin(T &a, T b){
	if(a>b){a=b;return true;}
	return false;
}
template<class T> inline bool chmax(T &a, T b){
	if(a<b){a=b;return true;}
	return false;
}
constexpr int mod = 1e9+7;
constexpr int inf = 3e18;

int D;
int C[26];
int A[365][26];
int con[365];
int score(){
	vector<int>last(26,-1);
	int res=0;
	rep(i,D){
		last[con[i]]=i;
		res+=A[i][con[i]];
		rep(j,26){
			res-=C[j]*(i-last[j]);
		}
	}
	return res;
}
int change(int x,int y){
	int res=A[x][y]-A[x][con[x]];
	int lastold=-1,lastnew=-1;
	rep(i,D){
		if(con[i]==con[x])lastold=i;
		if(con[i]==y)lastnew=i;
		res+=(i-lastold)*C[con[x]];
		res+=(i-lastnew)*C[y];
	}
	lastold=-1,lastnew=-1;
	rep(i,D){
		if(con[i]==con[x]&&i!=x)lastold=i;
		if(con[i]==y||i==x)lastnew=i;
		res-=(i-lastold)*C[con[x]];
		res-=(i-lastnew)*C[y];
	}
	return res;
}
signed main(){
	cin>>D;
	rep(i,26)cin>>C[i];
	rep(i,D){
		int mx=0,idx;
		rep(j,26){
			cin>>A[i][j];
			if(chmax(mx,A[i][j]))idx=j;
		}
		con[i]=idx;
	}
	int score_=score();
	cerr<<score_<<endl;
	while(1000.*clock()/CLOCKS_PER_SEC<=1990){
		int x=rand()%D,y;
		do{
			y=rand()%26;
		}while(con[x]==y);
		int diff=change(x,y);
		if(diff>=0/*||tim<rand()%1990*/){
			score_+=diff;
			con[x]=y;
		}
	}
	rep(i,D)cout<<con[i]+1<<"\n";
	cerr<<score_<<endl;
}
//  [cpp]
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2")

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

int c[26];
int64_t csum;
int64_t s[366][26];

int64_t eval(const vector<int> &state, int d){
    int last[26] = {0};
    int64_t decl = -csum;
    int64_t score = 0;

    for(int i=1;i<=d;++i){
        score += s[i][state[i]];
        decl += (i - last[state[i]])*c[state[i]];
        last[state[i]] = i;
        score += decl;
        decl -= csum;
    }
    return score;
}

vector<int> beam(int D, int w){
    map<int64_t, vector<int>, greater<int64_t>> mp;
    for(int i=0;i<26;++i){
        mp[s[1][i] + c[i] - csum] = vector<int>{2, i};
    }
    for(int d=2;d<=D;++d){
        int cnt = 0;
        vector<vector<int>> states;
        for(auto p: mp){
            states.push_back(p.second);
            ++cnt;
            if(cnt >= w) break;
        }
        mp.clear();
        for(auto v: states){
            for(int i=0;i<26;++i){
                vector<int> state{v};
                state.emplace_back(i);
                mp[eval(state, d)] = state;
            }
        }
    }
    return mp.begin()->second;
}

int main(){
    int d;
    scanf("%d", &d);
    for(int i=0;i<26;++i) scanf("%d", &c[i]);
    for(int i=0;i<26;++i) csum += c[i];

    for(int i=1;i<=d;++i){
        for(int j=0;j<26;++j) scanf("%" SCNd64, &s[i][j]);
    }

    auto ans = beam(d, 270);
    for(int i=1;i<=d;++i) printf("%d\n", ans[i] + 1);

    return 0;
}
//  [c]
#pragma GCC optimize("O3")
int main(void){
  puts("1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1");
  return 0;
}
//  [c]
main(i){for(i=0;i<365;i++)printf("%d\n",i%26+1);}
//  [c]
int main(void){
  puts("1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1");
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define type 26

int max(int D, int s[][type+1]);
int score_calc(int D, int s[][type+1], int schedul[], int c[type+1], int last[type+1]);
void swap(int D, int s[][type+1], int schedul[], int c[type+1], int last[type+1], int *ini);

int main(void)
{
    int i, j;
    int D, c[type+1], last[type+1];
    int ini;
    clock_t start, stop;
    // 計測開始
    start = clock();
    // 入力
    scanf("%d",&D);
    int s[D+1][type+1], schedul[D+1];
    for(i=1; i<type+1; i++){
        scanf("%d", &c[i]);
    }
    for(i=1; i<D+1; i++){
        for(j=1; j<type+1; j++){
            scanf("%d", &s[i][j]);
        }
    }
    // 初期
    for(i=1; i<D+1; i++){
        schedul[i] = max(i, s);
    }
    for(i=1; i<type+1; i++){
        last[i] = 0;
    }
    ini = score_calc(D, s, schedul, c, last);
    stop = clock();
    // 改善
    srand((unsigned int)time(NULL));
    while((double)(stop - start) / CLOCKS_PER_SEC < 1.990000){
        swap(D, s, schedul, c, last, &ini);
        stop = clock();
    }
    //出力
    for(i=1; i<D+1; i++){
        printf("%d\n",schedul[i]);
    }
    
    return 0;
}

int max(int D, int s[][type+1]) // D日目の満足度が一番高いタイプを返す
{
    int i;
    int max_score = 0, max_type;
    
    for(i=1; i<type+1 ;i++){
        if(s[D][i] > max_score){
            max_score = s[D][i];
            max_type = i;
        }
    }
    return max_type;
}

int score_calc(int D, int s[][type+1], int schedul[], int c[type+1], int last[type+1])
{
    int i,j;
    int score = 0;
    
    for(i=1; i<D+1; i++){
        score += s[i][schedul[i]];
        last[schedul[i]] = i;
        for(j=1; j<type+1; j++){
            score -= c[j] * (i-last[j]);
        }
    }
    
    return score;
}

void swap(int D, int s[][type+1], int schedul[], int c[type+1], int last[type+1], int *ini)
{
    int i;
    int a, b, tmp, imp = 0;
    
    a = rand()%D+1;
    b = rand()%D+1;
    tmp = schedul[a];
    schedul[a] = schedul[b];
    schedul[b] = tmp;
    
    for(i=1; i<type+1; i++){
        last[i] = 0;
    }
    imp = score_calc(D, s, schedul, c, last);
    
    if(imp > *ini){
        *ini = imp;
        
    }else{
        schedul[b] = schedul[a];
        schedul[a] = tmp;
    }
}