jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]
use std::io::*;

const SP: u8 = b' ';
const LF: u8 = b'\n';

struct CharacterInput<'a> {
    locked_stdin: StdinLock<'a>,
    bytes_buffer: Vec<u8>,
}

impl<'a> CharacterInput<'a> {
    fn read(&mut self, delimiter: u8) -> &[u8] {
        self.bytes_buffer.clear();

        let mut len = self
            .locked_stdin
            .read_until(delimiter, &mut self.bytes_buffer)
            .unwrap();

        if len > 0 {
            len -= 1;
        }

        &self.bytes_buffer[0..len]
    }

    fn scan_u(&mut self, delimiter: u8) -> u32 {
        self.read(delimiter)
            .into_iter()
            .fold(0, |accumulator, byte| {
                (byte - b'0') as u32 + accumulator * 10
            })
    }
}

fn create_cin<'a>(input: StdinLock<'a>, buffer_capacity: usize) -> CharacterInput {
    CharacterInput {
        locked_stdin: input,
        bytes_buffer: Vec::with_capacity(buffer_capacity),
    }
}

fn println<T: std::string::ToString>(s: T) {
    println!("{}", s.to_string());
}

// ------------------------------------------------------------------------

#[derive(Copy, Clone)]
struct Task {
    duration: u32,
    limit: u32
}

fn main() {
    let cin = stdin();
    let cin = &mut create_cin(cin.lock(), 64);

    let n = cin.scan_u(LF) as usize;

    let mut tasks: Vec<Task> = (0..n).map(|_| Task { duration: cin.scan_u(SP), limit: cin.scan_u(LF) }).collect();
    tasks.sort_by(|a, b| a.limit.partial_cmp(&b.limit).unwrap());

    let mut accumulated_duration: u32 = 0;

    for task in tasks.into_iter() {
        accumulated_duration += task.duration;
        if accumulated_duration > task.limit {
            println("No");
            return;
        }
    }

    println("Yes");
}
//  [rust]
#[derive(Default)]
//NOTE
//declare variables to reduce the number of parameters for dp and dfs etc.
struct Solver {}

impl Solver {
    fn solve(&mut self) {
        let stdin = std::io::stdin();
        let mut scn = Scanner {
            stdin: stdin.lock(),
        };
        let n: usize = scn.read();
        let mut ab: Vec<_> = (0..n)
            .map(|_| {
                let a: usize = scn.read();
                let b: usize = scn.read();
                (a, b)
            })
            .collect();
        ab.sort_by_key(|x| x.1);
        let mut time = 0;
        let mut ok = true;
        ab.iter().for_each(|(a, b)| {
            time += a;
            if time > *b {
                println!("No");
                ok = false;
            }
        });
        if ok {
            println!("Yes");
        }
    }
}

fn main() {
    std::thread::Builder::new()
        .stack_size(64 * 1024 * 1024) // 64MB
        .spawn(|| {
            let mut solver = Solver::default();
            solver.solve()
        })
        .unwrap()
        .join()
        .unwrap();
}
pub mod utils {
    const DYX: [(isize, isize); 8] = [
        (0, 1),   //right
        (1, 0),   //down
        (0, -1),  //left
        (-1, 0),  //top
        (1, 1),   //down right
        (-1, 1),  //top right
        (1, -1),  //down left
        (-1, -1), //top left
    ];

    pub fn try_adj(y: usize, x: usize, dir: usize, h: usize, w: usize) -> Option<(usize, usize)> {
        let ny = y as isize + DYX[dir].0;
        let nx = x as isize + DYX[dir].1;
        if ny >= 0 && nx >= 0 {
            let ny = ny as usize;
            let nx = nx as usize;
            if ny < h && nx < w {
                Some((ny, nx))
            } else {
                None
            }
        } else {
            None
        }
    }
}

//snippet from kenkoooo
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_line(&mut self) -> String {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b'\n' || b == b'\r')
            .take_while(|&b| b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}
//  [rust]
// -*- coding:utf-8-unix -*-

use proconio::input;

fn main() {
    input! {
        n: usize,
    }

    let mut sum_a = 0;
    let mut max_b = 0;
    for _ in 0..n {
        input! {
            a: u64,
            b: u64,
        }

        if a > b {
            println!("No");
            return;
        }

        sum_a += a;
        max_b = max_b.max(b);
    }
    if sum_a > max_b {
        println!("No");
    } else {
        println!("Yes");
    }
}
//  [rust]
// -*- coding:utf-8-unix -*-

use proconio::input;

fn main() {
    input! {
        n: usize,
    }

    let mut sum_a = 0;
    let mut max_b = 0;
    for _ in 0..n {
        input! {
            a: u64,
            b: u64,
        }

        sum_a += a;
        max_b = max_b.max(b);
    }
    if sum_a > max_b {
        println!("No");
    } else {
        println!("Yes");
    }
}
//  [swift]
let n = Int(readLine()!)!

var tasks: [(cost: Int, deadline: Int)] = .init(repeating: (-1, -1), count: n)

for i in 0..<n {
  let inp = readLine()!.split(separator: " ").map { Int($0)! }
  tasks[i] = (inp[0], inp[1])
}

tasks = tasks.sorted { $0.deadline < $1.deadline }

var current = 0
var ans = true
for t in tasks {
  current += t.cost
  if current > t.deadline {
    ans = false
    break
  }
}
print(ans ? "Yes" : "No")
//  [swift]
import Foundation

extension String {
    
    func toStrList() -> [String] {
        return self.map{String($0)}
    }
    
    func toIntList() -> [Int] {
        return self.map{Int(String($0))!}
    }
    
    func toSepDoubleList() -> [Double]{
        return self.split(separator: " ").map{Double($0)!}
    }

    func toSepIntList() -> [Int] {
        return self.split(separator: " ").map{Int($0)!}
    }

    func toSepStrList() -> [String] {
        return self.split(separator: " ").map{String($0)}
    }
    
    func zFill(n:Int) -> String {
        return String(format: "%0\(n)d", Int(self)!)
    }
    
    func count(c:Character) -> Int{
        var result = 0

        for e in self{
            if e == c{
                result += 1
            }
        }
        return result
    }

    func counter() -> Dictionary<Character, Int>{
        var result:[Character:Int] = [:]
        
        for c in self{
            guard let _ = result.index(forKey: c) else {
                result[c] = 1
                continue
            }
            result[c]! += 1
        }
        return result
    }
}

extension Int {
    func toBin() -> String {
        return String(self, radix: 2)
    }
    
    func toNBin(_ radix:Int) -> String{
        return String(self, radix: radix)
    }
    
    func toD() -> Double {
        return Double(self)
    }
}

extension Double {
    func toI() -> Int {
        return Int(self)
    }
}

extension Array where Element: Equatable{
    func count(n:Self.Element) -> Int{
        var result = 0
        for e in self{
            if e == n{
                result += 1
            }
        }
        return result
    }
}

extension Array {
    func dump(){
        for x in 0..<self.count-1{
            print(self[x], terminator: " ")
        }
        print(self.last!)
    }
}

func pow(_ base:Int,_ exp:Int) -> Int{
    let d = pow(base.toD(), exp.toD())
    return Int(d)
}

func distance(p1:CGPoint, p2:CGPoint) -> Double {
    let diffp = CGPoint(x:p1.x - p2.x, y:p1.y - p2.y)
    return Double(sqrt(diffp.x*diffp.x + diffp.y * diffp.y))
}

func distance(p1:[Double], p2:[Double]) -> Double{
    let diff = [p1[0] - p2[0], p1[1] - p2[1]]
    return sqrt(diff[0] * diff[0] + diff[1] * diff[1])
    
}

func lotate(theta:Double, point:[Double]) -> [Double] {
    let matrix = [
        [cos(theta), -sin(theta)],
        [sin(theta), cos(theta)]
    ]
    let x = point[0]
    let y = point[1]
    
    let rx = matrix[0][0]*x + matrix[0][1]*y
    let ry = matrix[1][0]*x + matrix[1][1]*y
    
    return [rx, ry]
}





func abc131d() -> String {
    let N = Int(readLine()!)!
    var AB = [[Int]](repeating: [], count: N)
    var now = 0
    for i in 0..<N{ AB[i].append(contentsOf: readLine()!.toSepIntList()) }
    AB.sort { (a, b) -> Bool in
        return a[1] < b[1]
    }
    for ab in AB {
        now += ab[0]
        if now > ab[1] {
            return "No"
        }
    }
    return "Yes"
}

print(abc131d())
//  [swift]
let N = Int(readLine()!)!
let tasks: [(Int, Int)] = (0..<N).map { _ in
    let input = readLine()!.characters.split(" ").map{Int(String($0))!}
    return (input[0], input[1])
}
var ans = "Yes"
var time = 0
for AB in tasks.sort({$0.1<$1.1}) {
    time += AB.0
    if time > AB.1 {
        ans = "No"
        break
    }
}
print(ans)
//  [swift]
let N = Int(readLine()!)!
let tasks: [(Int, Int)] = (0..<N).map { _ in
    let input = readLine()!.characters.split(" ").map{Int(String($0))!}
    return (input[0], input[1])
}
var ans = "Yes"
var time = 0
for AB in tasks.sort{$0.1<$1.1} {
    time += AB.0
    if time > AB.1 {
        ans = "No"
        break
    }
}
print(ans)
//  [swift]
let N = Int(readLine()!)!
let tasks = [(Int, Int)]()
for _ in 0..<N {
    let input = readLine()!.characters.split(" ").map{Int(String($0))!}
    tasks += [(input[0], input[1])]
}
tasks.sortInPlace{$0.1<$1.1}
var ans = "Yes"
var time = 0
for AB in tasks {
    time += AB.0
    if time > AB.1 {
        ans = "No"
        break
    }
}
print(ans)
//  [swift]
var ans = "Yes"
var time = 0
for AB in ((0..<Int(readLine()!)!).map{_ in readLine()!.characters.split(" ").map{Int(String($0))!}}.sort{$0[1]<$1[1]}) {
    time += AB[0]
    if time > AB[1] {
        ans = "No"
        break
    }
}
print(ans)
//  [typescript]
import { readFileSync } from 'fs'

const canFinish = (works: number[][]) => {
  let totalTime = 0

  for (const [time, limit] of works) {
    totalTime += time
    if (totalTime > limit) {
      return false
    }
  }

  return true
}

function main(input: string) {
  const [[N], ...works] = input.split('\n').map(v => v.split(' ').map(Number))

  works.sort(([, a], [, b]) => a - b)

  console.log(canFinish(works) ? 'Yes' : 'No')
}

main(readFileSync('/dev/stdin', 'utf8').trim())
//  [typescript]
export class Main {
  static main(input): string {
    const tmp: string[] = input.split("\n");
    const n: number = parseInt(tmp[0]);
    const t: number[][] = tmp.slice(1, n + 1).map(l => l.split(" ").map(a => parseInt(a)));
    t.sort(([a1, b1], [a2, b2]) => b1 - b2);
    let time = 0;
    for (let i = 0; i < n; ++i) {
      time += t[i][0];
      if (time > t[i][1]) {
        return "No";
      }
    }
    return "Yes";
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const n = Number(stdin.split('\n')[0])
const [, ..._ab] = stdin.split('\n')
const ab = _ab.map(e => e.split(' ').map(Number))

const ans = () => {
  const sab = ab.sort((a, b) => a[1] - b[1])

  let t = 0
  for (let i = 0; i < n; i++) {
    const [a, b] = sab[i]

    t += a

    if (t > b) {
      return 'No'
    }
  }
  return 'Yes'
}

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

const process = (n: number, ab: number[][]): string => {
  // Bi でソート
  const aabb = ab.sort((na, nb) => na[1] - nb[1])

  var num = 0
  for (var i = 0; i < n; i++) {
    num += aabb[i][0]
    if (num > aabb[i][1]) {
      return "No"
    }
  }

  return "Yes"
}

const Main = (input: string): string => {
  const aa: string[][] = input.split("\n").map((e) => e.split(" "))
  const a = parseInt(aa[0][0])
  aa.shift()
  const na: number[][] = aa.map((e) => e.map((e) => parseInt(e)))

  const res = process(a, na) + ""
  console.log(res)
  return res
}
Main(fs.readFileSync("/dev/stdin", "utf8"))
//  [typescript]
import * as fs from "fs"

const process = (n: number, ab: number[][]): string => {
  // Bi でソート
  const aabb = ab.sort((na, nb) => na[1] - nb[1])

  let num = 0
  for (let i = 0; i < n; i++) {
    num += aabb[i][0]
    if (num > aabb[i][1]) {
      return "No"
    }
  }

  return "Yes"
}

const Main = (input: string): string => {
  const aa: string[][] = input.split("\n").map((e) => e.split(" "))
  const a = parseInt(aa[0][0])
  aa.shift()
  const na: number[][] = aa.map((e) => e.map((e) => parseInt(e)))

  const res = process(a, na) + ""
  console.log(res)
  return res
}
Main(fs.readFileSync("/dev/stdin", "utf8"))
//  [python]
s = input().split()
ret = ""
for si in s:
    ret += si[0]
print(ret.upper())
//  [python]
# coding: utf-8

if __name__ == "__main__":
	s = input().split()
	print((s[0][0]+s[1][0]+s[2][0]).upper())
//  [python]
# -*- coding: utf-8 -*-
a, b, c = [n for n in input().split()]
print((a[0] + b[0] + c[0]).upper())
//  [python]
array=input().split()
tobeprinted=[]
print(array)
for i in range(3):
	tobeprinted.append(array[i][0].upper())
print(*tobeprinted,sep="")
//  [python]
a, b, c = input().split()

print(a[0]+b[0]+c[0])
//  [python]
a, b, c = input().split()
print((s1[0] + s2[0] + s3[0]).upper())
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	char a,b,c;
	public void solve() {
		a = next().charAt(0);
		b = next().charAt(0);
		c = next().charAt(0);

		String s = ""+((char)((a-'a')+'A')) + ((char)((b-'a')+'A')) + ((char)((c-'a')+'A'));
		out.println(s);
	}

	public static void main(String[] args) {
		out.flush();
		new Main().solve();
		out.close();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		String[] ana = new String[6];
		char[] c = new char[3];
		ana=line.split(" ");
		for(int i=0;i<3;i++){
		c[i]=ana[i].charAt(0);
		System.out.print(Character.toUpperCase(c[i]));
		}

	}
}
//  [java]
import java.util.*;
import java.io.*;

class Main{
    public static void main(String[] args){
        FastScanner fsc=new FastScanner();
        for(int i=0;i<3;i++){
            System.out.print(fsc.next().toUpperCase().toCharArray()[0]);
        }
        fsc.close();
    
    }
    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte(){
            if(ptr<buflen) return true;
            else{
                ptr = 0;
                try{
                    buflen = in.read(buffer);
                }
                catch(IOException e){
                    e.printStackTrace();
                }
                if(buflen<=0) return false;
            }
        return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) throw new NumberFormatException();
            while(true){
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                }
                else if(b == -1 || !isPrintableChar(b)) return minus ? -n : n;
                else throw new NumberFormatException();
                b = readByte();
            }
        }
        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }
        public double nextDouble() { return Double.parseDouble(next());}
        public void close(){
            try{in.close();}
            catch(IOException e){e.printStackTrace();}
        }
    }
}
//  [java]
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        String b = sc.nextLine();
        String c = sc.nextLine();

        String ans = a.substring(0,1) + b.substring(0,1) +c.substring(0,1);

        System.out.println(ans.toUpperCase());
    }
}
//  [java]

import java.util.*;

public class Main{
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        String ans = null;
        for(int i = 0; i < 3; i++){
            String s = sc.next();
            ans += s.charAt(0);
        }
        System.out.println(ans.toUpperCase());
    }
}
//  [java]

import java.util.*;

public class Main{
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        String s1 = sc.next();
        String s2 = sc.next();
        String s3 = sc.next();

        String ans = s1.charAt(0) + s2.charAt(0);
        ans += s3.charAt(0);
        System.out.println(ans.toUpperCase());
    }
}
//  [cpp]
#include<stdio.h>

int main(){
    char s1[1000],s2[1000],s3[1000];
    scanf("%s%s%s",s1,s2,s3);
    printf("%c%c%c\n",s1[0]-32,s2[0]-32,s3[0]-32);


    return 0;
}
//  [cpp]
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

char s1[15], s2[15], s3[15];
int main()
{
	while(scanf("%s %s %s", s1, s2, s3) != EOF)
	{
		//printf("%s %s %s\n", s1, s2, s3);
		printf("%c%c%c\n", s1[0] - 32, s2[0] - 32, s3[0] - 32);
		memset(s1, 0, sizeof(s1));
		memset(s2, 0, sizeof(s2));
		memset(s3, 0, sizeof(s3));
	}
}
//  [cpp]
#include<stdio.h>
#include<string.h>
char s1[15];
char s2[15];
char s3[15];
int main(){
	scanf("%s",s1);
	getchar();
	scanf("%s",s2);
	getchar();
	scanf("%s",s3);
	printf("%c%c%c",s1[0]-('a'-'A'),s2[0]-('a'-'A'),s3[0]-('a'-'A'));
}
//  [cpp]
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
#include<bitset>
 
#define Vsort(a) sort(a.begin(), a.end())
#define Vreverse(a) reverse(a.begin(), a.end())
#define Srep(n) for(int i = 0; i < (n); i++)
#define Lrep(i,a,n) for(int i = (a); i < (n); i++)
#define Brep(n) for(int bit = 0; bit < (1<<n); bit++)
#define rep2nd(n,m) Srep(n) Lrep(j,0,m)
#define vi vector<int>
#define vi64 vector<int64_t>
#define vvi vector<vector<int>>
#define vvi64 vector<vector<int64_t>>
 
using namespace std;

int main(){
  string a,b,c;
  cin >> a >> b >> c;
  char d = 'A' - 'a';
  cout << a[0] + d << b[0] + d << c[0] + d << endl;
}
//  [cpp]
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
#include<bitset>
 
#define Vsort(a) sort(a.begin(), a.end())
#define Vreverse(a) reverse(a.begin(), a.end())
#define Srep(n) for(int i = 0; i < (n); i++)
#define Lrep(i,a,n) for(int i = (a); i < (n); i++)
#define Brep(n) for(int bit = 0; bit < (1<<n); bit++)
#define rep2nd(n,m) Srep(n) Lrep(j,0,m)
#define vi vector<int>
#define vi64 vector<int64_t>
#define vvi vector<vector<int>>
#define vvi64 vector<vector<int64_t>>
 
using namespace std;

int main(){
  string a,b,c;
  cin >> a >> b >> c;
  char def = 'A' - 'a';
  cout << a[0] + def << b[0] + def << c[0] + def << endl;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define VIEW(x) do {cerr << #x << ": "; for(auto i : x) cerr << i << " "; cerr << endl;} while(0)
#define ALL(x) (x).begin(),(x).end()
template<class T>bool umax(T &a, const T &b) {if(a<b){a=b;return 1;}return 0;}
template<class T>bool umin(T &a, const T &b) {if(b<a){a=b;return 1;}return 0;}

template<typename A,size_t N,typename T> void FILL(A (&array)[N],const T &val){fill((T*)array,(T*)(array+N),val);}
template<typename T> void FILL(vector<T> &v, const T &x) {fill(v.begin(), v.end(), x);}
template<typename T> void FILL(vector<vector<T>> &v, const T &x) {for(auto &i:v)fill(i.begin(), i.end(), x);}

int main() {
  int n; cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];

  ll ans_p = 0;
  ll sum_p = 0;
  rep(i, n) {
    if(i%2) { // -
      if(sum_p + a[i] < 0) {
        sum_p += a[i];
      }
      else {
        ans_p += (sum_p+a[i]) + 1;
        sum_p = -1;
      }
    }
    else { // +
      if(sum_p + a[i] > 0) {
        sum_p += a[i];
      }
      else {
        ans_p += abs(sum_p+a[i]) + 1;
        sum_p = 1;
      }
    }
  }

  ll ans_m = 0;
  ll sum_m = 0;
  rep(i, n) {
    if(!(i%2)) { // +
      if(sum_m + a[i] < 0) {
        sum_m += a[i];
      }
      else {
        ans_m += (sum_m+a[i]) + 1;
        sum_m = -1;
      }
    }
    else { // -
      if(sum_m + a[i] > 0) {
        sum_m += a[i];
      }
      else {
        ans_m += abs(sum_m+a[i]) + 1;
        sum_m = 1;
      }
    }
  }
  cout << min(ans_m, ans_p) << endl;
}
//  [c]
#include <stdio.h>
#include <ctype.h>

int main(void)
{
  char s1[11], s2[11], s3[11];
  char u[11] = "";
  scanf("%s %s %s", s1, s2, s3);
  u[0] = toupper(s1[0]);
  u[1] = toupper(s2[0]);
  u[2] = toupper(s3[0]);
  puts(u);
  
  return 0;
}
//  [c]

#include <stdio.h>

int main(void)
{
    char acronym[4];
    for (int i = 0; i < 3; i++)
    {
        char str[11];
        if (scanf("%s", str) != 1) return 1;
        char initial = str[0];
        if (initial >= 'a' && initial <= 'z')
            initial -= 'a' - 'A';
        acronym[i] = initial;
    }
    acronym[3] = '\0';

    puts(acronym);

    return 0;
}
//  [c]
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
char s1[20],s2[20],s3[20];
void input(){
    scanf("%s%s%s",s1,s2,s3);
}

int main(){
    char captal[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    input();
    printf("%c%c%c\n",captal[s1[0]-'a'],captal[s2[0]-'a'],captal[s3[0]-'a']);
    return 0;
}
//  [c]
#include<stdio.h>
int main(void){
	char s[3][10];
	for(int i=0;i<3;i++){
		scanf("%s",&s[i][0]);
	}
	printf("%s%s%s",&s[0][0]+('A'-'a'),&s[1][0]+('A'-'a'),&s[2][0]+('A'-'a'));
	
	return 0;
}
//  [c]
#include<stdio.h>
int main(void){
	char s[3][10];
	for(int i=0;i<3;i++){
		scanf("%c",&s[i][0]);
	}
	printf("%s%s%s",&s[0][0]+('A'-'a'),&s[1][0]+('A'-'a'),&s[2][0]+('A'-'a'));
	
	return 0;
}
//  [c]
#include<stdio.h>
int main(void){
	char s[3][10];
	for(int i=0;i<3;i++){
		scanf("%c",&s[i]);
	}
	printf("%s%s%s",&s[0][0]+('A'-'a'),&s[1][0]+('A'-'a'),&s[2][0]+('A'-'a'));
	
	return 0;
}
//  [javascript]
function Main(input) {
  console.log(input.split(/\s+/).map(function(str) {
    return str.substring(0, 1).toUpperCase();
  }).join(""));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
const Main = (input) =>{
	let xs = input.trim().split(' '); 
    let a = xs[0].charAt(0).toUpperCase();
    let b = xs[1].charAt(0).toUpperCase();
    let c = xs[2].charAt(0).toUpperCase();
    console.log(a+b+c);        
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	tmp = input[0].split(" ");
	//文字列から10進数に変換するときはparseIntを使います
	var a = tmp[0]
	var b = tmp[1]
	var c = tmp[2]
    var s = a[0]+b[0]+c[0]
    s=s.toUpperCase();
  	
  	
	//出力
	console.log('%s',s);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  input = input.trim();
  const [a,b,c] = input.split(" ");
  let x = a.slice(0).toUpperCase() + b.slice(0).toUpperCase() + c.slice(0).toUpperCase();
  console.log(x);
 
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  input = input.trim();
  const [a,b,c] = input.split(" ").map(Number);
  let x = a.slice(0,1).toUpperCase() + b.slice(0,1).toUpperCase() + c.slice(0,1).toUpperCase();
  console.log(x);
 
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  input = input.trim();
  const [a,b,c] = input.split(" ").map(Number);
  let x = a.slice(0).toUpperCase() + b.slice(0).toUpperCase() + c.slice(0).toUpperCase();
  console.log(x);

}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"fmt"
	"strings"
)

func main() {
	var s1, s2, s3 string
	fmt.Scan(&s1, &s2, &s3)

	fmt.Println(strings.ToUpper(s1[0:1]+s2[0:1]+s3[0:1]))
}
//  [go]
package main

import (
	"fmt"
	"strings"
)

func main() {
	var s1, s2, s3 string
	fmt.Scan(&s1, &s2, &s3)

	fmt.Println(strings.ToUpper(s1[0:1]) + strings.ToUpper(s2[0:1]) + strings.ToUpper(s3[0:1]))
}
//  [go]
package main

import (
	"fmt"
	"strings"
)

func main() {
	var s1, s2, s3 string
	fmt.Scan(&s1, &s2, &s3)
	fmt.Printf("%s%s%s", strings.ToUpper(s1[0:1]), strings.ToUpper(s2[0:1]), strings.ToUpper(s3[0:1]))
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var (
		s1, s2, s3 string
	)

	fmt.Scan(&s1, &s2, &s3)

	fmt.Print(string(s1[0]) + string(s2[0]) + string(s3[0]))
}
//  [go]
package main

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

func main()  {
  sc := bufio.NewScanner(os.Stdin)
  sc.Buffer(make([]byte, 64*1024*1024), 64*1024*1024)
  sc.Scan()
  n, _ := strconv.Atoi(sc.Text())
  sc.Scan()
  aArr := strings.Split(sc.Text(), " ")
  a := make([]int, n)
  for i := 0; i < n; i++ {
    a[i], _ = strconv.Atoi(aArr[i])
  }
  cnt := 0
  sum := a[0]
  for i := 1; i < n; i++ {
    if (sum+a[i])*sum < 0 {
      sum += a[i]
      continue
    } else if sum+a[i] < 0 {
      cnt += 1-(sum+a[i])
      sum = 1
    } else if sum+a[i] > 0{
      cnt += 1+(sum+a[i])
      sum = -1
    } else {
      cnt += 1
      if sum > 0 {
        sum = -1
      } else {
        sum = 1
      }
    }
  }
  fmt.Println(cnt)
}
//  [ruby]
a = gets.chomp.split
a.each do |n|
	print n[0].upcase
end
//  [ruby]
s = gets.chomp!.split
puts (s[0][0] + s[1][0] + s[2][0]).upcase
//  [ruby]
arrays = gets.split(' ')
i = 0
f = []
while i < arrays.size
  word = arrays[i].split('')
  w = word[0]
  f << w
  i += 1
end

puts f.join.upcase
//  [ruby]
N = gets.to_i
ary = gets.split.map(&:to_i)
# 奇数番をマイナスにするケース
cnt1 = 0
sum = 0
ary.each_with_index do |n, i|
    diff = 0
    sum += n
    if i.odd?
        if sum >= 0
            diff = -sum - 1
        end
    else
        if sum <= 0
            diff = -sum + 1
        end
    end
    cnt1 += diff.abs
    sum += diff
end
# 偶数番をマイナスにするケース
cnt2 = 0
sum = 0
ary.each_with_index do |n, i|
    diff = 0
    sum += n
    if i.even?
        if sum >= 0
            diff = -sum - 1
        end
    else
        if sum <= 0
            diff = -sum + 1
        end
    end
    cnt2 += diff.abs
    sum += diff
end
# プラスとマイナスで操作数の小さいほうを採用
puts [cnt1, cnt2].min
//  [ruby]
#include <iostream>
#include <string>

using namespace std;

int main() {
    for (int _=0; _<3; _++) {
        string s;
        cin >> s;
        cout << char(s[0] + ('A' - 'a')) ;
    }
    cout << endl;
}
//  [ruby]
a,b,c=input().split()
print((a[0]+b[0]+c[0]).upper())
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇
    let s1 = io.chars();
    let s2 = io.chars();
    let s3 = io.chars();

    io.write((s1[0] as u8 - b'a' + b'A') as char);
    io.write((s2[0] as u8 - b'a' + b'A') as char);
    io.write((s3[0] as u8 - b'a' + b'A') as char);
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v:Vec<Vec<char>> = Vec::new();
	for i in iter {
		v.push(i.chars().collect::<Vec<char>>());
	}
	let s1 = v[0].clone();
	let s1c = s1[0].to_uppercase().collect::<Vec<char>>();
	let s2 = v[1].clone();
	let s2c = s2[0].to_uppercase().collect::<Vec<char>>();
	let s3 = v[2].clone();
	let s3c = s3[0].to_uppercase().collect::<Vec<char>>();
	let s = format!("{}{}{}", s1c[0], s2c[0], s3c[0]);
	println!("{}", s);
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇
    let s1 = io.chars();
    let s2 = io.chars();
    let s3 = io.chars();
    println!(
        "{}{}{}",
        s1[0].to_string().to_uppercase().to_string(),
        s2[0].to_string().to_uppercase().to_string(),
        s3[0].to_string().to_uppercase().to_string()
    );
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇
    let s1 = io.chars();
    let s2 = io.chars();
    let s3 = io.chars();
    println!(
        "{}{}{}",
        s1[0].to_uppercase().to_string(),
        s2[0].to_uppercase().to_string(),
        s3[0].to_uppercase().to_string()
    );
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇
    let s1 = io.chars();
    let s2 = io.chars();
    let s3 = io.chars();
    println!(
        "{}{}{}",
        s1[0].to_uppercase(),
        s2[0].to_uppercase(),
        s3[0].to_uppercase()
    );
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v:Vec<Vec<char>> = Vec::new();
	for i in iter {
		v.push(i.chars().collect::<Vec<char>>());
	}
	let s1 = v[0].clone();
	let s2 = v[1].clone();
	let s3 = v[2].clone();
	let s = format!("{}{}{}", ((s1[0] as u8) + (('z' as u8) - 1)) as char, ((s2[0] as u8) + (('z' as u8) - 1)) as char, ((s3[0] as u8) + (('z' as u8) - 1)) as char);
	println!("{}", s);
}
//  [swift]
let i=readLine()!.characters.split(" ").map{String($0).characters.map{String($0)}[0].uppercaseString};print(i[0]+i[1]+i[2])
//  [swift]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main{

	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(br.readLine());
        String S1 =in.nextToken().substring(0, 1);
        String S2 =in.nextToken().substring(0, 1);
        String S3 =in.nextToken().substring(0, 1);
        String ans = S1 + S2 + S3;


        in = null;

		br=null;
		System.out.println(ans.toUpperCase());

	}



}
//  [swift]
let w = readLine()!.components(separatedBy: " ").map({$0.prefix(1).uppercased()})

for ch:String in w {
    print(ch, terminator: "")
}
//  [typescript]
import * as fs from 'fs';

const [s1, s2, s3]: string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split(' ');

const ans: string = s1.substring(0, 1).toUpperCase() + s2.substring(0, 1).toUpperCase() + s3.substring(0, 1).toUpperCase();
console.log(ans);
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let[a,b,c]=srin(3)
  out((a[0]+b[0]+c[0]).toUpperCase())
}
main()
//  [typescript]
const main = (input) => {
  input = input.split(' ');
  const A = input[0];
  const B = input[1];
  const C = input[2];
  
  const bigA = A.toUpperCase();
  const bigB = B.toUpperCase();
  const bigC = C.toUpperCase();
  const result = bigA.slice(0,1)+bigB.slice(0,1)+bigC.slice(0,1);
  
  console.log(result);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let[a,b,c]=srin(3)
  out((a[0]+b[0]+c[0]).toLowerCase())
}
main()
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let[a,b,c]=srin(3)
  out((a[0]+b[0]+c[0]).toLowerCase)
}
main()