import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer tokenizer = null;
    int totalCases, testNum;

    PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    void solve() throws IOException {

    }

    void execute() throws IOException {
        int n = ni();
        int k = ni();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++) {
            arr[i] = ni();
        }
        Arrays.sort(arr);
        int res = 0;
        for (int i = 0; i < k; i++) {
            res += arr[i];
        }
        out.println(res);
        out.close();
    }

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

    void debug(Object... os) {
        System.out.println(Arrays.deepToString(os));
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String ns() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(br.readLine());
        }
        return tokenizer.nextToken();
    }

    String nline() throws IOException {
        tokenizer = null;
        return br.readLine();
    }

    boolean input() throws IOException {
        return true;
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N=sc.nextInt();
    int K=sc.nextInt();
    int sum=0;
    int X[]=new int[N];
    Arrays.sort(X);
    for (int i=0; i<K; i++) {
    	sum += X[i];
    }
    System.out.println(sum);
  }
}


import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] A = new int[N];
        for(int i=0; i<N; i++){
            A[i]=sc.nextInt();
        }
        int res;
        Arrays.sort(A);
        for(int i=0; i<K; i++){
            res += A[i];
        }
        System.out.println(res);
        }
    }


import java.util.*;

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

        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] y = new int[n];
        int ans=0;

        for(int i=0; i<n; i++){
            y[i] = sc.nextInt();
        }

        Arrays.sort(y);
        for(int i=0; i<3; i++){
            ans+=y[i];
        }

        System.out.println(ans);
   }
}


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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }

struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

int main() {
    i64 N, K; cin >> N >> K;
    vector<i64> P(N);
    REP(i, N) cin >> P[i];
    sort(P.begin(), P.end());
    i64 ans = 0;
    REP(i, K) ans += P[i];
    cout << ans << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,f;
    cin>>n>>f;
    int ar[n];
    for(int i=0; i<n; i++)cin>>ar[i];
    sort(ar,ar+n);
    int s = 0;
    for(int i=0; i<f; i++)s+=ar[i];
    cout<<s;
}


#include <iostream>

using namespace std;
int p[10001],price,c;

int main()
{
    int n,k;
    cin>>n>>k;
    for (int i=0; i<n; i++) {
        cin >> price;
        p[price]++;
    }
    price=0;
    while (k!=0){
        price++;
        for (;p[price]!=0; p[price]--,c+=price,k--)
            if (k==0)
                break;
    }
    cout<<c;
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
  int N, K, input;
  cin >> N >> K;
  vector<int> prices;
  for (int i = 0; i < N; ++i) {
  	cin >> input;
    prices.push_back(input);
  }
  sort(prices.begin(), prices.end());
  int cost = 0;
  for (int i = 0; i < K; ++i)
    cost += prices[i];
  cout << prices;
  return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <set>
typedef long long ll;
using namespace std;

int arr[1007];
int main() {
    int n, k; cin >> n >> k;
    for (int i = 0; i < n; ++i) {
        cin >> arr[i];
    }
    sort(arr, arr + n);
    cout << arr[0] + arr[1] + arr[2] << endl;

    return 0;
}


#include <iostream>
#include<array>
using namespace std;

int main() {
    // Input
    int n, k, sum;
    cin >> n >> k;
    int p[n];
    for(int i = 0; i < n; i++) {
        cin >> p[i];
    }

    // Bubble sort
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n-1; j++) {
            if (p[j] > p[j+1]) {
                swap(p[j], p[j+1]);
            }
        }
    }

    // Output
    for(int i = 0; i < k; i++) {
        sum += p[i];
    }

    cout << sum << endl;
}


#include<stdio.h>

void selectionSort(int *, int);

int main()
{
  int n, k;
  scanf("%d %d", &n, &k);

  int p[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i]);
  }

  selectionSort(p, n);

  int sum = 0;
  for (int i = 0; i < k; i++) {
    sum += p[i];
  }

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

  return 0;
}

void selectionSort(int *p, int n)
{
  for (int i = 0; i < n; i++) {
    int minJ, minP = 1000;
    for (int j = i + 1; j < n; j++) {
      if (p[j] < minP) {
        minP = p[j];
        minJ = j;
      }
    }
    if (minP < p[i] ) {
      int tmpP = p[i];
      p[i] = minP;
      p[minJ] = tmpP;
    }
  }
}


#include <stdio.h>

int main(void){

    int entry_sell,entry_buy;
    int entry_tanka[1000];
    int i,j,min,sum,index;

    //入力
    scanf("%d",&entry_sell);
    scanf("%d",&entry_buy);

    for(i=0; i<entry_sell; i++){
        scanf("%d",&entry_tanka[i]);
    }

    sum=0;
    for(i=0;i<entry_buy; i++){

        //最小単価を探す
        min=entry_tanka[0];
        index=0;
        for(j=1; j<entry_sell;j++){
            if(entry_tanka[j]<min){
                min = entry_tanka[j];
                index=j;
            }
        }
        //tanka[index]が最小なので買う
        sum = sum+min;
        for(j=index; j<entry_sell; j++){
            entry_tanka[j]=entry_tanka[j+1];
        }
        entry_tanka[entry_sell]='\0';
        entry_sell--;
    }

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

    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int compare_ints(const void* a, const void* b)
{
    int arg1 = *(const int*)a;
    int arg2 = *(const int*)b;

    if (arg1 < arg2) return -1;
    if (arg1 > arg2) return 1;
    return 0;
}

int	main(void)
{
  	int	n;
  	int k;
  	int	p[1001];
  	int	i;
  	int	sum;

  	scanf("%d %d\n", &n, &k);
  	for(i=0;i<n;i++)
    {
      	scanf("%d", &p[i]);
    }

  	qsort(p, n, sizeof(int), compare_ints);

  	sum = 0;
  	for(i=0; i<k; i++)
    {
      	sum += p[i];
    }
  	printf("%d", sum);
  	return (0);
}


#include<stdio.h>

int main(void){
  int n,k;
  scanf("%d %d",&n,&k);
  int p[n];
  for(int i=0;i<n;i++){
  scanf("%d",&p[i]);
  }
  int tmp;
  for (i=0; i<n; ++i) {
    for (j=i+1; j<n; ++j) {
      if (p[i] > p[j]) {
        tmp =  p[i];
        p[i] = p[j];
        p[j] = tmp;
      }
    }
  }
  int c=0;

  for(int i=0;i<k;i++){
    c+=p[i];
  }
  printf("%d\n",c);
return 0;
}


#include<stdio.h>
int main(void)
{
	int n,p[1001],k,i,j,x,b;
	scanf("%d %d",&n,&k);
	for(i=0;i<n;i++){
	scanf("%d",&p[i]);
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			if(p[i]>p[j]){
				x=p[i];
				p[i]=p[j];
				p[j]=x;
			}
		}
	}
	for(i=0;i<k;i++){
		b+=p[i];
	}
	printf("%d\n",b);
	return 0;
}


"use strict";

function main(input) {
  input = input.trim().split("\n");
  const line_one = input[0].split(" ");
  const line_two = input[1].split(" ");

  for (const i in line_two) {
    line_two[i] = parseInt(line_two[i]);
  }

  let ans = 0;
  line_two.sort(f);
  for (let i = 0; i < line_one[1]; i++) {
    ans = ans + line_two[i];
  }
  console.log(ans);
}
var f = function (a, b) {
  return a - b;
};

main(require("fs").readFileSync("/dev/stdin", "utf-8"));


function Main(input) {
  var s = input.split('\n')[0].split(" ")[1];
  var p = input.split('\n')[1].split(" ").map(el => parseInt(el)).sort(
    function(a,b){return a<b?-1:a>b?1:0;
  });
  console.log(p.slice(0,s).reduce((sum,cV)=>sum+cV))
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
  const [n, k] = input[0].trim().split(" ").map(i => parseInt(i));
  const p = input[1].trim().split(" ").map(i => parseInt(i)).sort(function(a, b) {return a - b;});

  const sum  = function(arr) {
    return arr.reduce(function(prev,current,i,arr) {return (i<k)?(prev+current):(prev)});
  };
  console.log(sum(p));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));


"use strict";

const main = (input) => {
    const spi = input.split('\n');
    const [n, k] = spi[0].split(' ').map(e => parseInt(e));
    const p = spi[1].split(' ').map(e => parseInt(e));

    p.sort(function(a, b){
        return a - b;
    });

    let ans = 0;
    for (let i = 0; i < k; i++) {
        console.log(p[i]);
        ans += p[i];
    }

    console.log(ans);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));


// parameter "input" gets all data
function Main(input) {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.
	input = input.split("\n");
	let n = input[0].split(" ")[0];
	let k = input[0].split(" ")[1];
	let arr = input[1].split(" ").map(el => parseInt(el));
	arr.sort();
  	let ans = 0;
	for(let i=0;i<min(arr.length,k);i++)
		ans+=arr[i];

  	console.log(ans);
}
// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


// parameter "input" gets all data
function Main(input) {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.
	input = input.split("\n");
	let n = input[0].split(" ")[0];
	let k = input[0].split(" ")[1];
	let arr = input[1].split(" ").map(el => parseInt(el));
	arr.sort();
  	let ans = 0;
	for(let i=0;i<arr.length;i++)
		ans+=arr[i];

  	console.log(ans);
}
// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func main() {
	N, K := ReadInt(), ReadInt()
	p := ReadInts(N)
	sort.Ints(p)
	ans := 0
	for i := 0; i < K; i++ {
		ans += p[i]
	}
	fmt.Println(ans)
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var n, k int
	con.Scan(&n, &k)
	p := make([]int, n)
	for i := 0; i < n; i++ {
		con.Scan(&p[i])
	}
	sort.Ints(p)
	s := 0
	for i := 0; i < k; i++ {
		s += p[i]
	}
	con.Println(s)
	return nil
}


package main

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

func main() {
	scanner := makeWordScanner()
	n := eGetInt(scanner)
	k := eGetInt(scanner)
	ps := make([]int, n)
	for i := 0; i < n; i++ {
		ps[i] = eGetInt(scanner)
	}
	sort.Ints(ps)
	sum := 0

	for i := 0; i < k; i++ {
		sum += ps[i]
	}
	fmt.Println(sum)
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
const (
	TooLarge = math.MaxInt64
	TooSmall = math.MinInt64
)

func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeCharScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanRunes)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetInt64(r *bufio.Scanner) int64 {
	line := eGetLine(r)
	return eAtoInt64(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetInt64s(r *bufio.Scanner) []int64 {
	fields := eGetFields(r)
	ints := make([]int64, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoInt64(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}
func eAtoInt64(s string) int64 {
	n, err := strconv.ParseInt(s, 10, 64)
	if err != nil {
		log.Fatal(err)
	}
	return n
}
func pow(a, n int) int {
	if n == 0 {
		return 1
	}
	if n == 1 {
		return a
	}
	if n%2 == 1 {
		return pow((a*a), n/2) * a
	}
	return pow((a * a), n/2)
}
func pow5(a int, memo map[int]int) int {
	v, ok := memo[a]
	if ok {
		return v
	}

	b := a * a
	c := b * b
	memo[a] = c * 5
	return memo[a]
}
func powMod(a, n, mod int) int {
	if n == 0 {
		return 1 % mod
	}
	if n == 1 {
		return a % mod
	}
	if n%2 == 1 {
		return powMod((a*a)%mod, n/2, mod) * a % mod
	}
	return powMod((a*a)%mod, n/2, mod)
}

func factoricalMod(n, count, mod int) int {
	if count == 1 {
		return n % mod
	}
	return (n % mod) * (factoricalMod(n-1, count-1, mod)) % mod
}

func combinationMod(n, a, mod int) int {
	x := factoricalMod(n, a, mod)
	y := factoricalMod(a, a, mod)
	y = powMod(y, mod-2, mod)
	return ((x % mod) * (y % mod)) % mod
}
func countBitOfOn(i, numbits int) int {
	count := 0
	var bit uint64
	for bit = 0; bit < uint64(numbits); bit++ {
		t := 1 << bit
		if i&t > 0 {
			count++
		}
	}
	return count
}

type ints []int

func ToString(slice []int) string {
	format := fmt.Sprint(slice)
	return fmt.Sprint(format[1 : len(format)-1])
}

type String string

func reverseS(s []int) {
	for i := 0; i < len(s)/2; i++ {
		s[i], s[len(s)-1-i] = s[len(s)-1-i], s[i]
	}
}

func (s String) revese() string {
	b := []byte(s)
	for i := 0; i < len(b)/2; i++ {
		b[i], b[len(b)-1-i] = b[len(b)-1-i], b[i]
	}
	return string(b)
}
func contains(n int, slice []int) bool {
	for _, e := range slice {
		if e == n {
			return true
		}
	}
	return false
}


package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, k int
	fmt.Scan(&n, &k)
	var p = make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&p[i])
	}
	sort.Ints(p)
	sum := 0
	for i := 0; i < k; i++ {
		sum += p[i]
	}
	println(sum)
}


package main

import (
  "fmt"
  "sort"
)

func main(){
  var K, N int
  p:=[100]int{}
  fmt.Scan(&K)
  fmt.Scan(&N)
  for i:=0;i<N;i++{
    fmt.Scan(&p[i])
  }
  sort.Slice(p, func(i, j int) bool { return p[i] < p[j] })
  sum:=0
  for j:=0,j<K;j++ {
    sum+=p[j]
  }
  fmt.Println(sum)

}


package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, k int
	fmt.Scan(&n, &k)

	p := make([]int, n)
	for i := range p {
		fmt.Scan(&p[i])
	}

	sort.Ints(p

	var sum int
	for i := 0; i < k; i++ {
		sum += p[i]
	}

	fmt.Println(sum)
}


n, k = gets.chomp.split(" ").map(&:to_i)
P = gets.chomp.split(" ").map(&:to_i)

P.sort!
puts P[0,k].sum


n, k = gets.split(" ").map(&:to_i)
p = gets.split(" ").map(&:to_i).sort
puts p[0..k-1].sum


N, K = gets.split.map(&:to_i)
P = gets.split.map(&:to_i)
puts P.sort[0,K].sum


a,b=gets.chomp.split(" ").map(&:to_i)
c=gets.chomp.split(" ").map(&:to_i).sort
all=0
3.times do |i|
all+=c[i]
end
p all


N, K = gets.split.map(&:to_i)
fruits = gets.split.map {|p| p.to_i }.sort
puts fruits[0..K].inject(0){|result, sum| result + sum }


#![allow(unused_imports)]
#![allow(dead_code)]
#![allow(unused_mut)]
#![allow(non_camel_case_types)]

use crate::rust::libs::util::{io::*,lower_bound::*};
use crate::rust::libs::math::{mod_int::*,prime_factor::*};
use crate::rust::libs::data_structure::{union_find::*,segment_tree::*};
use crate::rust::libs::algebraic_structure::monoid::{plus::*,max::*,min::*};
use std::ops::Range;
use  std::collections::*;
const MOD: u32 = 1_000_000_007;
const INF:i64=1i64<<60;
const_mod!(P,MOD);
fn main() {
    input!{
        n:usize,k:usize,
        mut a:[usize;n],
    }
    a.sort();
    println!("{}",a[0..k].iter().sum::<usize>());
}

pub mod rust {

pub mod libs {

pub mod algebraic_structure {

pub mod monoid {

pub mod max {

use crate::rust::libs::algebraic_structure::monoid::monoid::Monoid;
use std::option::Option;
#[derive(Debug,Copy,Clone)]
pub struct Max<T>{
    val:Option<T>,
}
impl<T:Ord+Copy> Monoid for Max<T>{
    type MonoidType=T;
    fn new()->Self{
        Self{
            val:None,
        }
    }
    fn make(t:T)->Self{
        Self{
            val:Some(t),
        }
    }
    fn f(&self,t:&Self)->Self{
        if self.val.is_none() {*t}
        else if t.val.is_none() {*self}
        else{
            Self{
                val:Some(T::max(self.val.unwrap(),t.val.unwrap())),
            }
        }
    }
    fn get(self)->Option<T>{
        self.val
    }
}

}  // mod max

pub mod min {

use crate::rust::libs::algebraic_structure::monoid::monoid::Monoid;
use std::option::Option;
#[derive(Debug,Copy,Clone)]
pub struct Min<T>{
    val:Option<T>,
}
impl<T:Ord+Copy> Monoid for Min<T>{
    type MonoidType=T;
    fn new()->Self{
        Self{
            val:None,
        }
    }
    fn make(t:T)->Self{
        Self{
            val:Some(t),
        }
    }
    fn f(&self,t:&Self)->Self{
        if self.val.is_none() {*t}
        else if t.val.is_none() {*self}
        else{
            Self{
                val:Some(T::min(self.val.unwrap(),t.val.unwrap())),
            }
        }
    }
    fn get(self)->Option<T>{
        self.val
    }
}

}  // mod min

pub mod monoid {

pub trait Monoid{
    type MonoidType;
    fn new()->Self;
    fn make(t:Self::MonoidType)->Self;
    fn get(self)->Option<Self::MonoidType>;
    fn f(&self,t:&Self)->Self;
}

}  // mod monoid

pub mod plus {

use crate::rust::libs::algebraic_structure::monoid::monoid::Monoid;
use std::option::Option;
use std::ops::Add;
#[derive(Debug,Copy,Clone)]
pub struct Plus<T>{
    val:Option<T>,
}
impl<T:Add<T,Output=T>+Copy> Monoid for Plus<T>{
    type MonoidType=T;
    fn new()->Self{
        Self{
            val:None,
        }
    }
    fn make(t:T)->Self{
        Self{
            val:Some(t),
        }
    }
    fn f(&self,t:&Self)->Self{
        if self.val.is_none() {*t}
        else if t.val.is_none() {*self}
        else{
            Self{
                val:Some(self.val.unwrap()+t.val.unwrap()),
            }
        }
    }
    fn get(self)->Option<T>{
        self.val
    }
}

}  // mod plus

}  // mod monoid

}  // mod algebraic_structure

pub mod data_structure {

pub mod segment_tree {

use crate::rust::libs::algebraic_structure::monoid::monoid::Monoid;
use std::ops::Range;
pub struct SegmentTree<T>{
    n:usize,
    v:Vec<T>,
}

impl<T:Monoid+Copy+std::fmt::Debug> SegmentTree<T>where T::MonoidType:Copy{
    pub fn new(n:usize)->Self{
        Self{
            n:n,
            v:vec![T::new();n*2],
        }
    }
    pub fn make(v:&[T::MonoidType])->Self{
        let n=v.len();
        let mut tmp=vec![T::new();n*2];
        for i in 0..n{
            tmp[v.len()+i]=T::make(v[i]);
        }
        for i in (1..n).rev(){
            tmp[i]=tmp[i*2].f(&tmp[i*2+1]);
        }
        Self{
            n:n,
            v:tmp,
        }
    }
    pub fn get(&self,ran:Range<usize>)->Option<T::MonoidType>{
        let mut l=ran.start+self.n;
        let mut r=ran.end+self.n;
        let mut s=T::new();
        let mut t=T::new();
        while l<r{
            if (l&1)==1{s=s.f(&self.v[l]);l+=1;}
            if (r&1)==1{r-=1;t=self.v[r].f(&t);}
            l>>=1;r>>=1;
        }
        s.f(&t).get()
    }
    pub fn set(&mut self,t:usize,val:T::MonoidType){
        let mut tp=t+self.n;
        self.v[tp]=self.v[tp].f(&T::make(val));
        while tp>1{
            tp=tp>>1;
            self.v[tp]=self.v[tp*2].f(&self.v[tp*2+1]);
        }
    }
    pub fn out(self){
        println!("{:?}",self.v);
    }
}

}  // mod segment_tree

pub mod union_find {

pub struct UF{
    par:Vec<usize>,
    rank:Vec<usize>,
}
impl UF{
    pub fn new(n:usize)->UF{
        let mut v=vec![0;n];
        for i in 0..n{
            v[i]=i;
        }
        UF{
            par:v,
            rank:vec![1;n],
        }
    }
    pub fn root(&mut self,x:usize)->usize{
        if x==self.par[x]{
            x
        }else{
            let par=self.par[x];
            let res=self.root(par);
            self.par[x]=res;
            res
        }
    }
    pub fn same(&mut self,a:usize,b:usize)->bool{
        self.root(a)==self.root(b)
    }
    pub fn unite(&mut self,a:usize,b:usize)->bool{
        let ap=self.root(a);
        let bp=self.root(b);
        if ap==bp{
            return false;
        }
        if self.rank[ap]<self.rank[bp]{
            self.par[bp]=ap;
            self.rank[ap]+=self.rank[bp];
        }else{
            self.par[ap]=bp;
            self.rank[bp]+=self.rank[ap];
        }
        return true;
    }
    pub fn size(&mut self,a:usize)->usize{
        let ap=self.root(a);
        self.rank[ap]
    }
}

}  // mod union_find

}  // mod data_structure

pub mod math {

pub mod mod_int {

use std::ops::{Add,AddAssign,Sub,SubAssign,Mul,MulAssign,Div,DivAssign,Neg};
use std::str::FromStr;
use std::num::ParseIntError;
use std::iter::{Sum,Product};

pub fn inv_mod(a:u64,m:u64)->u64{
    let m=m as i64;
    let mut a=a as i64;
    let mut b=m as i64;
    let mut u=1i64;
    let mut v=0i64;
    while b>0 {
        let t=a/b;
        a-=t*b;
        u-=t*v;
        std::mem::swap(&mut a,&mut b);
        std::mem::swap(&mut u,&mut v);
    }
    let ans =(if u>=0{u%m}else{m+(u%m)%m})as u64;
    ans
}

pub trait Mod:Sized{
    fn m()->u32;
    fn m64()->u64;
    fn mi64()->i64;
}
#[macro_export]
macro_rules! const_mod{
    ($st:ident,$m:expr)=>{
        struct $st{}
        impl Mod for $st {
            fn m()->u32{$m}
            fn m64()->u64{$m as u64}
            fn mi64()->i64{$m as i64}
        }
        //const MAX=10000000;
        type Fp=ModInt<P>;
        //const fact_table:[Fp;MAX]=(0..MAX)
    }
}
pub struct ModInt<M:Mod>{a:u32,_p:std::marker::PhantomData<M>}

impl<M: Mod> ModInt<M>{
    pub fn new(a:u32)->Self{
        ModInt{a,_p:std::marker::PhantomData}
    }
    pub fn newu64(a:u64)->Self{
        ModInt{a:(a%M::m64())as u32,_p:std::marker::PhantomData}
    }
    pub fn newi64(a:i64)->Self{
        ModInt{a:((a%M::mi64()+M::mi64())%M::mi64()) as u32,_p:std::marker::PhantomData}
    }
    pub fn value(&self)->u32{self.a}
    pub fn pow(&self,p:u64)->Self{
        let mut exp=p;
        let mut now=*self;
        let mut ans=ModInt::new(1);
        while exp>0{
            if (exp&1)==1{ans*=now;}
            now*=now;
            exp>>=1;
        }
        ans
    }
    // pub fn comb(k:i32)->Self{
    //     Self::new(k)
    // }
    pub fn inv(&self)->Self{Self::new(inv_mod(self.a as u64,M::m64())as u32)}
}

impl<M:Mod>Clone for ModInt<M>{
    fn clone(&self)->Self{ModInt::new(self.a)}
}
impl<M:Mod>Copy for ModInt<M>{}
impl<M:Mod>From<i64>for ModInt<M>{
    fn from(i:i64)->Self{Self::newi64(i)}
}
impl<M:Mod>From<i32>for ModInt<M>{
    fn from(i:i32)->Self{Self::newi64(i as i64)}
}

impl<M:Mod>FromStr for ModInt<M>{
    type Err = ParseIntError;
    fn from_str(i:&str)->Result<Self, Self::Err>{
        let res=i.parse::<i64>()?;
        Ok(Self::newi64(res))
    }
}
impl<M:Mod>Sum for ModInt<M>{
    fn sum<I>(iter: I) -> Self where I: Iterator<Item = Self>,{
        iter.fold(Self::new(0), |b, i| b + i)
    }
}

impl<M:Mod>Product for ModInt<M>{
    fn product<I>(iter: I) -> Self where I: Iterator<Item = Self>,{
        iter.fold(Self::new(0), |b, i| b * i)
    }
}
impl<M:Mod>Add for ModInt<M>{
    type Output=Self;
    fn add(self,rhs:Self)->Self{
        let a=self.a+rhs.a;
        ModInt::new(if a>=M::m(){a-M::m()}else{a})
    }
}
impl<M:Mod>Sub for ModInt<M>{
    type Output=Self;
    fn sub(self,rhs:Self)->Self{
        ModInt::new(if self.a<rhs.a{M::m()+self.a-rhs.a}else{self.a-rhs.a})
    }
}
impl<M:Mod>Mul for ModInt<M>{
    type Output=Self;
    fn mul(self,rhs:Self)->Self{
        ModInt::newu64(self.a as u64*rhs.a as u64)
    }
}
impl<M:Mod>Div for ModInt<M>{
    type Output=Self;
    fn div(self,rhs:Self)->Self{
        self*rhs.inv()
    }
}
impl<M:Mod>Neg for ModInt<M> {
    type Output = Self;
    fn neg(self) -> Self {
        ModInt::new(M::m()-self.value())
    }
}
impl<M:Mod>AddAssign for ModInt<M>{fn add_assign(&mut self,rhs:Self){*self=*self+rhs;}}
impl<M:Mod>SubAssign for ModInt<M>{fn sub_assign(&mut self,rhs:Self){*self=*self-rhs;}}
impl<M:Mod>MulAssign for ModInt<M>{fn mul_assign(&mut self,rhs:Self){*self=*self*rhs;}}
impl<M:Mod>DivAssign for ModInt<M>{fn div_assign(&mut self,rhs:Self){*self=*self/rhs;}}

impl<M:Mod>std::fmt::Debug for ModInt<M>{
    fn fmt(&self,f:&mut std::fmt::Formatter)->Result<(),std::fmt::Error>{
        write!(f,"M{}",self.a)
    }
}
impl<M:Mod> std::fmt::Display for ModInt<M> {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
        self.value().fmt(f)
    }
}

}  // mod mod_int

pub mod prime_factor {

use std::collections::BTreeMap;
pub fn prime_factor(n:usize)->BTreeMap<usize,usize>{
    let mut ret:BTreeMap<usize,usize>=BTreeMap::<usize,usize>::new();
    let mut m=n;
    let mut i=2;
    while i*i<=m {
        while m%i==0{
            let tmp=ret.entry(i).or_insert(0);
            *tmp+=1;
            m/=i;
        }
        i+=1;
    }
    ret
}

}  // mod prime_factor

}  // mod math

pub mod util {

pub mod io {

#[macro_export]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[macro_export]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export]
macro_rules! read_value {
    ($iter:expr, [tree;$len:expr]) => {
        {
            let mut g:Vec<Vec<usize>>=vec![Vec::new();$len];
            for (s,t) in read_value!($iter,[(usize1,usize1);$len-1]){
                g[s].push(t);
                g[t].push(s);
            }
            g
        }
    };
    ($iter:expr, [graph;$vertex:expr,$edge:expr]) => {
        {
            let mut g:Vec<Vec<usize>>=vec![Vec::new();$vertex];
            for (s,t) in read_value!($iter,[(usize1,usize1);$edge]){
                g[s].push(t);
                g[t].push(s);
            }
            g
        }
    };
    ($iter:expr, [directed;$vertex:expr,$edge:expr]) => {
        {
            let mut g:Vec<Vec<usize>>=vec![Vec::new();$vertex];
            for (s,t) in read_value!($iter,[(usize1,usize1);$edge]){
                g[s].push(t);
            }
            g
        }
    };
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

}  // mod io

pub mod lower_bound {

pub trait LowerBound<T> {
    fn lower_bound(&self,v:T)->usize;
}

impl<T:Ord> LowerBound<T> for Vec<T>{
    fn lower_bound(&self,x:T)->usize{
        let mut l:usize=0;
        let mut r:usize=self.len()+1;
        while r-l>1{
            let m=(l+r)/2;
            if self[m-1]<x {l=m;}
            else {r=m;}
        }
        r-1
    }
}
pub trait UpperBound<T> {
    fn upper_bound(&self,v:T)->usize;
}

impl<T:Ord> UpperBound<T> for Vec<T>{
    fn upper_bound(&self,x:T)->usize{
        let mut l:usize=0;
        let mut r:usize=self.len()+1;
        while r-l>1{
            let m=(l+r)/2;
            if self[m-1]<=x {l=m;}
            else {r=m;}
        }
        r-1
    }
}

}  // mod lower_bound

}  // mod util

}  // mod libs

}  // mod rust


use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        k: usize,
        mut p: [i32; n],
    }

    p.sort();
    let ans: i32 = p.iter().take(k).sum();

    println!("{}", ans);
}


macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

// fn minus(a: Vec<isize>, b:Vec<isize>) -> Vec<isize> {
//     let mut z = vec![0,0,0];
//     for (i, (aval, bval)) in a.iter().zip(&b).enumerate() {
//         z[i] = aval - bval;
//     }
//     z
// }

fn main() {
    input! {
        // s: char
      n: usize,
      k: usize,
      p: [usize; n]
    }
    let mut p2 = p;
    let mut count = 0;
    p2.sort();
    for (idx, i) in p2.iter().enumerate(){
        if idx == k{
            break;
        }
        count += i;
    }
    println!("{}", count)
}


use proconio::input;
use itertools::Itertools;

fn main() {
    input!{n: u16, k:  usize};
    input!(ps: [u16; n]);
    let res = ps.into_iter()
                .sorted()
                .take(k)
                .sum::<u16>();
    print!("{}", res);
}


use text_io::*;fn main(){let n=read!();let k=read!();let mut v=Vec::new();for i in 0..n{let c=read!();v.push(c);}v.sort();let mut a=0;for i in 0..k{a+=v[i];}println!("{}",a)}


use proconio::{fastout, input};
#[fastout]
fn main() {
  input! {N:u16,K:usize,mut p:[u16;N]}
  p.sort();
  println!("{}",p[0..K].iter().sum::<u16>());
}


let input = readLine()!.split(separator: " ").map { Int($0)! }
let N = input[0]
let K = input[1]

let p = readLine()!.split(separator: " ").map { Int($0)! }
print(p.sorted().prefix(K).reduce(0, +))


import Foundation
var o = 0
let arr=readLine()!.split{$0==" "}.map{Int(String($0))!}
let n=arr[0]
let a=arr[1]
var arr2=readLine()!.split{$0==" "}.map{Int(String($0))!}
arr2.sort()
for i in 0..<a {
   o += arr2[i]
}
print(o)


import Foundation
let main: () = {
    let (N, K) = *listOfInt()
    let P = listOfInt().sorted()
    let Q = P.prefix(K)
    var ans = 0
    for q in Q {
        ans += q
    }
    print(ans)
}()

struct SimpleModInt {
    let MOD = 998244353
    var value: Int {
        didSet {
            value %= MOD
        }
    }
    init(_ initialValue: Int) {
        value = initialValue
        value %= MOD
    }
    init(_ initialValue: SimpleModInt) {
        value = initialValue.value
        value %= MOD
    }
}
infix operator <-: AssignmentPrecedence
extension SimpleModInt {
    static func + (left: SimpleModInt, right: Int) -> SimpleModInt { SimpleModInt(left.value + right) }
    static func + (left: SimpleModInt, right: SimpleModInt) -> SimpleModInt { SimpleModInt(left.value + right.value) }
    static func - (left: SimpleModInt, right: Int) -> SimpleModInt { SimpleModInt(left.value - right) }
    static func - (left: SimpleModInt, right: SimpleModInt) -> SimpleModInt { SimpleModInt(left.value - right.value) }
    static func * (left: SimpleModInt, right: Int) -> SimpleModInt { SimpleModInt(left.value * right) }
    static func * (left: SimpleModInt, right: SimpleModInt) -> SimpleModInt { SimpleModInt(left.value * right.value) }
    static func <- (left: inout SimpleModInt, right: Int) { left.value = right }
    static func <- (left: inout SimpleModInt, right: SimpleModInt) { left.value = right.value }
    static func += (left: inout SimpleModInt, right: Int) { left.value += right }
    static func += (left: inout SimpleModInt, right: SimpleModInt) { left.value += right.value }
    static func -= (left: inout SimpleModInt, right: Int) { left.value -= right }
    static func -= (left: inout SimpleModInt, right: SimpleModInt) { left.value -= right.value }
    static func *= (left: inout SimpleModInt, right: Int) { left.value *= right }
    static func *= (left: inout SimpleModInt, right: SimpleModInt) { left.value *= right.value }
    static func == (left: SimpleModInt, right: Int) -> Bool { left.value == SimpleModInt(right).value }
    static func == (left: SimpleModInt, right: SimpleModInt) -> Bool { left.value == right.value }
    static func != (left: SimpleModInt, right: Int) -> Bool { left.value != SimpleModInt(right).value }
    static func != (left: SimpleModInt, right: SimpleModInt) -> Bool { left.value != right.value }
}

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

let dx = [1, 0, -1, 0] //[1, 0, -1, 0, -1,  1, -1, 1]
let dy = [0, 1, 0, -1] //[0, 1, 0, -1, -1, -1,  1, 1]

@inlinable func gcd(_ a: Int, _ b: Int) -> Int { (b > 0) ? gcd(b, a % b) : a }
@inlinable func lcm(_ a: Int, _ b: Int) -> Int { a / gcd(a, b) * b }

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

infix operator  =~ : ComparisonPrecedence
infix operator !=~ : ComparisonPrecedence
func =~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { !(right ~= left) }
func =~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { !(right ~= left) }

func =~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { right.contains(left) }
func !=~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { !right.contains(left) }

infix operator /^ : MultiplicationPrecedence
infix operator /^= : AssignmentPrecedence
func /^ <T: FixedWidthInteger>(left: T, right: T) -> T { (left + (right - 1)) / right }
func /^= <T: FixedWidthInteger>(left: inout T, right: T) { left = (left + (right - 1)) / right }

@inlinable func chmax<T: Comparable>(_ m: inout T, _ q: T) { if (m < q) { m = q } }
@inlinable func chmin<T: Comparable>(_ m: inout T, _ q: T) { if (m > q) { m = q } }
@inlinable func chRmax<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m < q) { m = q; return true } else { return false } }
@inlinable func chRmin<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m > q) { m = q; return true } else { return false } }

prefix operator *
prefix func * <T> (a: [T]) -> (T, T) { (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T) { (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T) { (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4], a[5]) }

func printErr(_ str: String, terminator: String = "\n") {
    let s = str + terminator
    FileHandle.standardError.write(s.data(using: .utf8)!)
    FileHandle.standardError.synchronizeFile()
}

@inlinable func next() -> String { readLine()! }
@inlinable func nextInt() -> Int { Int(next())! }
@inlinable func nextDouble() -> Double { Double(next())! }
@inlinable func listOfString() -> [String] { next().split(separator: " ").map(String.init) }
@inlinable func listOfInt() -> [Int] { listOfString().map { Int($0)! } }
@inlinable func listOfInt(_ offset: Int = 0) -> [Int] { listOfString().map { Int($0)! + offset } }
@inlinable func listOfInt(_ offsets: Int ...) -> [Int] { listOfString().enumerated().map { Int($0.element)! + offsets[$0.offset % offsets.count] } }
@inlinable func listOfDouble(_ offset: Double = 0.0) -> [Double] { listOfString().map { Double($0)! + offset } }
@inlinable func listOfDouble(_ offsets: Double ...) -> [Double] { listOfString().enumerated().map { Double($0.element)! + offsets[$0.offset % offsets.count] } }

extension Int {
    init(s: String) { self.init(s)! }
    var isEven: Bool { self.isMultiple(of: 2) }
    var isOdd: Bool { !self.isEven }
    var isTrue: Bool { self != 0 }
    var isFalse: Bool { !self.isTrue }
    var toString: String { String(self) }
    var toChar: Character { Character(UnicodeScalar(UInt8(self))) }
}
func + (left: Int, right: Bool) -> Int { left + (right ? 1 : 0) }
extension Character {
    var asciiCode: Int { Int(self.asciiValue!) }
    var string: String { String(self) }
}
extension String {
    @inlinable subscript (position: Int) -> Character { self[self.index(self.startIndex, offsetBy: position)] }
    @inlinable func repeate(_ times: Int) -> String { String(repeating: self, count: times) }
    //  @inlinable subscript (n: Int) -> String { String(self[self.index(self.startIndex, offsetBy: n)]) }
    //  @inlinable subscript (n: Int) -> Int { Int(self[self.index(self.startIndex, offsetBy: n)].asciiValue!) }
    var toInt: Int { Int(self)! }
}
extension String { // VB like
    @inlinable func _index(_ position: Int) -> String.Index! {
        if !(0 ..< self.count ~= position) { return nil }
        return self.index(self.startIndex, offsetBy: position)
    }
    @inlinable func mid(from index: Int, length: Int) -> String! {
        if let startPosition = self._index(index) {
            if let endPosition = self._index(index + length - 1) {
                return String(self[startPosition...endPosition])
            } else {
                let endPosition = self.index(before: self.endIndex)
                return String(self[startPosition...endPosition])
            }
        }
        return ""
    }
    @inlinable func left(_ length: Int) -> String { String(self.prefix(length)) }
    @inlinable func right(_ length: Int) -> String { String(self.suffix(length)) }
}

extension Dictionary {
    @inlinable mutating func getOrSet(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored }
        else {
            let newValue = defaultValue()
            self[key] = newValue
            return newValue
        }
    }
    @inlinable mutating func getOrElse(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored } else { return defaultValue() }
    }
    @inlinable func containsKey(_ key: Key) -> Bool { self.keys.contains(key) }
}

extension Set {
    static func += (left: inout Set<Element>, right: Element) { left.insert(right) }
    static func -= (left: inout Set<Element>, right: Element) { left.remove(right) }
}

extension Array {
    static func += (left: inout Array<Element>, right: Element) { left.append(right) }
    init(_ size: Int, _ initValue: ((Int) -> Element)) {
        self = [Element]()
        for index in 0 ..< size {
            let value = initValue(index)
            self.append(value)
        }
    }
    init(_ size: Int, _ initValue: (() -> Element)) {
        self = [Element]()
        for _ in 0 ..< size {
            let value = initValue()
            self.append(value)
        }
    }
}
typealias IntArray = Array<Int>
typealias DoubleArray = Array<Double>
typealias BoolArray = Array<Bool>
typealias StringArray = Array<String>

extension Array where Element == Int {
    init(_ size: Int) {
        self = [Element](repeating: 0, count: size)
    }
}
extension Array where Element == Double {
    init(_ size: Int) {
        self = [Element](repeating: 0.0, count: size)
    }
}
extension Array where Element == Bool {
    init(_ size: Int) {
        self = [Element](repeating: false, count: size)
    }
}
extension Array where Element == String {
    init(_ size: Int) {
        self = [Element](repeating: "", count: size)
    }
}

extension Array {
    @inlinable func count(_ predicate: ((Element) -> Bool)) -> Int {
        var cnt = 0; for e in self { if (predicate(e)) { cnt += 1 } }
        return cnt
    }
    @inlinable func groupBy<K>(_ keySelector: (Element) -> K) -> [K : [Element]] {
        var destination = [K : [Element]]()
        for element in self {
            let key = keySelector(element)
            var list = destination.getOrSet(key) { [Element]() }
            list.append(element)
            destination[key] = list
        }
        return destination
    }
    @inlinable func groupByIndexed<K>(_ keySelector: (Element) -> K) -> [K : [Int]] {
        var destination = [K : [Int]]()
        for element in self.enumerated() {
            let key = keySelector(element.element)
            var list = destination.getOrSet(key) { [Int]() }
            list.append(element.offset)
            destination[key] = list
        }
        return destination
    }
}

extension Array {
    func binarySearch(_ element: Element, by compare: (Element, Element) -> Int, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            let cmp = compare(midVal, element)
            if (cmp < 0) { low = mid + 1 }          //-1
            else if (0 < cmp) { high = mid - 1 }    // 1
            else { return mid } // key found        // 0
        }
        return -(low + 1)  // key not found
    }
}
extension Array where Element : Comparable {
    func binarySearch(_ element: Element, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            if (midVal < element) { low = mid + 1 }
            else if (midVal > element) { high = mid - 1 }
            else { return mid } // key found
        }
        return -(low + 1)  // key not found
    }
}

extension Array where Element == Int {
    @inlinable func distinct() -> [Element] {
        var set = Set<Element>(), ary = [Element]()
        for n in self.indices { if !set.contains(self[n]) { ary.append(self[n]); set.insert(self[n]) } }
        return ary
    }
    @inlinable func any(_ predicate: (Element) -> Bool) -> Bool {
        var any = false; for element in self { if predicate(element) { any = true } }
        return any
    }
    @inlinable func all(_ predicate: (Element) -> Bool) -> Bool {
        self.allSatisfy(predicate)
    }
    @inlinable func sum() -> Element { self.reduce(0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}

extension Array where Element == Double {
    @inlinable func sum() -> Element { self.reduce(0.0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0.0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}
extension Array where Element == String {
    @inlinable func toIntDouble() -> (Int, Double) { (Int(self[0])!, Double(self[1])!) }
    @inlinable func toIntString() -> (Int, String) { (Int(self[0])!, self[1]) }
    @inlinable func toIntIntString() -> (Int, Int, String) { (Int(self[0])!, Int(self[1])!, self[2]) }
}

@inlinable func block( _ action: () -> Void) {
    action()
}
@inlinable func repeate(_ times1: Int, _ action: () -> Void) {
    for _ in 0 ..< times1 { action() }
}
@inlinable func repeate(_ times1: Int, _ action: (Int) -> Void) {
    for index1 in 0 ..< times1 {
        action(index1)
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ action: (Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            action(index1, index2)
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ action: (Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                action(index1, index2, index3)
            }
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ times4: Int, _ action: (Int, Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                for index4 in 0 ..< times4 {
                    action(index1, index2, index3, index4)
                }
            }
        }
    }
}

func measureTimeSeconds(block: (() -> Void)) -> Double {
    let startTime = Date()
    block()
    let duration = -startTime.timeIntervalSinceNow
    return duration
}


import Foundation

var type: Int = Int(readLine()!)!
var min: Int = Int(readLine()!)!
var priceList: [Int] = []
var price = 0
var count = 0

while (count < type) {
    priceList.append(Int(readLine()!)!)
    count += 1
}

priceList.sort {$0 < $1}
for i in 0 ... min - 1 {
    price += priceList[i]
}

print(price)


import Foundation

var type: Int = Int(readLine()!)!
var min: Int = Int(readLine()!)!
var priceList: [Int] = []
var price = 0

for _ in 0 ..< type {
    priceList.append(Int(readLine()!)!)
}

priceList.sort {$0 < $1}
for j in 0 ... min - 1 {
    price += priceList[j]
}

print(price)


import Foundation

var type: Int = Int(readLine()!)!
var min: Int = Int(readLine()!)!
var priceList: [Int] = []
var price = 0

for i in 0 ..< type {
    priceList.append(Int(readLine()!)!)
}

priceList.sort {$0 < $1}
for j in 0 ... min - 1 {
    price += priceList[j]
}

print(price)


import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [N, K] = input[0].map(Number);
  const prices = input[1].map(Number).sort((a, b) => a - b);

  const buy = prices.slice(0, K);

  return buy.reduce((result, cur) => {
    return result + cur;
  }, 0);
};

console.log(main(read()));


import * as fs from "fs";

// inputで受け取り配列化する
const input = fs.readFileSync("/dev/stdin", "utf8").split("\n");

const [N, K] = input[0].split(" ");

const prices = input[1].split(" ").map(Number);

prices.sort((a, b) => a - b);

let sum = 0;

for (let index = 0; index < Number(K); index++) {
  sum += prices[index];
}

console.log(sum);


export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const [n, k]: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    const p: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    return `${p.slice(0, n).sort((a, b) => a - b).slice(0, k).reduce((acc, a) => acc + a, 0)}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));


const main = (input: string) => {
    const inputs: string[] = input.split('\n');
    const [N, K] = inputs[0].split(' ').map(x => parseInt(x));
    const fruits = inputs[1].split(' ').map(x => parseInt(x));

    fruits.sort((a, b) => (
        a - b
    ));
    console.log(fruits[0] + fruits[1] + fruits[2]);
};
// 標準入力
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


import * as fs from 'fs';

const input = fs.readFileSync("/dev/stdin", "utf8");

const [, kindsToBuy, ...prices] = input.split(/\s/g).map(i => parseInt(i, 10));
const lowestPrices = prices.sort((a, b) => a >= b ? 1 : -1).slice(0, kindsToBuy);
const totalPrice = lowestPrices.reduce((acc, crr) => acc+crr, 0);
console.log(totalPrice);


import * as fs from 'fs';

const input = fs.readFileSync("/dev/stdin", "utf8");

const [, kindsToBuy, ...prices] = input.split(/\s/g).map(i => parseInt(i, 10));
const lowestPrices = prices.slice().sort((a, b) => a >= b ? 1 : -1).slice(0, kindsToBuy);
const totalPrice = lowestPrices.reduce((acc, crr) => acc+crr, 0);
console.log(totalPrice);


s,w = map(int,input().split())

if s <= w:
    print('unsafe')
else:
    print('safe')


import sys
def ISI(): return map(int, sys.stdin.readline().rstrip().split())

s, w =ISI()
if s>w:
	print("safe")
else:
	print("unsafe")


s, w = map(int, input().split())
if s > w:
    print('safe')
else:
    print('unsafe')


s = int(input())
w = int(input())
if(w >= s):
    print("unsafe")
else:
    print("safe")


import Control.Monad

main = do
    xs <- (map read . words) <$> getLine :: IO [Int]
    let s = xs !! 0
        w = xs !! 1
    if s <= w then putStrLn "unsafe"
              else putStrLn "safe"


//package beginner164.a;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

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

    static class TaskA {
        public void solve(long testNumber, InputReader in, PrintWriter out) {
            int sheep = in.nextInt();
            int wolves = in.nextInt();
            if (wolves >= sheep) {
                out.println("unsafe");
            } else {
                out.println("safe");
            }
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

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

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

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

    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Supplier;

class GenericClass<T> {
    private final Class<T> type;
    public GenericClass() {
        ParameterizedType superClass = (ParameterizedType) getClass().getGenericSuperclass();
        Class<T> type = (Class<T>) superClass.getActualTypeArguments()[0];
        System.out.println(type);
        this.type = type;
    }

    public Class<T> getMyType() {
        return this.type;
    }
}

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 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 class Main {
    final static long MOD07 = 1_000_000_007;
    final static long MOD09 = 1_000_000_009;

    public static void main(String[] args) {
        final FastScanner fs = new FastScanner();
        int S = fs.nextInt();
        int W = fs.nextInt();

        PrintWriter out = new PrintWriter(System.out);

        if (W >= S) {
            out.println("unsafe");
        } else {
            out.println("safe");
        }
        out.flush();
    }

    static void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    // Execute func for all patterns can be represented with n bit.
    // O(n2^n)
    static void forAllBit(int n, Consumer<List<Boolean>> func) {
        for (int i = 0; i < (1 << n); i++) {
            List<Boolean> arg = new ArrayList();
            for (int j = 0; j < n; j++) {
                boolean isJthBitSet = ((i >> j) & 1) == 1;
                arg.add(isJthBitSet);
            }
            func.accept(arg);
        }
    }

    private static boolean nextPermutation(int[] arr) {
        // Find the start index of descending part.
        int descendingStart = -1;

        int previous = Integer.MIN_VALUE;
        for (int i = arr.length-1; i>=0; i--) {
            if (arr[i] >= previous ) {
                descendingStart = i;
            } else {
                break;
            }
            previous = arr[i];
        }

        if (descendingStart == 0) {
            return false;
        }

        int target = arr[descendingStart - 1];
        int swapIndex = descendingStart;
        for (int i = descendingStart; i < arr.length;i++) {
            if (arr[i] > target) {
                swapIndex = i;
            }
        }

        swap(arr, descendingStart - 1, swapIndex);
        reverse(arr, descendingStart, arr.length -1);
        return true;
    }

    private static void reverse(int[] arr, int from, int to) {
        while (from < to) {
            swap(arr, from, to);
            from++;
            to--;
        }
    }

    private static void swap(int[] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }

    static class Pair<F extends Comparable<F>, S extends Comparable<S>> implements Comparable<Pair<F, S>> {
        F f;
        S s;

        Pair() {
        }

        Pair(F f, S s) {
            this.f = f;
            this.s = s;
        }

        Pair(Pair<F, S> p) {
            f = p.f;
            s = p.s;
        }

        @Override
        public int compareTo(Pair<F, S> p) {
            if (f.compareTo(p.f) != 0) {
                return f.compareTo(p.f);
            }
            return s.compareTo(p.s);
        }

        @Override
        public int hashCode() {
            return f.hashCode() ^ s.hashCode();
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || this.f == null || this.s == null) {
                return false;
            }
            if (this.getClass() != o.getClass()) {
                return false;
            }
            Pair p = (Pair) o;
            return this.f.equals(p.f) && this.s.equals(p.s);
        }

        @Override
        public String toString() {
            return "{" + f.toString() + ", " + s.toString() + "}";
        }
    }

    public static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static boolean isPrime(int n) {
        for (int i = 2; i <= ((int) Math.sqrt(n)); i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return n != 1;
    }

    public static void reverse(int[] array) {
        for (int i = 0; i < array.length / 2; i++) {
            int temp = array[i];
            array[i] = array[array.length - i - 1];
            array[array.length - i - 1] = temp;
        }
    }

    public static void reverse(long[] array) {
        for (int i = 0; i < array.length / 2; i++) {
            long temp = array[i];
            array[i] = array[array.length - i - 1];
            array[array.length - i - 1] = temp;
        }
    }

    public static boolean isPrime(long n) {
        for (long i = 2; i <= ((long) Math.sqrt(n)); i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return n != 1;
    }

    public static Map<Long, Long> primeFactor(long n) {
        Map<Long, Long> map = new HashMap<>();
        long num = n;
        for (long i = 2; i <= ((long) Math.sqrt(n)); i++) {
            while (num % i == 0L) {
                map.put(i, map.getOrDefault(i, 0L) + 1L);
                num /= i;
            }
        }
        if (num != 1) {
            map.put(num, 1L);
        }

        return map;
    }

    public static List<Long> divisors(long n) {
        List<Long> list = new ArrayList<>();
        for (long i = 1; i <= ((long) Math.sqrt(n)); i++) {
            if (n % i == 0) {
                list.add(i);
                if (i != n / i) {
                    list.add(n / i);
                }
            }
        }

        return list;
    }

    public static int lcm(int a, int b) {
        return a / gcd(a, b) * b;
    }

    public static int nCk(int n, int k, int M) {
        long ret = 1;
        int min = Math.min(k, n - k);
        for (int i = 1; i <= min; i++) {
            ret = (ret * pow(i, M - 2, M)) % M;
        }
        for (int i = n - min + 1; i <= n; i++) {
            ret = (ret * i) % M;
        }
        return (int) ret;
    }

    //return a^b mod M O(logB)
    public static long pow(long a, long b, int M) {
        long ret = 1;
        long tmp = a;
        while (b > 0) {
            if ((b & 1) == 1) ret = (ret * tmp) % M;
            tmp = (tmp * tmp) % M;
            b = b >> 1;
        }
        return ret;
    }

    public static int find(int[] tree, int idx) {
        if (tree[idx] == idx) return idx;
        else return tree[idx] = find(tree, tree[idx]);
    }

    public static void union(int[] tree, int idx1, int idx2) {
        int root1 = find(tree, idx1);
        int root2 = find(tree, idx2);
        tree[root2] = root1;
    }

    public static int lowerBound(int[] list, int target) {
        int ok = list.length;
        int ng = -1;
        while (Math.abs(ok - ng) > 1) {
            int mid = (ok + ng) / 2;
            if (list[mid] >= target) {
                ok = mid;
            } else {
                ng = mid;
            }
        }
        return ok;
    }

    public static int lowerBound(long[] list, long target) {
        int ok = list.length;
        int ng = -1;
        while (Math.abs(ok - ng) > 1) {
            int mid = (ok + ng) / 2;
            if (list[mid] >= target) {
                ok = mid;
            } else {
                ng = mid;
            }
        }
        return ok;
    }

    public static <T extends Comparable<? super T>> int lowerBound(List<T> list, T target) {
        return ~Collections.binarySearch(list, target, (x, y) -> (x.compareTo(y) >= 0) ? 1 : -1);
    }

    public static <T extends Comparable<? super T>> int upperBound(List<T> list, T target) {
        return ~Collections.binarySearch(list, target, (x, y) -> (x.compareTo(y) > 0) ? 1 : -1);
    }
}

class BIT<T> {
    int n;
    ArrayList<T> bit;
    BiFunction<T, T, T> bif;

    /**
     * 1-indexed なBinary Indexed Treeを構築する
     *
     * @param n   容量
     * @param bif 適用させる関数
     * @param sup 初期値
     */
    BIT(int n, BiFunction<T, T, T> bif, Supplier<T> sup) {
        this.n = n;
        bit = new ArrayList<>(n + 1);
        for (int i = 0; i < n + 1; ++i) {
            bit.add(sup.get());
        }
        this.bif = bif;
    }

    /**
     * iの位置の値をvで更新する
     *
     * @param i index
     * @param v 新しい値
     */
    void set(int i, T v) {
        for (int x = i; x <= n; x += x & -x) {
            bit.set(x, bif.apply(bit.get(x), v));
        }
    }

    /**
     * クエリー
     *
     * @param defaultValue 初期値
     * @param i            index
     * @return [1, i]までfを適用した結果
     */
    T reduce(T defaultValue, int i) {
        T ret = defaultValue;
        for (int x = i; x > 0; x -= x & -x) {
            ret = bif.apply(ret, bit.get(x));
        }
        return ret;
    }
}

class SegmentTree<T> {
    int n;
    ArrayList<T> dat;
    BiFunction<T, T, T> bif;
    Supplier<T> sup;

    /**
     * 0-indexed なSegment Treeを構築する
     *
     * @param n_  要求容量
     * @param bif 適用させる関数
     * @param sup 初期値
     */
    SegmentTree(int n_, BiFunction<T, T, T> bif, Supplier<T> sup) {
        n = 1;
        while (n < n_) n *= 2;

        dat = new ArrayList<>(2 * n - 1);
        for (int i = 0; i < 2 * n - 1; ++i) {
            dat.add(sup.get());
        }
        this.bif = bif;
        this.sup = sup;
    }

    /**
     * kの位置の値をvで更新する
     *
     * @param k index
     * @param v 新しい値
     */
    void set(int k, T v) {
        k += n - 1;
        dat.set(k, v);
        while (k > 0) {
            k = (k - 1) / 2;
            dat.set(k, bif.apply(dat.get(k * 2 + 1), dat.get(k * 2 + 2)));
        }
    }

    /**
     * クエリー
     *
     * @param l はじめ
     * @param r おわり
     * @return [l, r)での演算bifを適用した結果を返す
     */
    T reduce(int l, int r) {
        return _reduce(l, r, 0, 0, n);
    }

    T _reduce(int a, int b, int k, int l, int r) {
        if (r <= a || b <= l) return sup.get();
        if (a <= l && r <= b) return dat.get(k);
        T vl = _reduce(a, b, k * 2 + 1, l, (l + r) / 2);
        T vr = _reduce(a, b, k * 2 + 2, (l + r) / 2, r);
        return bif.apply(vl, vr);
    }
}

class UnionFind {
    int[] par;

    UnionFind(int n) {
        par = new int[n];
        for (int i = 0; i < n; ++i) {
            par[i] = i;
        }
    }

    int find(int x) {
        if (par[x] == x) {
            return x;
        }
        return par[x] = find(par[x]);
    }

    boolean same(int x, int y) {
        return find(x) == find(y);
    }

    void union(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y) {
            return;
        }
        par[x] = y;
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author EDGE
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ASheepAndWolves solver = new ASheepAndWolves();
        solver.solve(1, in, out);
        out.close();
    }

    static class ASheepAndWolves {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            out.println(in.nextInt() > in.nextInt() ? "safe" : "unsafe");
        }

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader(InputStream inputStream) {
            br = new BufferedReader(new
                    InputStreamReader(inputStream));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

    }
}


import java.util.*;

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

        int a = sc.nextInt();
        int b = sc.nextInt();

        if(a<b){
            System.out.println("unsafe");
        }else{
            System.out.println("safe");
        }

   }
}


package saichan;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int S = sc.nextInt();
int W = sc.nextInt();
//コンソールに入力した数字を受け取る
if(S>W) {
	System.out.println("safe");
}else {
	System.out.println("unsafe");
}
}
}


import java.util.ArrayList;
import java.util.Scanner;
public class Main {
    public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<String>ans  = new ArrayList<>();

    for(int i=0; i<n; i++) {
    	String s = sc.next();
    	if(!ans.contains(s)){
    	      ans.add(s);
    	}
    }
    	System.out.println(ans.size());
      }
}


#include <cstdio>
#include <cstdint>
#include <algorithm>
#include <string>

int main() {
  int s, w;
  scanf("%d %d", &s, &w);

  if (s <= w) {
    puts("unsafe");
  } else {
    puts("safe");
  }
}


#pragma GCC optimize("Ofast")
#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
	int a,b;
	scanf("%d%d",&a,&b);
	if(b>=a)
		puts("unsafe");
	else
		puts("safe");
}


#include<cstdio>

int main()
{
	int s,w;
	scanf("%d %d",&s,&w);
	if ( w>=s )
	printf("unsafe\n");
	else
	printf("safe\n");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    set<string>s;
 for(int i=0;i<n;i++)
 {
 string t;
 cin>>t;
 s.insert(t);
 }
 cout<<s.size()<<endl;
 return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int s,w;
    cin>>s,w;
    if(w>=s)
    cout<<"unsafe"<<endl;
    else
    cout<<"safe"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int s,w;
    cin>>s,w;
    if(s>=w)
    cout<<"unsafe"<<endl;
    else
    cout<<"safe"<<endl;
    return 0;
}


#include <stdio.h>

int main(void)
{
    int s, w;
    scanf("%d %d", &s, &w);

    if (s > w)
        printf("safe\n");
    else
    {
        printf("unsafe\n");
    }

    return 0;
}


#include<stdio.h>
#include<math.h>
#include<string.h>

int main()
{
	int S, W;
	scanf("%d %d", &S, &W);

	if(S>W) printf("safe");
	else printf("unsafe");

	return 0;

}


#include <stdio.h>
int main(void){
    int s,w;
    scanf("%d %d",&s,&w);
    if(w>=s)
        printf("unsafe");
    else
        printf("safe");
}


#include<stdio.h>
int main()
{ int s,w;
 scanf("%d %d", &s, &w);
if (s>0 && w>0 && s<=w)
 {printf ("Unsafe");}
else if (s>0 && w>0 && s>w)
{printf("Safe");}
 else
    {printf("Wrong input");}
 }


#include<stdio.h>
int main()
{ int s,w;
 scanf("%d %d", &s, &w);
if (s<=w)
 {printf ("Unsafe")};
else
{printf("Safe")};}


#include<stdio.h>
int main()
{ int s,w;
 scanf("%d %d", &s, &w);
if (s<=w)
 {printf ("Unsafe");}
else
{printf("Safe");}
}


"use strict";
const main = arg => {
  const input = arg.trim().split('\n');
  const arr = input[0].split(" ").map(Number);

  if(arr[0] <= arr[1]){
    console.log("unsafe");
  }else{
    console.log("safe");
  }
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {

	input = input.split(" ");
	var a = parseInt(input[0], 10);
	var b = parseInt(input[1], 10);
if (a>b){
	console.log( 'safe')
} else {
    console.log(  'unsafe')
}

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    var S = input.split(' ')[0];
    var W = input.split(' ')[1];
    if (S-W<=0) {
        console.log("unsafe");
    } else {
        console.log("safe");
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
  const tmp = input.trim().split(' ')
  const s = parseInt(tmp[0], 10)
  const w = parseInt(tmp[1], 10)

  if (w > s) {
    console.log('unsafe')
  } else {
    console.log('safe')
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))


function Main(input) {
  const lines = input.split(' ');
  let sh = lines[0];
  let wol = lines[1];
  if ( sh > wol ) {
    console.log("safe");
  } else {
    console.log("unsafe");
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  const lines = input.split(' ');
  let sh = lines[0];
  let wol = lines[1];
  if ( sh > wol ) {
    console.log("safe");
  } else {
    console.log("unsafe");
  }
}


package main

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

func main() {
	sc.Split(bufio.ScanWords)
	var S, W int
	nextInt(&S, &W)
	if W >= S {
		fmt.Printf("unsafe")
	} else {
		fmt.Printf("safe")
	}
}

const MAX_INT int = 1_000_000_000

var sc = bufio.NewScanner(os.Stdin)

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)

func nextLine() string {
	buffer := make([]byte, 0)
	for true {
		line, isPrefix, err := reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func nextInt(A ...*int) {
	L := strings.Split(nextLine(), " ")
	for i, a := range A {
		*a, _ = strconv.Atoi(L[i])
	}
}
func nextInts(A *[]int) {
	L := strings.Split(nextLine(), " ")
	(*A) = make([]int, len(L))
	for i, l := range L {
		(*A)[i], _ = strconv.Atoi(l)
	}
}

func nextInt64(A ...*int64) {
	L := strings.Split(nextLine(), " ")
	for i, a := range A {
		*a, _ = strconv.ParseInt(L[i], 0, 64)
	}
}

func max(a int, b int) int {
	if a >= b {
		return a
	}
	return b
}


package main

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

const mod = 998244353
const facNum = 300001
const INF = 1001001001

func main() {
	sc := newScanner(os.Stdin)
	S,W := sc.i(), sc.i()
	if W >=S {
		fmt.Println("unsafe")

	}else {
		fmt.Println("safe")
	}
}

// fmt.Println("Yes")
// fmt.Println("No")

// I/O
type scanner struct {
	sc *bufio.Scanner
}

func newScanner(input io.Reader) *scanner {
	sc := bufio.NewScanner(input)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &scanner{sc}
}

func (s *scanner) s() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *scanner) i() int {
	i, e := strconv.Atoi(s.s())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *scanner) f() float64 {
	f, e := strconv.ParseFloat(s.s(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *scanner) bs() []byte {
	return []byte(s.s())
}

func (s *scanner) is(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.i()
	}
	return res
}

func (s *scanner) fs(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.f()
	}
	return res
}

//const factorial = new
func Pow(a, n int) int {
	ans := 1
	for n > 0 {
		if (n & 1) == 1 {
			ans = ans * a % mod
		}
		a = a * a % mod
		n = n >> 1
	}
	return ans
}

func Gcd(a, b int) int {
	if a < b {
		return Gcd(b, a)
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func combination(n, k int, fac, ifac []int) int {
	if n < k || n < 0 {
		return 0
	}
	if k == 0 {
		return 1
	}
	//while n != 0
	ans := ifac[k] * ifac[n-k] % mod
	return ans * fac[n] % mod
}

// 階乗: factorial
// コンビネーションを計算する際に前もって計算しておく
// fac[k] => k! (mod M)
// ifac[k] => k!^(M-2) (mod M)
// n: ex. 2 * 10^5 => 200001
// fac, ifac := factorial()
func factorial() (fac []int, ifac []int) {
	fac = make([]int, facNum)
	fac[0] = 1
	ifac = make([]int, facNum)
	ifac[0] = 1
	for i := 1; i < facNum; i++ {
		fac[i] = fac[i-1] * i % mod
		ifac[i] = ifac[i-1] * Pow(i, mod-2) % mod
	}
	return
}

// vs: sorted slice int value
func lowerBound(vs []int, v int) (index int) {
	n := len(vs) / 2
	m := len(vs)
	for m != n {
		if vs[n] < v {
			n = (m-n+1)/2 + n
			//m = m
		} else {
			m = n
			n = n / 2
		}
	}
	return n
}


package main

import "fmt"

func main() {
	var s, w int
	fmt.Scan(&s, &w)

	if s <= w {
		fmt.Println("unsafe")
	} else {
		fmt.Println("safe")
	}
}


package main

import "fmt"

func main(){
	var S, W int;
	fmt.Scan(&S, &W);

	if S < W {
		fmt.Println("unsafe");
	}else {
		fmt.Println("safe");
	}
}


package main

import (
	"fmt"
)

func main() {
	var S int
	var W int
	fmt.Scan(&S)
	fmt.Scan(&W)

	if S > W {
		fmt.Println("unsafe")
	} else {
		fmt.Println("safe")
	}
}


package main
import "fmt"
func main() {
	var S int
    var W int
	fmt.Scan(&S,&W)

  if S<W {
    fmt.Println("safe")
  }else{
    fmt.Println("unsafe")
  }

}


a,b = gets.split.map(&:to_i)
if a<=b then
  puts "unsafe"
else
  puts "safe"
end


s,w = gets.split.map(&:to_i)
if s > w
  puts 'safe'
else
  puts 'unsafe'
end


s,w=gets.split.map(&:to_i)
puts w >= s ? 'unsafe' : 'safe'


s, w = gets.split.map(&:to_i)
puts w>=s ? : "unsafe" : "safe"


sw = gets.split(" ")
sw = sw.map { |a|
    a.to_i
}

puts(sw)
if sw[0] <= sw[1]
    puts("unsafe")
else
    puts("safe")
end


s = gets.to_i
w = gets.to_i
puts s <= w ? "unsafe" : "safe"


use proconio::input;

fn main() {
    input! {
        s: u32,
        w: u32,
    }
    if s <= w {
        println!("unsafe");
    } else {
        println!("safe");
    }
}


//---------- Begin IO utilities ----------
// Thanks to https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:tt : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! p {
    ($v:ident) => {
        println!("{}", $v);
    };
    ($v:ident, $($t:ident),*) => {
        print!("{}", $v);
        ($(print!(" {}", $t)),*);
        println!();
    }
}
#[allow(unused_macros)]
macro_rules! ps {
    ($v:ident) => {
        println!("{}", $v.iter().collect::<String>());
    };
    ($v:ident, $($t:ident),*) => {
        print!("{}", $v.iter().collect::<String>());
        ($(print!(" {}", $t.iter().collect::<String>())),*);
        println!();
    }
}
#[allow(dead_code)]
fn pv<T: std::string::ToString>(v: &[T], sep: &str) {
    let s = v.iter().map(|e| e.to_string()).collect::<Vec<String>>().join(sep);
    println!("{}", s);
}
#[allow(dead_code)]
fn pvs(v: &[Vec<char>], sep:&str) {
    let s = v.iter().map(|e| e.iter().collect::<String>()).collect::<Vec<String>>().join(sep);
    println!("{}", s);
}
//---------- End IO utilities ----------

fn main() {
    input!{
        s: u8,
        w: u8,
    }
    if s <= w {
        println!("unsafe");
    } else {
        println!("safe");
    }
}


fn main() {
  proconio::input! {
    s: i32,
    w: i32,
  }
  if s<= w { println!("unsafe"); }
  else { println!("safe"); }
}


use proconio::input;

fn main() {
    input! {
        s: usize,
        w: usize,
    }

    solve(s, w);
}

fn solve(s: usize, w: usize) {
    if 2 * w >= s {
        println!("unsafe");
    } else {
        println!("safe");
    }
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        s: u64,
        w: u64,
    };

    if w * 2 >= s {
        println!("unsafe")
    } else {
        println!("safe")
    }
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {s: u64, k: u64};

    if k * 2 >= s {
        println!("unsafe")
    } else {
        println!("safe")
    }
}


let line = readLine()!
let sw = line.split(separator: " ").map { Int($0)! }
sw[0] <= sw[1] ? print("unsafe") : print("safe")


let inputs = readLine()!.split(separator: " ").map { Int($0)! }
let r = inputs[0] <= inputs[1]
print(r ? "unsafe" : "safe")


let sw = readLine()!.split(separator: " ").map { Int($0)! }
let (s, w) = (sw[0], sw[1])

if w >= s { print("unsafe") } else { print("safe")}


import Foundation

func readInts() -> [Int]{
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main(){
    let sw = readInts()

    print(sw[0] <= sw[1] ? "unsase": "safe")
}
main()


import Foundation

func readInts() -> [Int]{
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main(){
    let sw = readInts()

    print(sw[0] >= sw[1] ? "unsase": "safe")
}
main()


class AtCoder {
  // 入力系
  input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);
  input_i=-1;

  N=this.input[0];
  M=this.input[1];
  SN=String(this.input[0]);
  SM=String(this.input[1]);

  n(){
    this.input_i++;
    return Number(this.input[this.input_i]);
  }
  nn(n:number):number[]{
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.n());
    }
    return a;
  }
  s(){
    this.input_i++;
    return String(this.input[this.input_i]);
  }
  ss(n:number):string[]{
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.s());
    }
    return a;
  }

  // コンソール
  o(...a:any){
    console.log(...a);
  }

  // Math
  abs(a:number){
    return Math.abs(a);
  }
  min(...a:number[]){
    return Math.min(...a);
  }
  max(...a:number[]){
    return Math.max(...a);
  }
  floor(a:number){
    return Math.floor(a);
  }
  ceil(a:number){
    return Math.ceil(a);
  }
  round(a:number){
    return Math.round(a);
  }

  // ソート
  asc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return a-b});
  }
  desc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return b-a});
  }

  // 自作
  gcd(...arr:number[]):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=x;
    }
    return arr[arr.length-1];
  };
  lcm(...arr:number[]):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=arr[i]*arr[i+1]/x;
    }
    return arr[arr.length-1];
  };
  isPrime(n:number):boolean{
    if(n < 2) return false;
    const suq=Math.sqrt(n);
    for(let i=2;i<=suq;i++){
      if(n%i==0){
        return false;
      }
    }return true;
  };
  deduplicate(a:any[]):any[]{
    return Array.from(new Set(a));
  };
  f(roop:number, callback:any){
    for(let i=0;i<roop;i++){
      callback(i);
    }
  };
  Yes(){
    console.log('Yes');
  }
  No(){
    console.log('No');
  }
  YES(){
    console.log('YES');
  }
  NO(){
    console.log('NO');
  }
}
const m = () => {
  const o = new AtCoder()
  o.o(o.n() <= o.n() ? 'unsafe' : 'safe')
}
m();


//0:実行モード
//1:開発モード
//2:最終テストモード
const sys_debugMode : number = 0;

function chk(in_data1 : any, in_data2? : any) : void{
	if (sys_debugMode == 0 || sys_debugMode == 2){
		return;
	}
	else if (in_data2 === undefined){
		console.log(in_data1);
	}
	else{
		console.log(in_data1 + "[" + typeof(in_data2) + "] =", in_data2);
	}
}

function prt(in_data : any) : void{
	console.log(in_data);
}

class ParamManager {

	private a_s_inputLines : string[];
	private n_maxLine : number;
	private n_nowLineCnt : number;

	constructor(){
		this.a_s_inputLines = this.inputLines();
		this.n_maxLine = this.a_s_inputLines.length;
		this.descLines();
		this.n_nowLineCnt = 1;
	}
	inputLines(){
		const fs = require('fs');

		let text;
		if(sys_debugMode == 0){
			text = fs.readFileSync("/dev/stdin", 'utf8');
		}
		else{
			text = fs.readFileSync("input.txt", 'utf8');
		}

		const line:string[] = text.toString().replace(/\r/g, "").split('\n');

		return line;
	}
	descLines(){
		chk("ParamManager.a_s_inputLines", this.a_s_inputLines);
	}
	getNextLine(in_s_type?):any{
		if (this.n_nowLineCnt > this.n_maxLine){
			chk("ParamManager.getNextLine","No Next Line!");
			return;
		}
		const s_returnLine:string = this.a_s_inputLines[this.n_nowLineCnt - 1];

		this.n_nowLineCnt++;

		if (in_s_type == "n"){
			return parseInt(s_returnLine);
		}
		else if (in_s_type == "a"){
			return s_returnLine.split(" ");
		}
		else if (in_s_type == "an"){
			const a_s_temp = s_returnLine.split(" ");
			const a_n_temp = a_s_temp.map(function(str){return Number(str)});
			return a_n_temp;
		}
		else if(in_s_type == "s"){
			const aMoji:string[] = s_returnLine.split("");
			return aMoji;
		}
		else if(in_s_type == "sn"){
			const aMoji:string[] = s_returnLine.split("");
			const aNum:number[] = aMoji.map(function(str){return Number(str)});
			return aNum;
		}
		else{
			return s_returnLine;
		}
	}
}
const paramManager = new ParamManager();
//==================================================
//https://atcoder.jp/contests/abc164/tasks/abc164_a
//A - Sheep and Wolves /
//==================================================
class Param{
	sheepNum:number;
	wolfNum:number;

	constructor(){
		chk("--------------------------------------------------");
		chk("パラメータ");
		//羊がS匹、狼がW匹います。
		const aTemp = paramManager.getNextLine("an");
		this.sheepNum = aTemp[1-1];
		this.wolfNum  = aTemp[2-1];

		chk(this);
	}
}
const param = new Param();
//==================================================
class Manager{

	constructor(){

		this.main();
	}

	main():void{
		chk("--------------------------------------------------");
		chk("main");

		this.resultOutput();
	}

	resultOutput():void{
		chk("--------------------------------------------------");
		chk("resultOutput");
		//狼の数が羊の数以上のとき、羊は狼に襲われてしまいます。
		//羊が狼に襲われるなら unsafe、襲われないなら safe を出力してください。
		if(param.wolfNum >= param.sheepNum){
			prt("unsafe");
		}
		else{
			prt("safe");
		}
	}

}
const manager = new Manager();
//==================================================


import * as fs from 'fs';

export function Main(input: string) {
    const [s, w] = input.split(' ').map(int => parseInt(int));  // ?

    let result = w >= s ? 'unsafe' : 'safe';

    //output

    console.log(result);
    return result;
}

// Don't edit this line!
Main(fs.readFileSync("/dev/stdin", "utf8"));


import * as fs from 'fs';

export function Main(input: string) {
    const str = parseInt(input).toString();   // ?
    const sequence = input.split('').map(int => parseInt(int)); //?
    let result = 0;

    for(let i = 0; i < input.length; i++) {
        for(let j = i + 1; j <= input.length; j++) {
            [i, j] //?
            const subst = str.substring(i, j); //?
            const int = parseInt(subst);    //?
            if(int % 2019 === 0) {
                result++;
            }//?
        }
    }

    //output

    console.log(result);
    return '' + result;
}

// Don't edit this line!
Main(fs.readFileSync("/dev/stdin", "utf8"));


#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define debug2(x, y)                       \
  cerr << "(" << #x << "," << #y << ") = " \
       << "(" << x << "," << y << ")\n"
#define all(x) x.begin(), x.end()
#define each(a, x) for (auto& a : (x))
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define int long long
#define yn(x) puts((x ? "Yes" : "No"))
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
const int MX = 1e5 + 5, INF = 5LL << 57, MOD = 1e9 + 7;

int N, M;
string S;
vi va, vb;

void input() {
  ;
  cin>>N>>M;
  cout<<((N>>N) ? "unsafe" : "safe")<<endl;
  ;
}
void solve() {
  ;
  ;
}
signed main() {
  cout << setprecision(12);
  input();
  solve();
  return 0;
}


s = input()

allhi = ["hi"*i for i in range(1,20)]

if s in allhi:
    print("Yes")
else:
    print("No")


S=input()
if S in ['hi', 'hihi', 'hihihi', 'hihihihi', 'hihihihihi']:
    print('Yes')
else:
    print('No')


a = input()
if a == 'hi' or a == 'hihi' or a == 'hihihi' or a == 'hihihihi' or a == 'hihihihihi':
    print("Yes")
else:
    print("No")


s = input()
if len(s)%2 == 0:
  for i in len(s)//2:
    if s[2*i] != "h" and s[2*i+1] != "i":
      print("No")
      exit()
  print("Yes")
else:
  print("No")


s=input()
ans="No"
if s=="hi":
  ans="Yes"
for i in range(3,len(s)):
  if s[i-3]=="h" and s[i-2]=="i" and s[i-1]=="h" and s[i]=="i":
    ans="Yes"
print(ans)


s=input()
ans="No"
for i in range(len(s)-1):
  if s[i]=="h" and s[i+1]=="i":
    ans="Yes"
    break
print(ans)


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

public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    try{
      String S = br.readLine();
      String s1 = "hi";
      String s2 = "hihi";
      String s3 = "hihihi";
      String s4 = "hihihihi";
      String s5 = "hihihihihi";
      boolean f = S.equals(s1) || S.equals(s2) || S.equals(s3) || S.equals(s4) || S.equals(s5);
      System.out.println(f ? "Yes" : "No");
    }catch(Exception e){
    }
  }
}


import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.Queue;

public class Main implements Runnable{

	public static void main(String[] args) {
		new Thread(null,new Main(), "" ,Runtime.getRuntime().maxMemory()).start();
	}

	public void run() {
		FastScanner sc=new FastScanner();
		String str=sc.next();
		boolean ans=str.length()%2==0;
		for(int i=0;i+1<str.length();i+=2) {
			ans&=str.substring(i,i+2).equals("hi");
		}
		System.out.println(ans?"Yes":"No");
	}

	void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}
}

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());}
}


import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import static java.lang.Math.E;
import static java.lang.Math.PI;
import static java.lang.Math.abs;
import static java.lang.Math.acos;
import static java.lang.Math.asin;
import static java.lang.Math.atan2;
import static java.lang.Math.atan;
import static java.lang.Math.cos;
import static java.lang.Math.exp;
import static java.lang.Math.hypot;
import static java.lang.Math.log;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.sin;
import static java.lang.Math.sqrt;
import static java.lang.Math.tan;
import static java.lang.String.format;
import static java.lang.System.currentTimeMillis;
import static java.math.BigInteger.ONE;
import static java.math.BigInteger.TEN;
import static java.math.BigInteger.ZERO;
import static java.util.Arrays.fill;
import static java.util.Arrays.sort;
import static java.util.Collections.sort;
import static java.util.Comparator.reverseOrder;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;

public class Main {
    public static void main(String[] args) {
        FastScanner fsc = new FastScanner();
        String str = fsc.next();
        str = str.replaceAll("hi", "");
        System.out.println(str.length() == 0 ? "Yes" : "No");
    }
}

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());
    }
}