#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define mod 1000000007
using namespace std;
int main() {
  int a, b;
  char c;
  vector<int> ans;
  while (true) {
    cin >> a >> c >> b;
    if (a == 0 && b == 0 && c == '?')
      break;
    if (c == '+')
      ans.push_back(a + b);
    if (c == '-')
      ans.push_back(a - b);
    if (c == '*')
      ans.push_back(a * b);
    if (c == '/')
      ans.push_back(a / b);
  }
  rep(i, ans.size()) { cout << ans[i] << endl; }
}

#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define mod 1000000007
using namespace std;
int main() {
  int a, b;
  char c;
  vector<int> ans;
  while (true) {
    cin >> a >> c >> b;
    if (c == '?')
      break;
    if (c == '+')
      ans.push_back(a + b);
    if (c == '-')
      ans.push_back(a - b);
    if (c == '*')
      ans.push_back(a * b);
    if (c == '/')
      ans.push_back(a / b);
  }
  rep(i, ans.size()) { cout << ans[i] << endl; }
}


#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int a, b;
  char s;
  cin >> a >> s >> b;
  while (1) {
    if (s == '?')
      break;
    if (s == '+')
      cout << a + b << endl;
    if (s == '-')
      cout << a - b << endl;
    if (s == '*')
      cout << a * b << endl;
    if (s == '/')
      cout << a / b << endl;
  }
  return 0;
}

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int a, b;
  char s;

  while (1) {
    cin >> a >> s >> b;
    if (s == '?')
      break;
    if (s == '+')
      cout << a + b << endl;
    if (s == '-')
      cout << a - b << endl;
    if (s == '*')
      cout << a * b << endl;
    if (s == '/')
      cout << a / b << endl;
  }
  return 0;
}


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

int main() {
  int x = 0, y = 0, z = 0;
  char a[10];
  while (1) {
    cin >> x >> a >> y;
    if (a[0] = '+') {
      z = x + y;
    } else if (a[0] = '-') {
      z = x - y;
    } else if (a[0] = '*') {
      z = x * y;
    } else if (a[0] = '/') {
      z = x / y;
    } else if (a[0] = '?') {
      break;
    }
    cout << z << endl;
  }
  return 0;
}

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

int main() {
  int x = 0, y = 0, z = 0;
  char a[10];
  while (1) {
    cin >> x >> a >> y;
    if (a[0] == '+') {
      z = x + y;
    } else if (a[0] == '-') {
      z = x - y;
    } else if (a[0] == '*') {
      z = x * y;
    } else if (a[0] == '/') {
      z = x / y;
    } else if (a[0] == '?') {
      break;
    }
    cout << z << endl;
  }
  return 0;
}


#include <iomanip>
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
  /*
          double pai,r;
          double men,syu;
  //	pai=3.1415926538979;
          pai=M_PI;
          cin>>r;
          men=r*r*pai;
          syu=r*pai*2;
          cout<<fixed
                  <<setprecision(6)
                  <<men
                  <<" "
          //	<<fixed
          //	<<setprecision(6)
                  <<syu
                  <<endl;
  */
  int a, b;
  double aa, Output;
  int output;
  char op[2];
  cin >> a >> op >> b;
  while (1) {
    if (strcmp(op, "+") == 0) {
      output = a + b;
      cout << output << endl;

    } else if (strcmp(op, "-") == 0) {
      output = a - b;
      cout << output << endl;

    } else if (strcmp(op, "*") == 0) {
      output = a * b;
      cout << output << endl;

    } else if (strcmp(op, "/") == 0) {
      aa = (double)a;
      Output = a / b;
      cout << Output << endl;

    } else {
      break;
    }
  }

  return 0;
}

#include <iomanip>
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {

  int a, b;
  double aa, Output;
  int output;
  char op[2];
  while (1) {
    cin >> a >> op >> b;
    if (strcmp(op, "+") == 0) {
      output = a + b;
      cout << output << endl;

    } else if (strcmp(op, "-") == 0) {
      output = a - b;
      cout << output << endl;

    } else if (strcmp(op, "*") == 0) {
      output = a * b;
      cout << output << endl;

    } else if (strcmp(op, "/") == 0) {
      aa = (double)a;
      Output = a / b;
      cout << Output << endl;

    } else {
      break;
    }
  }

  return 0;
}


#include <stdio.h>
int main(void) {
  int a, b, op;
  scanf("%d %s %d", &a, &op, &b);
  while (op != '?') {
    if (op == '+')
      printf("%d\\n", a + b);
    else if (op == '-')
      printf("%d\\n", a - b);
    else if (op == '*')
      printf("%d\\n", a * b);
    else if (op == '/')
      printf("%d\\n", a / b);
    scanf("%d %d %d", &a, &op, &b);
  }
  return 0;
}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;

#define Rep(b, e, i) for (int i = b; i <= e; i++)
#define Repr(e, b, i) for (int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n - 1, i)
#define repr(n, i) Repr(n - 1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)), (x).end())

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef std::priority_queue<int> IntPrioQueue; // Z->A
typedef std::priority_queue<int, std::vector<int>, std::greater<int>>
    IntReversePrioQueue; // A->Z

const int MAX = 200000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1 << 31 - 1;
const int MOD = 1000000007;

void solve(void) {
  int a, b;
  char op;
  while (1) {
    cin >> a >> op >> b;
    if (op == '?')
      break;
    int ans = 0;
    switch (op) {
    case '+':
      ans = a + b;
      break;
    case '-':
      ans = a - b;
      break;
    case '*':
      ans = a * b;
      break;
    case '/':
      ans = a / b;
      break;
    }
    printf("%d\\n", ans);
  }
}

int main(void) {
  solve();
  return 0;
}


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

int main() {
  int a, b, result;
  char op;

  cin >> a >> op >> b;

  while (1) {
    if (op == '+') {
      result = a + b;
      cout << result << endl;
    } else if (op == '-') {
      result = a - b;
      cout << result << endl;
    } else if (op == '*') {
      result = a * b;
      cout << result << endl;
    } else if (op == '/') {
      result = a / b;
      cout << result << endl;
    } else if (op == '?') {
      break;
    }
  }

  return 0;
}

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

int main() {
  int a, b, result;
  char op;

  while (1) {
    cin >> a >> op >> b;
    if (op == '+') {
      result = a + b;
      cout << result << endl;
    } else if (op == '-') {
      result = a - b;
      cout << result << endl;
    } else if (op == '*') {
      result = a * b;
      cout << result << endl;
    } else if (op == '/') {
      result = a / b;
      cout << result << endl;
    } else if (op == '?') {
      break;
    }
  }

  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int a, b, ans;
  char op;
  cin >> a >> op >> b;
  while (1) {
    switch (op) {
    case '+':
      ans = a + b;
      break;
    case '-':
      ans = a - b;
      break;
    case '*':
      ans = a * b;
      break;
    case '/':
      ans = a / b;
      break;
    case '?':
      return 0;
    }
    cout << ans << endl;
  }
}

#include <iostream>
using namespace std;

int main() {
  int a, b, ans;
  char op;
  while (1) {
    cin >> a >> op >> b;
    switch (op) {
    case '+':
      ans = a + b;
      break;
    case '-':
      ans = a - b;
      break;
    case '*':
      ans = a * b;
      break;
    case '/':
      ans = a / b;
      break;
    case '?':
      return 0;
    }
    cout << ans << endl;
  }
}


#include <stdio.h>

int main(void) {
  int a;
  int b;
  char op;
  int c = 0;
  while (1) {
    scanf("%d %c %d", &a, &op, &b);
    if (op == '+') {
      c = a + b;
      printf("%d\\n", c);
    } else if (op == '-') {
      c = a - b;
      printf("%d\\n", c);
    } else if (op == '*') {
      c = a * b;
      printf("%d\\n", c);
    } else if (op == '/') {
      c = a / b;
      printf("%d\\n", c);
    } else {
      if (op == '?' && a == 0 && b == 0)
        break;
    }
  }
  return (0);
}

#include <stdio.h>

int main(void) {
  int a;
  int b;
  char op;
  int c = 0;
  while (1) {
    scanf("%d %c %d", &a, &op, &b);
    if (op == '+') {
      c = a + b;
      printf("%d\\n", c);
    } else if (op == '-') {
      c = a - b;
      printf("%d\\n", c);
    } else if (op == '*') {
      c = a * b;
      printf("%d\\n", c);
    } else if (op == '/') {
      c = a / b;
      printf("%d\\n", c);
    } else {
      if (op == '?')
        break;
    }
  }
  return (0);
}


#include <iostream>
using namespace std;
int main() {
  while (1) {
    int a, b;
    char op;
    cin >> a >> op >> b;
    switch (op) {
    case '+':
      a = a + b;
      break;
    case '-':
      a = a - b;
      break;
    case '*':
      a = a * b;
      break;
    case '/':
      a = a / b;
      break;
    case '?':
      break;
    default:
      return 0;
    }
    cout << a << endl;
  }
}

#include <iostream>
using namespace std;
int main() {
  while (1) {
    int a, b;
    char op;
    cin >> a >> op >> b;
    if (op == '?')
      break;
    switch (op) {
    case '+':
      a = a + b;
      break;
    case '-':
      a = a - b;
      break;
    case '*':
      a = a * b;
      break;
    case '/':
      a = a / b;
      break;
    default:
      return 0;
    }
    cout << a << endl;
  }
}


#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
  int a, b;
  char c;
  cin >> a >> c >> b;

  while (true) {
    if (c == '?')
      break;
    if (c == '+')
      cout << a + b << endl;
    if (c == '-')
      cout << a - b << endl;
    if (c == '*')
      cout << a * b << endl;
    if (c == '/')
      cout << a / b << endl;
  }
  return 0;
}

#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
  while (true) {
    int a, b;
    char c;
    cin >> a >> c >> b;
    if (c == '?')
      break;
    if (c == '+')
      cout << a + b << endl;
    if (c == '-')
      cout << a - b << endl;
    if (c == '*')
      cout << a * b << endl;
    if (c == '/')
      cout << a / b << endl;
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int a, b = 0;
  char op = 0;
  do {
    cin >> a >> op >> b;
    switch (op) {
    case '+':
      cout << a + b << endl;
      break;
    case '-':
      cout << a - b << endl;
      break;
    case '*':
      cout << a * b << endl;
      break;
    case '/':
      cout << a / b << endl;
      break;
    default:
      break;
    }
  } while (op = '?');
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int a, b = 0;
  char op = 0;
  do {
    cin >> a >> op >> b;
    switch (op) {
    case '+':
      cout << a + b << endl;
      break;
    case '-':
      cout << a - b << endl;
      break;
    case '*':
      cout << a * b << endl;
      break;
    case '/':
      cout << a / b << endl;
      break;
    default:
      break;
    }
  } while (op != '?');
  return 0;
}


#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;

#define pi 3.141592653589

int main() {
  int a, b;
  char op;

  while (cin >> a >> op >> b) {
    if (op == '+') {
      cout << a + b << endl;
    } else if (op == '-') {
      cout << a - b << endl;
    } else if (op == '*') {
      cout << a * b << endl;
    } else if (op == '/') {
      cout << a / b << endl;
    } else {
      break;
    }
  }
  return 9;
}

#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;

#define pi 3.141592653589

int main() {
  int a, b;
  char op;

  while (cin >> a >> op >> b) {
    if (op == '+') {
      cout << a + b << endl;
    } else if (op == '-') {
      cout << a - b << endl;
    } else if (op == '*') {
      cout << a * b << endl;
    } else if (op == '/') {
      cout << a / b << endl;
    } else {
      break;
    }
  }
  return 0;
}


#include <iostream>

using namespace std;

int main() {
  int a, b;
  char c;
  while (1) {
    cin >> a >> c >> b;
    if (c == '?')
      switch (c) {
      case '+':
        cout << a + b;
        break;
      case '-':
        cout << a - b;
        break;
      case '*':
        cout << a * b;
        break;
      case '/':
        cout << a / b;
        break;
      }
    cout << endl;
  }
}

#include <iostream>

using namespace std;

int main() {
  int a, b;
  char c;
  while (1) {
    cin >> a >> c >> b;
    if (c == '?')
      break;
    switch (c) {
    case '+':
      cout << a + b;
      break;
    case '-':
      cout << a - b;
      break;
    case '*':
      cout << a * b;
      break;
    case '/':
      cout << a / b;
      break;
    }
    cout << endl;
  }
}


#include <stdio.h>
int main() {
  int i;
  int a, b;
  char op;
  int cnt = 0;
  int x[10000];

  for (i = 0; i < 10000 && !cnt; i++) {
    scanf("%d %c %d", a, op, b);
    switch (op) {
    case '+':
      x[i] = a + b;
      break;
    case '-':
      x[i] = a - b;
      break;
    case '*':
      x[i] = a * b;
      break;
    case '/':
      x[i] = a / b;
      break;
    case '?':
      if (!i)
        return 0;
      cnt = i;
      break;
    }
  }
  for (i = 0; i < 10000 && i < cnt - 1; i++) {
    printf("%d", x[i]);
  }
  return 0;
}

#include <stdio.h>

int main() {
  int i;
  int a, b;
  char op;
  int cnt = 0;
  int x[10000];

  for (i = 0; i < 10000 && !cnt; i++) {
    scanf("%d %c %d", &a, &op, &b);

    switch (op) {
    case '+':
      x[i] = a + b;
      break;
    case '-':
      x[i] = a - b;
      break;
    case '*':
      x[i] = a * b;
      break;
    case '/':
      x[i] = a / b;
      break;
    case '?':
      if (i == 0)
        return 0;
      cnt = i;
      break;
    }
  }

  for (i = 0; i < 10000 && i < cnt; i++) {
    printf("%d\\n", x[i]);
  }
  return 0;
}


#include <iostream>
using namespace std;
int main(int argc, const char *argv[]) {
  int a, b, c, d, e, f;
  char op;
  cin >> a >> op >> b;
  while (1) {

    if (op == '?')
      break;

    else if (op == '+') {
      c = a + b;
      cout << c << endl;
    } else if (op == '-') {
      d = a - b;
      cout << d << endl;
    } else if (op == '*') {
      e = a * b;
      cout << e << endl;
    } else {
      f = a / b;
      cout << f << endl;
    }
  }
  // insert code here...
  //  std::cout << "Hello, World!\\n";
  return 0;
}

#include <iostream>
using namespace std;
#include <stdio.h>
int main(int argc, const char *argv[]) {
  int a, b;
  char op;
  while (1) {
    cin >> a >> op >> b;
    if (op == '?') {
      break;
    }

    else if (op == '+') {

      cout << a + b << endl;
    } else if (op == '-') {

      cout << a - b << endl;
    } else if (op == '*') {

      cout << a * b << endl;
    } else {
      cout << a / b << endl;
    }
  }
  // insert code here...
  //  std::cout << "Hello, World!\\n";
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const double PI = acos(-1.0);

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int a, b;
  string op;
  cin >> a >> op >> b;

  while (1) {
    int ans;
    if (op == "?")
      break;
    if (op == "+")
      ans = a + b;
    if (op == "-")
      ans = a - b;
    if (op == "*")
      ans = a * b;
    if (op == "/")
      ans = a / b;
    cout << ans << "\\n";
  }

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const double PI = acos(-1.0);

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int a, b;
  string op;
  while (1) {
    cin >> a >> op >> b;
    int ans;
    if (op == "?")
      break;
    if (op == "+")
      ans = a + b;
    if (op == "-")
      ans = a - b;
    if (op == "*")
      ans = a * b;
    if (op == "/")
      ans = a / b;
    cout << ans << "\\n";
  }

  return 0;
}


#include <iostream>
using namespace std;
int main() {
  int a, b;
  char op;
  while (1) {
    if (op == '?')
      break;

    if (op == '+') {
      cout << a + b << endl;
      break;
    }
    if (op == '-') {
      cout << a - b << endl;
      break;
    }
    if (op == '*') {
      cout << a * b << endl;
      break;
    }
    if (op == '/') {
      cout << a / b << endl;
      break;
    }
  }
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  int a, b;
  char op;

  while (op != '?') {

    cin >> a >> op >> b;

    if (op == '+') {
      cout << a + b << endl;
    }
    if (op == '-') {
      cout << a - b << endl;
    }
    if (op == '*') {
      cout << a * b << endl;
    }
    if (op == '/') {
      cout << a / b << endl;
    }
  }
  return 0;
}


#include <cstdio>
#include <iostream>
#define ll long long
using namespace std;
int main() {
  int a, b;
  char c;
  while (scanf("%d%c%d", &a, &c, &b) != EOF) {
    if (c == '?')
      continue;
    if (c == '-')
      printf("%d\\n", a - b);
    else if (c == '+')
      printf("%d\\n", a + b);
    else if (c == '*')
      printf("%d\\n", a * b);
    else if (c == '/')
      printf("%d\\n", a / b);
  }
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  int a, b, d;
  char c;
  while (cin >> a >> c >> b && !(c == '?')) {
    if (c == '+') {
      d = a + b;
    } else if (c == '-') {
      d = a - b;
    } else if (c == '*') {
      d = a * b;
    } else
      d = a / b;
    cout << d << endl;
  }
  return 0;
}


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

// macros
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define MIN(a, b) (a > b ? b : a)
#define MAX(a, b) (a > b ? a : b)
#define INT_IN(a)                                                              \\
  int a;                                                                       \\
  cin >> a
#define STR_IN(s)                                                              \\
  string s;                                                                    \\
  cin >> s
#define PRINTLN(s) cout << s << endl
#define PRINTDOUBLELN(s) cout << setprecision(12) << (s) << endl;

// util functions
template <class T> inline T sqr(T x) { return x * x; }

inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

template <typename T> inline T max(vector<T> v) {
  T max = v[0];
  FOR(i, 1, v.size()) max = MAX(v[i], max);
  return max;
}
template <typename T> inline T min(vector<T> v) {
  T min = v[0];
  FOR(i, 1, v.size()) min = MIN(v[i], min);
  return min;
}
template <typename T> inline vector<T> concat(vector<T> a, vector<T> b) {
  vector<T> ab;
  ab.reserve(a.size() + b.size());
  ab.insert(ab.end(), a.begin(), a.end());
  ab.insert(ab.end(), b.begin(), b.end());
  return ab;
}

// types
typedef long long LL;

// consts
const double EPS = 1e-10;
const double PI = acos(-1.0);

// debug
#define dump(x) #x << " = " << (x) << endl
#define debug(x)                                                               \\
#x << " = " << (x) << " (L" << __LINE__ << ")"                               \\
     << " " << __FILE__ << endl

int main() {
  char op;
  do {
    INT_IN(a);
    cin >> op;
    INT_IN(b);
    PRINTLN((op == '+'   ? a + b
             : op == '-' ? a - b
             : op == '*' ? a * b
                         : a / b));
  } while (op != '?');
  return 0;
}

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

// macros
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define MIN(a, b) (a > b ? b : a)
#define MAX(a, b) (a > b ? a : b)
#define INT_IN(a)                                                              \\
  int a;                                                                       \\
  cin >> a
#define STR_IN(s)                                                              \\
  string s;                                                                    \\
  cin >> s
#define PRINTLN(s) cout << s << endl
#define PRINTDOUBLELN(s) cout << setprecision(12) << (s) << endl;

// util functions
template <class T> inline T sqr(T x) { return x * x; }

inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

template <typename T> inline T max(vector<T> v) {
  T max = v[0];
  FOR(i, 1, v.size()) max = MAX(v[i], max);
  return max;
}
template <typename T> inline T min(vector<T> v) {
  T min = v[0];
  FOR(i, 1, v.size()) min = MIN(v[i], min);
  return min;
}
template <typename T> inline vector<T> concat(vector<T> a, vector<T> b) {
  vector<T> ab;
  ab.reserve(a.size() + b.size());
  ab.insert(ab.end(), a.begin(), a.end());
  ab.insert(ab.end(), b.begin(), b.end());
  return ab;
}

// types
typedef long long LL;

// consts
const double EPS = 1e-10;
const double PI = acos(-1.0);

// debug
#define dump(x) #x << " = " << (x) << endl
#define debug(x)                                                               \\
#x << " = " << (x) << " (L" << __LINE__ << ")"                               \\
     << " " << __FILE__ << endl

int main() {
  char op;
  while (true) {
    INT_IN(a);
    cin >> op;
    INT_IN(b);
    if (op == '?')
      break;
    PRINTLN((op == '+'   ? a + b
             : op == '-' ? a - b
             : op == '*' ? a * b
                         : a / b));
  }
  return 0;
}


#include <stdio.h>

int main(void) {
  int a, b, ans;
  char c;
  while (1) {
    scanf("%d %c %d", &a, &c, &b);
    if (c == '+')
      ans = a + b;
    else if (c == '-')
      ans = a - b;
    else if (c == '*')
      ans = a * b;
    else if (c == '/')
      ans = a / b;
    printf("%d\\n", ans);
  }
  return 0;
}

#include <stdio.h>

int main(void) {
  int a, b, ans;
  char c;
  while (1) {
    scanf("%d %c %d", &a, &c, &b);
    if (c == '+')
      ans = a + b;
    else if (c == '-')
      ans = a - b;
    else if (c == '*')
      ans = a * b;
    else if (c == '/')
      ans = a / b;
    else
      break;
    printf("%d\\n", ans);
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  char op;
  int i = 0;
  string cu;
  int an[20001];
  int bn[20001];
  while (true) {
    cin >> a >> op >> b;
    an[i] = a;
    bn[i] = b;
    cu[i] = op;
    if (a == 0 && op == '?' && b == 0) {
      break;
    }
    i++;
  }
  for (int k = 0; k < i; k++) {
    if (cu[k] == '+') {
      cout << an[k] + bn[k] << endl;
    }
    if (cu[k] == '-') {
      cout << an[k] - bn[k] << endl;
    }
    if (cu[k] == '*') {
      cout << an[k] * bn[k] << endl;
    }
    if (cu[k] == '/') {
      cout << an[k] / bn[k] << endl;
    }
  }
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  char op;
  int i = 0;
  string cu;
  int an[20001];
  int bn[20001];
  while (true) {
    cin >> a >> op >> b;
    an[i] = a;
    bn[i] = b;
    cu[i] = op;
    if (op == '?') {
      break;
    }
    i++;
  }
  for (int k = 0; k < i; k++) {
    if (cu[k] == '+') {
      cout << an[k] + bn[k] << endl;
    }
    if (cu[k] == '-') {
      cout << an[k] - bn[k] << endl;
    }
    if (cu[k] == '*') {
      cout << an[k] * bn[k] << endl;
    }
    if (cu[k] == '/') {
      cout << an[k] / bn[k] << endl;
    }
  }
  return 0;
}


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

int main() {

  while (1) {
    int a, b;
    string op;
    cin >> a >> op >> b;
    if (a == 0 && op == "?" && b == 0)
      break;

    int ans;
    if (op == "+")
      ans = a + b;
    if (op == "-")
      ans = a - b;
    if (op == "*")
      ans = a * b;
    if (op == "/")
      ans = a / b;

    cout << ans << endl;
  }
  return 0;
}

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

int main() {

  while (1) {
    int a, b;
    string op;
    cin >> a >> op >> b;
    if (op == "?")
      break;

    int ans;
    if (op == "+")
      ans = a + b;
    if (op == "-")
      ans = a - b;
    if (op == "*")
      ans = a * b;
    if (op == "/")
      ans = a / b;

    cout << ans << endl;
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {

  int a, b;
  char op;
  cin >> a >> op >> b;

  while (1) {
    if (op == '?')
      break;
    else if (op == '+') {
      cout << a + b << endl;
    } else if (op == '-') {
      cout << a - b << endl;
    } else if (op == '*') {
      cout << a * b << endl;
    } else if (op == '/') {
      cout << a / b << endl;
    }
  }
  return 0;
}

#include <iostream>
using namespace std;

int main() {

  int a, b;
  char op;

  while (1) {
    cin >> a >> op >> b;
    if (op == '?')
      break;
    else if (op == '+') {
      cout << a + b << endl;
    } else if (op == '-') {
      cout << a - b << endl;
    } else if (op == '*') {
      cout << a * b << endl;
    } else if (op == '/') {
      cout << a / b << endl;
    }
  }
  return 0;
}


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

signed main() {
  int a, c;
  char b;
  while (scanf("%d%c%d", &a, &b, &c), b != '?') {
    switch (b) {
    case '+':
      printf("%d\\n", a + c);
      break;
    case '-':
      printf("%d\\n", a - c);
      break;
    case '*':
      printf("%d\\n", a * c);
      break;
    default:
      printf("%d\\n", a / c);
      break;
    }
  }
}

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

signed main() {
  int a, c;
  char b;
  while (cin >> a >> b >> c, b != '?') {
    switch (b) {
    case '+':
      printf("%d\\n", a + c);
      break;
    case '-':
      printf("%d\\n", a - c);
      break;
    case '*':
      printf("%d\\n", a * c);
      break;
    default:
      printf("%d\\n", a / c);
      break;
    }
  }
}


#include <cstdio>
int main() {
  int a, b;
  char op;
  while (scanf("%d %c %d", &a, &op, &b)) {
    if (a == 0 && op == '?' && b == 0)
      break;

    if (op == '+')
      printf("%d\\n", a + b);

    if (op == '-')
      printf("%d\\n", a - b);

    if (op == '*')
      printf("%d\\n", a * b);

    if (op == '/')
      printf("%d\\n", a / b);
  }
  return 0;
}

#include <cstdio>
int main() {
  int a, b;
  char op;
  while (scanf("%d %c %d", &a, &op, &b)) {
    if (op == '?')
      break;

    if (op == '+')
      printf("%d\\n", a + b);

    if (op == '-')
      printf("%d\\n", a - b);

    if (op == '*')
      printf("%d\\n", a * b);

    if (op == '/')
      printf("%d\\n", a / b);
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {

  int n;
  cin >> n;
  int *a = new int[n];
  cin >> n;
  int min, max, sum;
  min = 1000000;
  max = -1000000;
  sum = 0;

  for (int i = 0; i = n; i++) {
    cin >> a[i];
    if (max < a[i])
      max = a[i];
    if (min > a[i])
      min = a[i];
    sum = sum + a[i];
  }
  cout << min << " " << max << " " << sum << " "
       << "\\n";
}

#include <iostream>
using namespace std;

int main() {

  long int n;
  cin >> n;
  int *a = new int[n];
  long int min, max, sum;
  min = 1000000;
  max = -1000000;
  sum = 0;

  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (min > a[i])
      min = a[i];
    if (max < a[i])
      max = a[i];

    sum = sum + a[i];
  }
  cout << min << " " << max << " " << sum << "\\n";
}


#include <iostream>
using namespace std;

int main() {
  int n, max, min, sum;
  cin >> n;

  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (i = 0)
      max = min = sum = x;
    else {
      if (x > max)
        max = x;
      if (x < min)
        min = x;
      sum += x;
    }
  }
  cout << min << " " << max << " " << sum << endl;

  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int n, max, min, x;
  long long sum;

  cin >> n;

  cin >> x;
  max = min = sum = x;

  for (int i = 0; i < n - 1; i++) {
    cin >> x;
    if (x > max)
      max = x;
    if (x < min)
      min = x;
    sum += x;
  }
  cout << min << " " << max << " " << sum << endl;

  return 0;
}


#include <stdio.h>

int main() {
  int n, min, max, sum, i, ai[10000];
  sum = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", ai[i]);
    if (i == 0) {
      max = ai[i];
      min = ai[i];
    }
    if (min > ai[i])
      min = ai[i];
    if (max < ai[i])
      max = ai[i];

    sum += ai[i];
  }
  printf("%d %d %d\\n", min, max, sum);
}

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, min, max, i, s;
  long long sum = 0;
  cin >> n;
  cin >> s;
  min = s;
  max = s;
  sum = s;
  for (i = 0; i < n - 1; i++) {
    cin >> s;
    if (s > max)
      max = s;
    if (min > s)
      min = s;
    sum = sum + s;
  }
  cout << min << " " << max << " " << sum << endl;
  return 0;
}


#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
  long long a, n, max;
  long long goukei = 0;
  long long min = 999999999;
  long long array[9999999];
  cin >> n;
  for (;;) {
    for (a = 0; a < n; a++)
      cin >> array[a];
    int max = array[0];
    for (a = 0; a < n; a++)
      if (array[a] > max)
        max = array[a];
    for (a = 0; a < n; a++)
      if (array[a] < min)
        min = array[a];
    for (a = 0; a < n; a++)
      goukei += array[a];

    cout << min << " " << max << " " << goukei << endl;
    break;
  }

  return 0;
}

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
  long long a, n, max;
  long long goukei = 0;
  long long min = 999999999;
  long long array[1000000];
  cin >> n;
  for (;;) {
    for (a = 0; a < n; a++)
      cin >> array[a];
    int max = array[0];
    for (a = 0; a < n; a++)
      if (array[a] > max)
        max = array[a];
    for (a = 0; a < n; a++)
      if (array[a] < min)
        min = array[a];
    for (a = 0; a < n; a++)
      goukei += array[a];

    cout << min << " " << max << " " << goukei << endl;
    break;
  }

  return 0;
}


#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int n, a[10], x, max = -1000000, min = 1000000, gou = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    gou += a[i];
  }
  for (int i = 0; i < n; ++i) {
    if (min > a[i]) {
      swap(a[i], min);
    } else if (max < a[i]) {
      swap(a[i], max);
    }
  }
  cout << min << " " << max << " " << gou << endl;
  return 0;
}

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int n;
  long a[10000], x, max = -1000000, min = 1000000, gou = 0;
  ;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    gou += a[i];
  }
  for (int i = 0; i < n; ++i) {
    if (a[i] != 0) {
      if (min > a[i]) {
        swap(a[i], min);
      } else if (max < a[i]) {
        swap(a[i], max);
      }
    }
  }
  if (min > max) {
    min = 0;
    max = 0;
  }
  cout << min << " " << max << " " << gou << endl;
  return 0;
}


#include <cstdio>

int main(void) {
  int a, b;
  char op;

  while (1) {
    scanf("%d %c %d", &a, &op, &b);
    if (op == '+')
      printf("%d\\n", a + b);
    else if (op == '-')
      printf("%d\\n", a - b);
    else if (op == '*')
      printf("%d\\n", a * b);
    else if (op == '/')
      printf("%d\\n", a / b);
    else if (op == '?')
      break;
  }

  return 0;
}

#include <iostream>

using namespace std;

int main() {
  int num = 0;
  int a[10000] = {};
  long int max = -1000000, min = 1000000, sum = 0;

  cin >> num;

  for (int i = 0; i < num; i++) {
    cin >> a[i];

    if (max < a[i])
      max = a[i];
    if (min > a[i])
      min = a[i];

    sum += a[i];
  }

  cout << min << " " << max << " " << sum << endl;

  return 0;
}


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

int main() {
  int n, sum;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++)
    scanf("%d", a[i]);
  sort(a.begin(), a.end());
  sum = accumulate(a.begin(), a.end(), 0);
  printf("%d %d %d\\n", a[0], a[n - 1], sum);
  return 0;
}

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

int main() {
  int n;
  long long sum = 0;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++)
    scanf("%d", &a[i]);
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++)
    sum += a[i];
  printf("%d %d %lld\\n", a[0], a[n - 1], sum);
  return 0;
}


#include <iostream>

using namespace std;

int main() {
  int n, a;
  int max, min;
  long sum = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    if (i = 0) {
      max = min = a;
    }
    if (max < a) {
      max = a;
    }
    if (min > a) {
      min = a;
    }
    sum += a;
  }
  cout << min << " " << max << " " << sum << endl;
  return 0;
}

#include <iostream>

using namespace std;

int main() {
  int n, a;
  int max = -10000000, min = 10000000;
  long sum = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    if (max < a) {
      max = a;
    }
    if (min > a) {
      min = a;
    }
    sum += a;
  }
  cout << min << " " << max << " " << sum << endl;
  return 0;
}


#include <stdio.h>

int main() {
  int n, A[10001];
  scanf("%d", &n);
  int i;
  for (i = 0; i <= n - 1; i++) {
    scanf("%d ", A[i]);
  }
  int min = -1000001, max = 1000000, total = 0;
  for (i = 0; i <= n - 1; i++) {
    if (min > A[i])
      min = A[i];
    if (max < A[i])
      max = A[i];
    total = total + A[i];
  }
  printf("%d %d %d\\n", min, max, total);
  return 0;
}

#include <stdio.h>

int main() {
  int n, A[10001];
  scanf("%d", &n);
  int i;
  for (i = 0; i <= n - 1; i++) {
    scanf("%d ", &A[i]);
  }
  long int min = 1000001, max = -1000001, total = 0;
  for (i = 0; i <= n - 1; i++) {
    if (min > A[i])
      min = A[i];
    if (max < A[i])
      max = A[i];
    total = total + A[i];
  }
  printf("%ld %ld %ld\\n", min, max, total);
  return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int main() {

  int a;
  vector<int> data;
  long long int max = -1000000, min = 1000000, sum = 0;
  cin >> a;

  for (int i = 0; i < a; i++) {
    cin >> data[i];
    if (data[i] > max) {
      max = data[i];
    }
    if (data[i] > min) {
      min = data[i];
    }
    sum += data[i];
  }
  cout << min << ' ' << max << ' ' << sum;
}

#include <iostream>

using namespace std;

int main() {

  int a;
  int data[10000];
  long long int max = -1000000, min = 1000000, sum = 0;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> data[i];
    if (data[i] > max) {
      max = data[i];
    }
    if (data[i] < min) {
      min = data[i];
    }
    sum += data[i];
  }
  cout << min << ' ' << max << ' ' << sum << endl;
}


#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;

int main() {

  int m[256];
  int i, n;
  int sum = 0, max = -1000000, min = 1000000;

  cin >> n;
  for (i = 0; i < n; i++)
    cin >> m[i];

  for (i = 0; i < n; i++) {
    if (m[i] > max)
      max = m[i];
    if (m[i] < min)
      min = m[i];
    sum += m[i];
  }
  cout << min << " " << max << " " << sum << endl;

  return 0;
}

#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>

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

using namespace std;

int main() {

  long long min = 1000000, max = -1000000, sum = 0;
  int n = 0, m = 0, i = 0;

  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> m;
    if (min > m)
      min = m;
    if (max < m)
      max = m;
    sum = sum + m;
  }

  cout << min << " " << max << " " << sum << endl;

  return 0;
}


#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int argc, char *argv[]) {
  int min = 1000000, max = -1000000, sum = 0, nline, i;
  cin >> nline;
  int *arr = new int(nline);
  for (i = 0; i < nline; i++) {
    cin >> arr[i];
  }
  for (i = 0; i < nline; i++) {
    if (arr[i] <= min)
      min = arr[i];
    if (arr[i] >= max)
      max = arr[i];
  }
  for (i = 0; i < nline; i++) {
    sum += arr[i];
  }
  cout << min << " " << max << " " << sum << endl;
  delete[] arr;
  return 0;
}

#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int argc, char *argv[]) {
  long long min = 1000000, max = -1000000, sum = 0, nline, i;
  cin >> nline;
  const int n = nline;
  int arr[n];
  //  int *arr = new int(nline);
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (i = 0; i < n; i++) {
    if (arr[i] < min)
      min = arr[i];
    if (arr[i] > max)
      max = arr[i];
  }
  for (i = 0; i < n; i++) {
    sum += arr[i];
  }
  cout << min << " " << max << " " << sum << endl;
  //  delete[] arr;
  return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
  vector<int> x;
  int num;
  cin >> num;
  for (int i = 0; i < num; i++) {
    cin >> x[i];
  }
}

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

int main() {
  long long n, a[10000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cout << *min_element(a, a + n) << " " << *max_element(a, a + n) << " "
       << accumulate(a, a + n, 0LL) << endl;
}


#include <iostream>
using namespace std;
int main() {
  int n, a[100], i, x, sum = 0, max = 0, min = 10000;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
    if (a[i] > max) {
      max = a[i];
    }
    if (a[i] < min) {
      min = a[i];
    }
  }
  cout << min << " " << max << " " << sum << endl;
  // What Japanese people!?

  return 0;
}

#include <iostream>
using namespace std;
int main() {
  int n, a[10000], i, x;
  long long sum = 0, max = -1000000, min = 1000000;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
    if (a[i] > max) {
      max = a[i];
    }
    if (a[i] < min) {
      min = a[i];
    }
  }
  cout << min << " " << max << " " << sum << endl;
  // What Japanese people!?

  return 0;
}


#include <iomanip>
#include <iostream>

using namespace std;

long long a, n, smallest, biggest, sum;
char op;

int main() {

  cin >> n;

  smallest = 0;
  biggest = 0;
  sum = 0;

  for (int i = 0; i + 1 <= n; i++) {

    cin >> a;

    if (i == 0 || a < smallest) {
      smallest = a;
    }
    if (i = 0 || a > biggest) {
      biggest = a;
    }

    sum += a;
  }

  cout << smallest << " " << biggest << " " << sum << endl;

  return 0;
}

#include <iomanip>
#include <iostream>

using namespace std;

long long a, n, smallest, biggest, sum;
char op;

int main() {

  cin >> n;

  smallest = 0;
  biggest = 0;
  sum = 0;

  for (int i = 0; i + 1 <= n; i++) {

    cin >> a;

    if (i == 0 || a < smallest) {
      smallest = a;
    }
    if (i == 0 || a > biggest) {
      biggest = a;
    }

    sum += a;
  }

  cout << smallest << " " << biggest << " " << sum << endl;

  return 0;
}


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

int main() {

  int n;
  cin >> n;

  int a[10000];
  for (int i = 0; 1 < n; i++)
    cin >> a[i];

  int mn = a[0], mx = a[0];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
    sum += a[i];
  }

  cout << mn << " " << mx << " " << sum << endl;

  return 0;
}

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

int main() {

  int n;
  cin >> n;

  int a[10000];
  for (int i = 0; i < n; i++)
    cin >> a[i];

  int mn = a[0], mx = a[0];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
    sum += a[i];
  }

  cout << mn << " " << mx << " " << sum << endl;

  return 0;
}


#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define INF (1 << 30)
#define INFL (1LL << 62)
#define MOD7 1000000007
#define MOD9 1000000009
#define EPS 1e-10

#define ll long long
#define ull unsigned long long
#define all(a) (a).begin(), (a).end()

int main() {
  int n;
  vector<int> v(n);
  for (int i = 0; i < n; ++i)
    cin >> v[i];
  cout << *min_element(all(v)) << " ";
  cout << *max_element(all(v)) << " ";
  cout << accumulate(all(v), 0) << endl;

  return 0;
}

#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define INF (1 << 30)
#define INFL (1LL << 62)
#define MOD7 1000000007
#define MOD9 1000000009
#define EPS 1e-10

#define ll long long
#define ull unsigned long long
#define all(a) (a).begin(), (a).end()

int main() {
  int n;
  cin >> n;
  vector<ll> v(n);
  for (int i = 0; i < n; ++i)
    cin >> v[i];
  cout << *min_element(all(v)) << " ";
  cout << *max_element(all(v)) << " ";
  cout << accumulate(all(v), 0LL) << endl;

  return 0;
}


#include <stdio.h>

int main() {
  int n, a;
  long long sum = 0;
  int min = 10000;
  int max = 0;

  scanf("%d", &n);

  for (; n > 0; n--) {
    scanf("%d ", a);
    sum += a;
    if (a < min) {
      min = a;
    }
    if (a > max) {
      max = a;
    }
  }

  printf("%d %d %lld\\n", min, max, sum);
}

#include <limits.h>
#include <stdio.h>

int main() {
  int n, a;
  long long sum = 0;
  int min = INT_MAX;
  int max = INT_MIN;

  scanf("%d", &n);

  for (; n > 0; n--) {
    scanf("%d ", &a);
    sum += a;
    if (a < min) {
      min = a;
    }
    if (a > max) {
      max = a;
    }
  }

  printf("%d %d %lld\\n", min, max, sum);
}


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

int main() {
  long sum = 0;
  long fra[10000];
  int n;

  // 上限'n'の入力
  cin >> n;

  // 配列fra[]に値を代入、合計値sumに加算
  for (int i = 0; i < n; i++) {
    cin >> fra[i];
    sum = sum + fra[i];
  }

  while (1) {
    int flag = 0;
    // ソート本体
    for (int i = 0; i < n; i++) {
      if (fra[i - 1] > fra[i] && i > 0 && i < n) {
        swap(fra[i - 1], fra[i]);
      }
    }
    // ソート判定
    int count = 0;
    for (int i = 0; i < n; i++) {
      if (fra[i - 1] < fra[i] && i > 0) {
        count++;
      }
      if (count == n - 1) {
        flag = 1;
      }
    }

    if (flag == 1)
      break;
  }

  cout << fra[0] << " " << fra[n - 1] << " " << sum << endl;

  return 0;
}

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

int main() {
  long sum = 0;
  long fra[10000];
  int n;

  // 上限'n'の入力
  cin >> n;

  // 配列fra[]に値を代入、合計値sumに加算
  for (int i = 0; i < n; i++) {
    cin >> fra[i];
    sum = sum + fra[i];
  }

  while (1) {
    int flag = 0;
    // ソート本体
    for (int i = 0; i < n; i++) {
      if (fra[i - 1] > fra[i] && i > 0 && i < n) {
        swap(fra[i - 1], fra[i]);
      }
    }
    // ソート判定
    int count = 0;
    for (int i = 0; i < n; i++) {
      if (fra[i - 1] <= fra[i] && i > 0) {
        count++;
      }
      if (count == n - 1) {
        flag = 1;
      }
    }

    if (flag == 1)
      break;
  }

  cout << fra[0] << " " << fra[n - 1] << " " << sum << endl;

  return 0;
}


#include <stdio.h>
int main(void) {
  int n, i, x, y;
  long int z;
  scanf("%d", n);
  int a;
  x = -1000000;
  y = 1000000;
  z = 0;
  for (i = 0; i <= n; i++) {
    if (x > a) {
      x = a;
    }
    if (y < a) {
      y = a;
    }
    z = z + a;
  }
  printf("%d %d %d", x, y, z);
  return 0;
}

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

int main() {
  int n;
  int d, min, max;
  long long sum;

  scanf("%d%d", &n, &d);
  sum = min = max = d;
  while (--n > 0) {
    scanf("%d", &d);
    if (d < min)
      min = d;
    if (d > max)
      max = d;
    sum += d;
  }
  printf("%d %d %lld\\n", min, max, sum);
  return 0;
}


#include <stdio.h>

int main(void) {
  long n[10000], i, x, max, min, amount;
  max = -1000000;
  min = 1000000;
  amount = 0;
  scanf("%d\\n", &i);
  for (x = 0; x < i; x++) {
    scanf("%d ", n[x]);
  }
  for (x = 0; x < i; x++) {
    if (min > n[x]) {
      min = n[x];
    }
    if (max < n[x]) {
      max = n[x];
    }
    amount = amount + n[x];
  }
  printf("%d %d %d\\n", min, max, amount);
  return 0;
}

#include <stdio.h>
int main(void) {
  int An, i, max, min, n;
  long amount;
  max = -1000000;
  min = 1000000;
  amount = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &An);
    if (max < An) {
      max = An;
    }
    if (min > An) {
      min = An;
    }
    amount += An;
  }
  printf("%d %d %ld\\n", min, max, amount);
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  long long a[100], Min, Max, Sum;
  int n;
  cin >> n;
  Min = 10000000;
  Max = -10000000;
  Sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < Min) {
      Min = a[i];
    }
    if (a[i] > Max) {
      Max = a[i];
    }
    Sum = Sum + a[i];
  }

  cout << Min << " " << Max << " " << Sum << endl;

  return 0;
}

#include <iostream>
using namespace std;

int main() {
  long long a[10000], Min, Max, Sum;
  int n;
  cin >> n;
  Min = 1000000;
  Max = -1000000;
  Sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < Min) {
      Min = a[i];
    }
    if (a[i] > Max) {
      Max = a[i];
    }
    Sum = Sum + a[i];
  }

  cout << Min << " " << Max << " " << Sum << endl;

  return 0;
}


#include <cstdio>
#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
  long a, b[100000000];
  long max, min, sum = 0;

  cin >> a;

  for (int i = 0; i < a; i++) {
    cin >> b[i];
    if (i == 0) {
      min = b[i];
      max = b[i];
    }

    if (b[i] < min) {
      min = b[i];
    } else if (max < b[i]) {
      max = b[i];
    }

    sum += b[i];
  }
  cout << min << " " << max << " " << sum << endl;

  return 0;
}

#include <cstdio>
#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
  int a, b[10001];
  long long int max, min, sum = 0;

  cin >> a;

  for (int i = 0; i < a; i++) {
    cin >> b[i];
    if (i == 0) {
      min = b[i];
      max = b[i];
    }

    if (b[i] < min) {
      min = b[i];
    } else if (max < b[i]) {
      max = b[i];
    }

    sum += b[i];
  }
  cout << min << " " << max << " " << sum << endl;

  return 0;
}


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

int main() {
  int n;
  cin >> n;
  int a[1000];
  for (int i = 0; i < n; i++)
    cin >> a[i];
  int mn = a[0];
  int mx = a[0];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
    sum += a[i];
  }
  cout << mn << " " << mx << " " << sum << endl;
  return 0;
}

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

int main() {
  int n;
  cin >> n;
  int a[10000];
  for (int i = 0; i < n; i++)
    cin >> a[i];
  int mn = a[0];
  int mx = a[0];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
    sum += a[i];
  }
  cout << mn << " " << mx << " " << sum << endl;
  return 0;
}


#include <cstdio>

using namespace std;

int main(void) {
  int n, min = 0, max = 0, a;
  long long sum = 0;

  scanf("%d", &n);
  for (int i = 0; i < n; ++n) {
    scanf("%d", &a);
    if (max < a) {
      max = a;
    } else if (min > a) {
      min = a;
    }
    sum = sum + a;
  }
  printf("%d %d %d", min, max, sum);
  return 0;
}

#include <cstdio>
#include <iostream>

using namespace std;

int main(void) {
  int n;
  long long sum = 0, min, max, a;

  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    cin >> a;
    if (i == 0) {
      max = a;
      min = a;
    }
    if (max < a) {
      max = a;
    } else if (min > a) {
      min = a;
    }
    sum = sum + a;
  }
  cout << min << " " << max << " " << sum << "\\n";

  return 0;
}


#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main() {
  int a, c = 0;
  cin >> a;
  int e[1000];
  for (int i = 0; i < a; i++) {
    cin >> e[i];
    c = c + e[i];
  }
  sort(e, e + a);
  cout << e[0] << " " << e[a - 1] << " " << c << endl;
}

#include <bits/stdc++.h>
using namespace std;
int a[10000];
int main() {
  int n;
  cin >> n;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n);
  cout << a[0] << " " << a[n - 1] << " " << sum << endl;
}


#include <iostream>
using namespace std;
int A[10000];

int min(int n) {
  if (n == 1)
    return A[0];
  return A[n - 1] > min(n - 1) ? min(n - 1) : A[n - 1];
}

int max(int n) {
  if (n == 1)
    return A[0];
  return A[n - 1] > max(n - 1) ? A[n - 1] : max(n - 1);
}

long long sum(int n) {
  if (n == 1)
    return A[0];

  return A[n - 1] + sum(n - 1);
}

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }

  cout << min(n) << " " << max(n) << " " << sum(n) << endl;
}

#include <iostream>
using namespace std;
int A[10000];

int min(int n) {
  if (n == 1)
    return A[0];
  int t = min(n - 1);
  return A[n - 1] > t ? t : A[n - 1];
}

int max(int n) {
  if (n == 1)
    return A[0];
  int t = max(n - 1);
  return A[n - 1] > t ? A[n - 1] : t;
}

long long sum(int n) {
  if (n == 1)
    return A[0];

  return A[n - 1] + sum(n - 1);
}

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }

  cout << min(n) << " " << max(n) << " " << sum(n) << endl;
}


#include <stdio.h>

int main(void) {
  int n, a[10000], i, min = 0, max = 0, sum;

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

  sum = a[0];

  for (i = 1; i < n; i++) {
    if (a[min] > a[i]) {
      min = i;
    }
    if (a[max] < a[i]) {
      max = i;
    }
    sum = sum + a[i];
  }
  printf("%d %d %d\\n", a[min], a[max], sum);

  return 0;
}

#include <stdio.h>

int main(void) {
  long int n, a[10000], i, min = 0, max = 0, sum;

  scanf("%ld", &n);
  for (i = 0; i < n; i++) {
    scanf("%ld", &a[i]);
  }

  sum = a[0];

  for (i = 1; i < n; i++) {
    if (a[min] > a[i]) {
      min = i;
    }
    if (a[max] < a[i]) {
      max = i;
    }
    sum = sum + a[i];
  }
  printf("%ld %ld %ld\\n", a[min], a[max], sum);

  return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <ctype.h>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;

const int MAX_N = 100;
int a[MAX_N];

int min_array(int v[], int a, int b) {
  int tmp = v[a];
  for (int i = a + 1; i <= b; i++) {
    if (v[i] < tmp)
      tmp = v[i];
  }
  return tmp;
}

int max_array(int v[], int a, int b) {
  int tmp = v[a];
  for (int i = a + 1; i <= b; i++) {
    if (v[i] > tmp)
      tmp = v[i];
  }
  return tmp;
}

int sum_array(int v[], int a, int b) {
  int tmp = 0;
  for (int i = a; i <= b; i++) {
    tmp += v[i];
  }
  return tmp;
}

int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }

  int min = min_array(a, 1, n);
  int max = max_array(a, 1, n);
  int sum = sum_array(a, 1, n);

  printf("%d %d %d\\n", min, max, sum);
  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <ctype.h>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;

long long sum_array(int v[], int a, int b) {
  long long tmp = 0;
  for (int i = a; i <= b; i++) {
    tmp += v[i];
  }
  return tmp;
}

int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  sort(a, a + n);

  int min = a[0];
  int max = a[n - 1];
  long long sum = sum_array(a, 0, n - 1);

  printf("%d %d %lld\\n", min, max, sum);
  return 0;
}


#include <iostream>
using namespace std;
int main() {
  int n, i, max, min;
  long long sum = 0;
  int a[i];
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    sum = sum + a[i];
    if (i == 1) {
      max = a[i];
      min = a[i];
    } else {
      if (max < a[i]) {
        max = a[i];
      }
      if (min > a[i]) {
        min = a[i];
      }
    }
  }
  cout << min << " " << max << " " << sum << endl;
}

#include <iostream>
using namespace std;
int main() {
  int n, i, max, min;
  long long sum = 0;
  int a[100000];
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    sum = sum + a[i];
    if (i == 1) {
      max = a[i];
      min = a[i];
    } else {
      if (max < a[i]) {
        max = a[i];
      }
      if (min > a[i]) {
        min = a[i];
      }
    }
  }
  cout << min << " " << max << " " << sum << endl;
}


#include <iostream>
using namespace std;
int main() {
  int n, max, min;
  long long sum = 0;
  int a[1000];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum = sum + a[i];
    if (i == 1) {
      max = a[i];
      min = a[i];
    } else {
      if (max < a[i]) {
        max = a[i];
      }
      if (min > a[i]) {
        min = a[i];
      }
    }
  }
  cout << min << " " << max << " " << sum << endl;
}

#include <iostream>
using namespace std;
int main() {
  int n, max, min;
  long long sum = 0;
  int a[10001];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum = sum + a[i];
    if (i == 1) {
      max = a[i];
      min = a[i];
    } else {
      if (max < a[i]) {
        max = a[i];
      }
      if (min > a[i]) {
        min = a[i];
      }
    }
  }
  cout << min << " " << max << " " << sum << endl;
}


#include <iostream>
using namespace std;
const int maxint = 1000000;
const int minint = -1000000;
const int maxnum = 100000;

int n; // the number of number
int Array[maxnum];
int main() {

  cin >> n;
  if (n > 10000 || n <= 0) {
    cout << "the input data is over the limit" << endl;
    return 1;
  }
  for (int i = 0; i < n; i++) {
    cin >> Array[i];
    if (Array[i] < -1000000 || Array[i] > 1000000) {
      cout << "the input data is over the limit" << endl;
      return 1;
    }
  }
  int y_max = Array[0];
  int y_min = Array[0];
  long y_sum = 0;
  for (int y = 0; y < n; y++) {
    if (y_min < Array[y]) {
      y_min = y_min;
    } else
      y_min = Array[y];
  }
  for (int z = 0; z < n; z++) {
    if (y_max > Array[z]) {
      y_max = y_max;
    } else
      y_max = Array[z];
  }
  for (int m = 0; m < n; m++) {
    y_sum = y_sum + Array[m];
  }
  cout << y_min << ' ' << y_max << ' ' << y_sum;
  return 1;
}

#include <iostream>
using namespace std;
const int maxnum = 100000;
int n; // the number of number
int Array[maxnum];
int main() {
  cin >> n;
  int y_max;
  int y_min;
  long y_sum;
  for (int i = 0; i < n; i++) {
    cin >> Array[i];
  }
  y_max = Array[0];
  y_min = Array[0];
  y_sum = 0;
  for (int y = 0; y < n; y++) {
    if (y_min < Array[y]) {
      y_min = y_min;
    } else
      y_min = Array[y];
  }
  for (int z = 0; z < n; z++) {
    if (y_max > Array[z]) {
      y_max = y_max;
    } else
      y_max = Array[z];
  }
  for (int m = 0; m < n; m++) {
    y_sum = y_sum + Array[m];
  }
  cout << y_min << ' ' << y_max << ' ' << y_sum << endl;
  return 0;
}


#include <stdio.h>

int main() {
  int i;
  int a[10000];
  int n;
  int cnt;

  char c[2000000000];

  scanf("%d", &n);
  scanf("%s", c);

  cnt = 0;

  a[cnt] = 0;

  for (i = 0; i < 2000000000 && c[i] != '\\n'; i++) {
    if (c[i] == ' ') {
      cnt++;
      a[cnt] = 0;
    } else {
      c[i] = c[i] & 0x000F;
      if (a[cnt])
        a[cnt] *= 10;
      a[cnt] += c[i];
    }
  }

  int maxn, minn;
  maxn = minn = 0;
  cnt = 0;
  for (i = 0; i < n; i++) {
    cnt += a[i];

    if (a[i] > a[maxn])
      maxn = i;
    else if (a[i] < a[minn])
      minn = i;
  }

  printf("%d %d %d\\n", a[minn], a[maxn], cnt);
}

#include <stdio.h>

int main() {
  int i;
  int num;
  int *data;

  scanf("%d", &num);

  data = new int[num];
  for (i = 0; i < num; i++)
    scanf("%d", &data[i]);

  int min, max;
  long long int sum = 0;
  min = max = data[0];
  for (i = 0; i < num; i++) {
    if (min > data[i])
      min = data[i];
    else if (max < data[i])
      max = data[i];
    sum += (long long int)data[i];
  }

  printf("%d %d %lld\\n", min, max, sum);

  delete[] data;
  return 0;
}


#include <stdio.h>
int main(void) {
  int a[10000] = {0}, i, k, max, small, gou;
  scanf("%d", &i);
  for (k = 0; k <= i; k++) {
    scanf("%d", a[k]);
  }
  max = a[0];
  small = a[0];
  for (k = 0; k <= i; k++) {

    if (max < a[k]) {
      max = a[k];
    }

    if (small > a[k]) {
      small = a[k];
    }
    gou += a[k];
  }

  printf("%d %d %d\\n", small, max, gou);
}

#include <stdio.h>
int main(void) {
  int a[10000] = {0}, i, k, small, max;
  long long gou;
  gou = 0;
  scanf("%d", &i);
  for (k = 0; k < i; k++) {
    scanf("%d", &a[k]);
  }
  small = a[0];
  max = a[0];

  for (k = 0; k < i; k++) {

    if (small > a[k]) {
      small = a[k];
    }

    if (max < a[k]) {
      max = a[k];
    }

    gou += a[k];
  }

  printf("%d %d %lld\\n", small, max, gou);
}


#include <iostream>
using namespace std;
int main(void) {
  int n, a[1001] = {0}; // 10001回
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long min = 1000000, max = -1000000, sum = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] < min) {
      min = a[i];
    }
    if (a[i] > max) {
      max = a[i];
    }
    sum = sum + a[i];
  }
  cout << min << " " << max << " " << sum;
  cout << endl;
}

#include <iostream>
using namespace std;
int main(void) {
  int n, a[10001] = {0}; // 10001回
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int min = 1000000, max = -1000000, sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < min) {
      min = a[i];
    }
    if (a[i] > max) {
      max = a[i];
    }
    sum = sum + a[i];
  }
  cout << min << " " << max << " " << sum << endl;
}


#include <stdio.h>
int main() {
  int n, i, mx, mn, sum;
  scanf("%d", &n);
  int a[1000];
  for (i = 0; i < n; i++) {
    scanf("%d\\n", &a[i]);
  }
  sum = a[0], mn = a[0], mx = a[0];
  for (i = 1; i < n; i++) {
    if (a[i] > mx) {
      mx = a[i];
    } else if (a[i] < mn) {
      mn = a[i];
    }
    sum += a[i];
  }
  printf("%d %d %d\\n", mn, mx, sum);
  return 0;
}

#include <stdio.h>
int main() {
  int n, i;
  long mx, mn;
  long sum = 0;
  scanf("%d", &n);
  long a[100000];
  for (i = 0; i < n; i++) {
    scanf("%ld", &a[i]);
  }
  sum = a[0], mn = a[0], mx = a[0];
  for (i = 1; i < n; i++) {
    if (a[i] > mx) {
      mx = a[i];
    } else if (a[i] < mn) {
      mn = a[i];
    }
    sum += a[i];
  }
  printf("%ld %ld %ld\\n", mn, mx, sum);
  return 0;
}


#include <iostream>
using namespace std;

int main(void) {
  int n, max, min, sum = 0;
  cin >> n;
  double *a = new double[n];
  cin >> a[n];
  max = a[0];
  min = a[0];

  for (int i = 0; i < n; i++) {
    if (max < a[i]) {
      max = a[i];
    }
    if (min > a[i]) {
      min = a[i];
    }
    sum += a[i];
  }
  return 0;
}

#include <iostream>
using namespace std;

int main(void) {
  int n, max, min;
  long sum = 0;
  cin >> n;
  double *a = new double[n];
  for (int j = 0; j < n; j++) {
    cin >> a[j];
  }

  min = a[0];
  max = a[0];

  for (int i = 0; i < n; i++) {
    if (min > a[i]) {
      min = a[i];
    }
    if (max < a[i]) {
      max = a[i];
    }
    sum += a[i];
  }
  delete[] a;
  cout << min << " " << max << " " << sum << endl;
  return 0;
}


#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

int main(void) {
  string input;

  int n;
  getline(cin, input);
  sscanf(input.c_str(), "%d\\n", &n);

  int *a = new int[n];

  getline(cin, input);
  const char *p = input.c_str();

  for (int i = 0; i < n; i++) {
    sscanf(p, "%d", a + i);

    while (*p != ' ' && *p != '\\n')
      p++;
    p++;
  }

  int min = a[0];
  int max = a[0];
  int sum = 0;

  for (int i = 0; i < n; i++) {
    if (min > a[i])
      min = a[i];
    if (max < a[i])
      max = a[i];
    sum += a[i];
  }

  delete[] a;

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

  return (0);
}

#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

int main(void) {
  string input;

  int n;
  getline(cin, input);
  sscanf(input.c_str(), "%d\\n", &n);

  int *a = new int[n];

  getline(cin, input);
  const char *p = input.c_str();

  for (int i = 0; i < n; i++) {
    sscanf(p, "%d", a + i);

    if (i == n - 1)
      break;
    while (*p != ' ')
      p++;
    p++;
  }

  long int min = a[0];
  long int max = a[0];
  long int sum = 0;

  for (int i = 0; i < n; i++) {
    if (min > a[i])
      min = a[i];
    if (max < a[i])
      max = a[i];
    sum += a[i];
  }

  delete[] a;

  printf("%ld %ld %ld\\n", min, max, sum);

  return (0);
}


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

#define PI 3.14159265358979323

int main(int argc, char *argv[]) {
  int N;
  long a[100000000];
  int sum = 0;
  cin >> N;

  for (int i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }

  sort(a, a + N);
  printf("%ld %ld %ld\\n", a[0], a[N - 1], sum);
  return 0;
}

#include <iostream>

using namespace std;

int main() {
  int num = 0;
  int a[10000] = {};
  long int max = -1000000, min = 1000000, sum = 0;

  cin >> num;

  for (int i = 0; i < num; i++) {
    cin >> a[i];

    if (max < a[i])
      max = a[i];
    if (min > a[i])
      min = a[i];

    sum += a[i];
  }

  cout << min << " " << max << " " << sum << endl;

  return 0;
}


#include <iostream>
using namespace std;

int main() {

  int n, x, min, max, sum = 0;

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> x;
    sum += x;

    if (i = 0) {
      min = x;
      max = x;
    } else {
      if (min > x) {
        min = x;
      }
      if (max < x) {
        max = x;
      }
    }
  }

  cout << min << ' ' << max << ' ' << sum << endl;

  return 0;
}

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

int main() {
  int num;
  cin >> num;

  int max = -1000001, min = 1000001, data;
  long long sum = 0;
  for (int i = 0; i < num; i++) {
    cin >> data;
    if (min > data) {
      min = data;
    }
    if (max < data) {
      max = data;
    }
    sum += data;
  }

  cout << min << " " << max << " " << sum << endl;
  // printf("%d %d %ld\\n", min, max, sum);

  return 0;
}


#include <algorithm>
#include <cassert>
#include <climits>
#include <iostream>
using namespace std;

const int MAX = 1000000;

int main() {
  int n, x, sum = 0, maxi = -MAX, mini = MAX;
  cin >> n;
  //  assert(n <= 10000);
  for (int i = 0; i < n; i++) {
    cin >> x;
    maxi = max(maxi, x);
    mini = min(mini, x);
    assert((long long)sum + (long long)x < INT_MAX);
    sum += x;
  }
  cout << mini << ' ' << maxi << ' ' << sum << endl;
}

#include <algorithm>
#include <cassert>
#include <climits>
#include <iostream>
using namespace std;

const int MAX = 1000000;

int main() {
  long long n, x, sum = 0, maxi = -MAX, mini = MAX;
  cin >> n;
  //  assert(n <= 10000);
  for (int i = 0; i < n; i++) {
    cin >> x;
    maxi = max(maxi, x);
    mini = min(mini, x);
    // assert((long long)sum + (long long)x < INT_MAX);
    sum += x;
  }
  cout << mini << ' ' << maxi << ' ' << sum << endl;
}


#include <iostream>
using namespace std;

int main() {
  int n, i, j, x[1000];
  int min, max, l;
  l = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x[i];
  }
  min = max = x[0];
  for (i = 0; i < n; i++) {
    if (max < x[i]) {
      max = x[i];
    } else if (min > x[i]) {
      min = x[i];
    }
    l += x[i];
  }
  cout << min << ' ' << max << ' ' << l << endl;
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  long n, i, x[10000], mi, ma, l;
  l = 0;
  cin >> n;
  mi = 1000000;
  ma = -1000000;
  for (i = 0; i < n; i++) {
    cin >> x[i];
    ma = max(ma, x[i]);
    mi = min(mi, x[i]);
    l += x[i];
  }
  cout << mi << ' ' << ma << ' ' << l << endl;
  return 0;
}


#include <algorithm>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
  while (true) {
    int n, c = 0;
    cin >> n;
    int a[10001];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      c = c + a[i];
    }

    sort(a, a + n);
    cout << a[0] << " " << a[n - 1] << " " << c << endl;
  }
}

#include <algorithm>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {

  long int n, c = 0;
  cin >> n;
  int a[10005];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    c = c + a[i];
  }

  sort(a, a + n);
  cout << a[0] << " " << a[n - 1] << " " << c << endl;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  int sum = 0;
  for (int i = 0; i < n; n++) {
    cin >> A.at(i);
    sum += A.at(i);
  }
  sort(A.begin(), A.end());
  cout << A.at(0) << " " << A.at(n - 1) << " " << sum << endl;
}

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

long long max(int a, int b) {
  if (a >= b)
    return a;
  else
    return b;
}

long long min(int a, int b) {
  if (a <= b)
    return a;
  else
    return b;
}

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++)
    cin >> a.at(i);

  long long mi = a.at(0), ma = a.at(0), su = a.at(0);
  for (int i = 1; i < n; i++) {
    mi = min(mi, a.at(i));
    ma = max(ma, a.at(i));
    su += a.at(i);
  }
  cout << mi << " " << ma << " " << su << endl;
  return 0;
}


#include <cstdio>

int main() {
  int n, a[10000];
  scanf("%d\\n", n);
  for (int i = 0; i < n; i++) {
    scanf("%d ", a[i]);
  }
  int max, min, sum;
  max = a[0];
  min = a[0];
  sum = a[0];
  for (int j = 1; j < n; j++) {
    if (max < a[j]) {
      max = a[j];
    }
    if (min > a[j]) {
      min = a[j];
    }
    sum += a[j];
  }
  printf("%d %d %d", min, max, sum);
  return 0;
}

#include <cstdio>
#include <iostream>

using namespace std;

int main() {
  int n, a;
  int maxa, mina;
  long long sum;
  maxa = -1000001;
  mina = 1000001;
  sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (maxa < a) {
      maxa = a;
    }
    if (mina > a) {
      mina = a;
    }
    sum += a;
  }
  printf("%d %d %lld\\n", mina, maxa, sum);
  return 0;
}


#include <iostream>
using namespace std;
int main() {
  int n, i, max, min;
  long long sum = 0;
  int a[100];
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    sum = sum + a[i];
    if (i == 1) {
      max = a[i];
      min = a[i];
    } else {
      if (max < a[i]) {
        max = a[i];
      }
      if (min > a[i]) {
        min = a[i];
      }
    }
  }
  cout << min << " " << max << " " << sum << endl;
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  int n, i, max, min;
  long long sum = 0;
  int a[10000];
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    sum = sum + a[i];
    if (i == 1) {
      max = a[i];
      min = a[i];
    } else {
      if (max < a[i]) {
        max = a[i];
      }
      if (min > a[i]) {
        min = a[i];
      }
    }
  }
  cout << min << " " << max << " " << sum << endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {

  while (1) {

    int a, b;
    string op;
    cin >> a >> op >> b;
    if (op == "?")
      break;

    int ans;
    if (op == "+")
      ans = a + b;
    if (op == "-")
      ans = a - b;
    if (op == "*")
      ans = a * b;
    if (op == "/")
      ans = a / b;

    cout << ans << endl;
  }
}

#include <bits/stdc++.h>

using namespace std;

int main() {

  int n;
  cin >> n;
  int a[10000];
  for (int i = 0; i < n; i++)
    cin >> a[i];

  int mn = a[0], mx = a[0];

  long long sum = 0;

  for (int i = 0; i < n; i++) {

    mn = min(mn, a[i]);

    mx = max(mx, a[i]);
    sum += a[i];
  }

  cout << mn << " " << mx << " " << sum << endl;
}


#include <iostream>
#include <stdio.h>

#include <algorithm>
#include <numeric>

int main() {
  int n;
  std::int64_t a[10000];
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> a[i];
  }
  std::int64_t sum = 0;
  auto minmax = std::minmax(a + 0, a + n - 1);
  sum = std::accumulate(a + 0, a + n, 0);
  printf("%lld %lld %lld\\n", *minmax.first, *minmax.second, sum);
}

#include <iostream>
#include <stdio.h>

#include <algorithm>
#include <numeric>
#include <vector>

int main() {
  int n;
  std::vector<int64_t> a(10000);
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> a[i];
  }
  std::int64_t sum = 0;
  /*auto [min, max]*/ auto minmax =
      std::minmax_element(a.begin(), a.begin() + n);
  sum = std::accumulate(a.begin(), a.end(), (std::int64_t)0);
  printf("%lld %lld %lld\\n", *minmax.first, *minmax.second, sum);
}


#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
#define nMAX 10000
#define aMAX 1000000

int main(void) {
  int n, a[aMAX], minv, maxv, sum;

  do {
    cin >> n;
  } while (n >= 0 || n > nMAX);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  maxv = -1 * aMAX;
  minv = a[0];

  for (int i = 1; i < n; i++) {
    maxv = max(maxv, a[i]);
    minv = min(minv, a[i]);
    sum += a[i];
  }

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

  return 0;
}

#include <algorithm>
#include <cstdio>
#include <iostream>
#define nMAX 10000
#define aMAX 1000000
using namespace std;

int main(void) {
  int n, a[nMAX];
  long maxv, minv, sum;

  do {
    cin >> n;
  } while (n <= 0 || n > nMAX);

  while (1) {
    int flag = 1;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] > aMAX || a[i] < -1 * aMAX)
        flag = 0;
    }
    if (flag == 1)
      break;
  }

  maxv = -1 * aMAX;
  minv = a[0];

  for (int i = 0; i < n; i++) {
    maxv = max(maxv, (long)a[i]);
    minv = min(minv, (long)a[i]);
    sum += a[i];
  }

  cout << minv << " " << maxv << " " << sum << endl;

  return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
using namespace std;
int main() {
  int n, sum = 0, a[100000000];
  cin >> n;
  rep(i, n) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n);
  cout << a[0] << ' ' << a[n - 1] << ' ' << sum << endl;
  return 0;
}

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
using namespace std;
int main() {
  long long n, sum = 0, a[10000];
  cin >> n;
  rep(i, n) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n);
  cout << a[0] << ' ' << a[n - 1] << ' ' << sum << endl;
  return 0;
}


#include <iostream>
#include <vector>

int main() {
  int n, min, max, sum;
  std::vector<int> v;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> v[i];
  }
  min = v[0];
  max = v[0];
  sum = 0;
  for (int j = 0; j < n; j++) {
    if (v[j] < min) {
      min = v[j];
    }
    if (max < v[j]) {
      max = v[j];
    }
    sum += v[j];
  }
  std::cout << min << " " << max << " " << sum << std::endl;
  return 0;
}

#include <iostream>
#include <vector>

int main() {
  int n, min, max;
  long long sum;
  // std::vector<int> v;
  std::cin >> n;
  int v[n];

  for (int i = 0; i < n; i++) {
    std::cin >> v[i];
  }
  min = v[0];
  max = v[0];
  sum = 0;
  for (int j = 0; j < n; j++) {
    if (v[j] < min) {
      min = v[j];
    }
    if (max < v[j]) {
      max = v[j];
    }
    sum += v[j];
  }
  std::cout << min << " " << max << " " << sum << std::endl;
  return 0;
}


#include <iostream>
using namespace std;
int main() {
  int n, i, max, min;
  long long sum = 0;
  int a[i];
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    sum = sum + a[i];
    if (i == 1) {
      max = a[i];
      min = a[i];
    } else {
      if (max < a[i]) {
        max = a[i];
      }
      if (min > a[i]) {
        min = a[i];
      }
    }
  }
  cout << min << " " << max << " " << sum << endl;
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  int n, i, max, min;
  long long sum = 0;
  int a[100000];
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    sum = sum + a[i];
    if (i == 1) {
      max = a[i];
      min = a[i];
    } else {
      if (max < a[i]) {
        max = a[i];
      }
      if (min > a[i]) {
        min = a[i];
      }
    }
  }
  cout << min << " " << max << " " << sum << endl;
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  long a, h, l, s;
  cin >> a;
  h = a;
  l = a;
  s = 0;
  while (a != 0) {
    s = s + a;
    if (h < a) {
      h = a;
    } else if (a < s) {
      s = a;
    }
    cin >> a;
  }
  cout << l << " " << h << " " << s << endl;
  return 0;
}

#include <iomanip>
#include <iostream>
#include <vector>

int main() {
  long long int n, a, sum, max, low;
  max = -1000000;
  low = 1000000;
  sum = 0;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> a;
    sum = sum + a;
    if (max < a) {
      max = a;
    }
    if (low > a) {
      low = a;
    }
  }
  std::cout << low << " " << max << " " << sum << std::endl;
}


#include <iostream>
using namespace std;

int main(void) {
  int n, i, a[1000], max, min, sum;

  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sum = a[1];
  min = a[1];
  max = a[1];
  for (i = 2; i <= n; i++) {
    sum = sum + a[i];
    if (a[i] < min)
      min = a[i];
    if (a[i] > max)
      max = a[i];
  };
  cout << min << " " << max << " " << sum << endl;

  return 0;
}

#include <iostream>
using namespace std;

int main(void) {
  long n, i, a[10001], max, min, sum;

  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sum = a[1];
  min = a[1];
  max = a[1];
  for (i = 2; i <= n; i++) {
    sum = sum + a[i];
    if (a[i] < min)
      min = a[i];
    if (a[i] > max)
      max = a[i];
  };
  cout << min << " " << max << " " << sum << endl;

  return 0;
}


#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n, sum;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  cout << v[0] << " " << v[n - 1] << " ";
  for (int x : v) {
    sum += x;
  }
  cout << sum << endl;
  return 0;
}

#include <cmath>
#include <iostream>

using namespace std;

int main(void) {

  int n;
  cin >> n;

  long min = 1000000;
  long max = -1000000;
  long sum = 0;

  int a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    sum += a;
    if (min > a)
      min = a;
    if (max < a)
      max = a;
  }

  cout << min << " " << max << " " << sum << endl;

  return 0;
}


#include <iostream>
using namespace std;
int main(void) {
  long long a[1000] = {0};
  int n;
  long long min;
  long long max;
  int i;
  long long sum = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  min = a[0];
  for (i = 0; i < n; i++) {
    if (min > a[i])
      min = a[i];
  }
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  max = a[0];
  for (i = 0; i < n; i++) {
    if (max < a[i])
      max = a[i];
  }
  for (i = 0; i < n; i++)
    sum = sum + a[i];
  cout << min;
  cout << " ";
  cout << max;
  cout << " ";
  cout << sum;
  cout << endl;
}

#include <iostream>
using namespace std;
int main(void) {
  long long a[10001] = {0};
  int n;
  long long min;
  long long max;
  int i;
  long long sum = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  min = a[0];
  for (i = 0; i < n; i++) {
    if (min > a[i])
      min = a[i];
  }
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  max = a[0];
  for (i = 0; i < n; i++) {
    if (max < a[i])
      max = a[i];
  }
  for (i = 0; i < n; i++)
    sum = sum + a[i];
  cout << min;
  cout << " ";
  cout << max;
  cout << " ";
  cout << sum;
  cout << endl;
}


#include <iostream>
using namespace std;
int main() {
  int n, i, a[1000], b, c, d, min = 1000000, max = -1000000, sum = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < min) {
      min = a[i];
    }
    if (a[i] > max) {
      max = a[i];
    }
    sum += a[i];
  }
  cout << min << " " << max << " " << sum << endl;
}

#include <iostream>
using namespace std;
int main() {
  long long n, i, a[10000], min = 1000000, max = -1000000, sum = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < min) {
      min = a[i];
    }
    if (a[i] > max) {
      max = a[i];
    }
    sum += a[i];
  }
  cout << min << " " << max << " " << sum << endl;
}


#include <iostream>
using namespace std;

int main() {
  int i = 0, n, a;
  long min = 100000, max = -100000, total = 0;

  cin >> n;

  while (i < n) {
    cin >> a;

    if (i = 0)
      min = max = a;
    if (min > a)
      min = a;
    if (max < a)
      max = a;
    total += a;
    i++;
  }
  cout << min << " " << max << " " << total << endl;

  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int i = 0, n, a;
  long min = 1000000, max = -1000000, total = 0;

  cin >> n;

  while (i < n) {
    cin >> a;

    if (min > a)
      min = a;
    if (max < a)
      max = a;
    total += a;
    i++;
  }
  cout << min << " " << max << " " << total << endl;

  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int n, a[n], i, j;
  cin >> n;
  for (i = 1; i <= n; i++)
    cin >> a[i];

  for (j = n; j >= 1; j--) {
    if (j != 1)
      cout << a[j] << " ";
    else
      cout << a[j] << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;

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

  for (i = 0; i <= n - 1; i++)
    cin >> a[i];
  for (i = n - 1; i > 0; i--)
    cout << a[i] << " ";
  cout << a[0] << endl;
  return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
#define MAX_N 100

int A[MAX_N];
int main(int argc, char *argv[]) {
  int N;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  for (int i = N - 1; i >= 0; i++) {
    cout << A[i];
    if (i != 0)
      cout << " ";
  }
  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
#define MAX_N 100

int A[MAX_N];
int main(int argc, char *argv[]) {
  int N;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  for (int i = N - 1; i >= 0; i--) {
    cout << A[i];
    if (i != 0)
      cout << " ";
    if (i == 0)
      cout << endl;
  }
  return 0;
}


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

int main() {
  std::vector<int> v;
  int N;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    int tmp;
    cin >> tmp;
    v.push_back(tmp);
  }
  for (int i = N - 1; i >= 0; i++) {
    cout << v[i];
    if (i == 0)
      cout << endl;
    else
      cout << " ";
  }
}

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

int main() {
  vector<int> v;
  int N;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    int tmp;
    cin >> tmp;
    v.push_back(tmp);
  }
  for (int i = N - 1; i >= 0; i--) {
    cout << v[i];
    if (i == 0)
      cout << endl;
    else
      cout << " ";
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int n, i = 0;
  int a[100];
  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> a[i];
  }

  for (i = n - 1; i >= 0; i--) {
    cout << a[i];
    if (i != n - 1)
      cout << " ";
  }

  while (1)
    ;

  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int n, i = 0;
  int a[100];
  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> a[i];
  }

  for (i = n - 1; i >= 0; i--) {
    cout << a[i];
    if (i != 0)
      cout << " ";
  }

  cout << endl;

  return 0;
}


#include <cstdlib>
#include <iostream>

using namespace std;

int main() {
  size_t n;
  int *ptr, *a, i;
  cin >> n;
  ptr = (int *)calloc(n, sizeof(int));
  if (ptr == NULL)
    exit(EXIT_FAILURE);
  (int)n;
  for (i = 1; i <= n; i++) {
    cin >> *a;
    a++;
  }
  for (i = n; i >= 1; i--) {
    cout << *(a + i - 1) << " ";
  }
  cout << "\\b\\n";
}

#include <iostream>
#include <stdlib.h>

using namespace std;

int main() {
  size_t n;
  int *ptr, *a, i;
  cin >> n;
  ptr = (int *)calloc(n, sizeof(int));
  if (ptr == NULL)
    exit(EXIT_FAILURE);
  a = ptr;
  for (i = 0; i < (int)n; i++) {
    cin >> *(a + i);
  }
  for (i = (int)n - 1; i >= 0; i--) {
    cout << *(a + i);
    if (i > 0)
      cout << " ";
  }
  cout << endl;
}


#include <iostream>
using namespace std;

int main() {
  int n;
  cin >> n;
  int work[n];
  for (int i = n - 1; n >= 0; i--) {
    cout << work[i] << " ";
  }
  cout << "\\b" << endl;
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int n;
  cin >> n;
  int work[n];
  for (int i = 0; i < n; i++) {
    cin >> work[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    cout << work[i];
    if (i != 0) {
      cout << " ";
    }
  }
  cout << endl;
  return 0;
}


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

int main() {
  int H, W, X;
  while (1) {
    cin >> H >> W;
    if (H == 0 && W == 0)
      break;
    else
      for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
          X = i + j;
          if (X % 2 == 0)
            cout << "#";
          else
            cout << ".";
        }
        cout << endl;
      }
    cout << endl;
  }
  return 0;
}

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

int main() {
  int n;
  cin >> n;
  int a[100];
  for (int i = 0; i < n; i++)
    cin >> a[i];
  for (int j = 0; j < n - 1 - j; j++)
    swap(a[j], a[n - 1 - j]);
  for (int k = 0; k < n; k++)
    if (k == 0)
      cout << a[k];
    else
      cout << " " << a[k];
  cout << endl;

  return (0);
}


#include <iostream>
using namespace std;
int main() {
  int a[100], size;
  cin >> size;
  for (int i = 0; i < size; i++)
    cin >> a[i];
  for (int i = size - 1; i >= 0; i++)
    cout << a[i] << " ";
  cout << endl;
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  int a[100], size;
  cin >> size;
  for (int i = 0; i < size; i++)
    cin >> a[i];

  for (int i = size - 1; i > 0; i--)
    cout << a[i] << " ";
  cout << a[0] << endl;
  return 0;
}


#include <iostream>
// #include <stdio.h>
using namespace std;

int main() {
  int n, m;
  int a[10];
  cin >> n;
  // a = (int *)malloc(sizeof(int) * n);

  for (int i = 0; i < n; i++) {
    cin >> m;
    a[i] = m;
  }

  for (int i = n - 1; i > 0; i--) {
    cout << a[i] << " ";
  }
  cout << a[0];
  cout << endl;
  return 0;
}

#include <iostream>
// #include <stdio.h>
using namespace std;

int main() {
  int n, m;
  int a[1000];
  cin >> n;
  // a = (int *)malloc(sizeof(int) * n);

  for (int i = 0; i < n; i++) {
    cin >> m;
    a[i] = m;
  }

  for (int i = n - 1; i > 0; i--) {
    cout << a[i] << " ";
  }
  cout << a[0];
  cout << endl;
  return 0;
}


#include <cstdio>
int main(void) {
  int n;
  int a[1000];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = n - 1; i > 0; i++) {
    printf("%d ", a[i]);
  }
  printf("%d\\n", a[0]);
  return 0;
}

#include <cstdio>
int main(void) {
  int n;
  int a[1000];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = n - 1; i > 0; i--) {
    printf("%d ", a[i]);
  }
  printf("%d\\n", a[0]);
  return 0;
}


#include <cstdio>
int main(void) {
  // Here your code !
  int n;
  scanf("%d", &n);
  int nums[n];

  for (int i = 0; i < n; i++) {
    scanf("%d", nums[i]);
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", nums[n - 1 - i]);
    if (i == n - 1) {
      printf("%d\\n", nums[n - 1 - i]);
    }
  }
  return 0;
}

#include <cstdio>
int main(void) {
  // Here your code !
  int n;
  scanf("%d", &n);
  int nums[n];

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

    if (i == n - 1) {
      printf("%d\\n", nums[n - 1 - i]);
    } else {
      printf("%d ", nums[n - 1 - i]);
    }
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {

  int n;
  int *a;

  cin >> n;
  for (int i = n - 1; i >= 0; i--) {
    cin >> a[i];
  }

  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}

#include <iostream>
using namespace std;

int main() {

  int n;
  int a[100];

  cin >> n;
  for (int i = n - 1; i >= 0; i--) {
    cin >> a[i];
  }

  for (int i = 0; i < n; i++) {
    if (i == n - 1)
      cout << a[i] << endl;
    else
      cout << a[i] << " ";
  }
}


#include <iostream>
using namespace std;

int main() {
  int i, n, b[n];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> b[i];
  }

  for (i = n - 1; i >= 0; i--) {
    cout << b[i] << ' ';
  }

  cout << endl;
}

#include <iostream>
using namespace std;

int main() {
  int n;
  cin >> n;
  int i, b[n];

  for (i = 0; i < n; i++) {
    cin >> b[i];
  }

  for (i = n - 1; i >= 0; i--) {
    cout << b[i];
    if (i != 0)
      cout << " ";
  }

  cout << endl;
}


#include <iostream>
using namespace std;

int main() {
  int n;
  cin >> n;
  int day[n];

  for (int i = 0; i < n; i++) {
    cin >> day[i];
  }

  for (int i = n - 1;; i--) {
    if (i < 0) {
      cout << day[i];
    }
    cout << day[i] << " ";
  }
  cout << endl;
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int n;
  cin >> n;
  int day[n];

  for (int i = 0; i < n; i++) {
    cin >> day[i];
  }

  for (int i = n - 1; i >= 0; i--) {
    cout << day[i];

    if (i == 0) {
      cout << endl;
    } else {
      cout << " ";
    }
  }
  return 0;
}


#include <iostream>
using namespace std;
int main() {
  int n, a[100], i;
  for (;;) {
    cin >> n;
    for (i = n - 1; i >= 0; i--) {
      cin >> a[i];
    }
    for (i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  }
}

#include <iostream>
using namespace std;
int main() {
  int n, a[100], i;
  cin >> n;
  for (i = n - 1; i >= 0; i--) {
    cin >> a[i];
  }
  for (i = 0; i < n - 1; i++) {
    cout << a[i] << " ";
  }
  cout << a[i];
  cout << endl;
}


#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
int main() {
  while (1) {
    int n, i;
    cin >> n;
    // int  chain[100];
    //  int *chain = new int[n];
    //  delete [] chain;

    vector<int> chain(n); // vector????????£??????????????????

    // for ( i = n - 1; i >= 0;
    // i--)????????£???????????????????????£??????????????????
    for (i = 0; i < n; i++) {
      cin >> chain[i];
    }
    reverse(chain.begin(), chain.end()); //??????????????????

    for (i = 0; i < n; i++)
      cout << chain.at(i) << " ";
    cout << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  int n, i, chain[100];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> chain[i];
  }
  for (i = n - 1; i >= 0; i--) {
    cout << chain[i];
    if (i == 0)
      break;
    cout << " ";
  }
  cout << endl;
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int n, i;
  cin >> n;
  int x[n];
  for (i = 0; i < n; i++) {
    cin >> x[i];
  }
  i = n;
  while (true) {
    i--;
    cout << x[i] << " ";
    if (i == 1)
      break;
  }
  cout << x[i - 1] << endl;
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++)
    cin >> a[i];
  for (int i = n - 1; i > 0; i--)
    cout << a[i] << " ";
  cout << a[0] << endl;
}


#include <iostream>
using namespace std;
int main(void) {
  int n, a[5] = {0};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i == n - 1) {
      cout << a[i];
    } else {
      cout << " " << a[i];
    }
  }
  cout << endl;
}

#include <iostream>
using namespace std;
int main(void) {
  int n, a[100] = {0};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i == n - 1) {
      cout << a[i];
    } else {
      cout << " " << a[i];
    }
  }
  cout << endl;
}