#include <bits/stdc++.h>
using namespace std;
const unsigned long long int M = 1000000007;
const long long int mod = 1e9 + 7;
const long long inff = 2e18;
const long long int inf = 2e9;
void dijkstra(long long int s, vector<long long int> &d,
              vector<long long int> &p);
void path(vector<long long int> &v, long long int d);
bool sortbysec(const pair<long long int, long long int> &a,
               const pair<long long int, long long int> &b);
bool palindrome(string s);
bool checkpalindrome(string s);
void MergeSort(long long int a[], long long int start, long long int end);
void Merge(long long int a[], long long int start, long long int mid,
           long long int end);
bool isVowel(char ch);
template <typename T>
void printVec(vector<T> &v);
string toLwr(string s);
string toUpr(string s);
vector<long long int> findFactors(long long int n);
long long int modpow(long long int a, long long int b, long long int m);
bool isprime(long long int x);
void combinatorics();
long long int nCr(long long int x, long long int y);
long long int bitCount(long long n);
bool isPowerOf2(long long int n);
long long int gcd(long long int a, long long int b);
long long int lcm(long long int a, long long int b);
long long int powrec(long long int a, long long int b);
long long int powitr(long long int a, long long int b);
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
void solve() {
  string s;
  cin >> s;
  long long int n;
  n = s.length();
  long long int f = 0, sv = 0;
  for (long long int i = 0; i < n; i++) {
    if (s[i] == '4') f++;
    if (s[i] == '7') sv++;
  }
  if (f == 0 && sv == 0)
    cout << -1 << endl;
  else {
    if (f > sv)
      cout << 4 << endl;
    else if (sv > f)
      cout << 7 << endl;
    else
      cout << 4 << endl;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
const long long int NN = 1e5 + 5;
vector<pair<long long int, long long int>> adj[NN];
vector<long long int> d, p;
void dijkstra(long long int s, vector<long long int> &d,
              vector<long long int> &p) {
  long long int n = NN;
  d.assign(n, inf);
  p.assign(n, -1);
  d[s] = 0;
  priority_queue<pair<long long int, long long int>,
                 vector<pair<long long int, long long int>>,
                 greater<pair<long long int, long long int>>>
      q;
  q.push({0, s});
  while (!q.empty()) {
    long long int v = q.top().second;
    long long int d_v = q.top().first;
    q.pop();
    if (d_v != d[v]) continue;
    for (auto edge : adj[v]) {
      long long int to = edge.first;
      long long int len = edge.second;
      if (d[v] + len < d[to]) {
        d[to] = d[v] + len;
        p[to] = v;
        q.push({d[to], to});
      }
    }
  }
}
void path(vector<long long int> &v, long long int d) {
  if (p[d] != -1) path(v, p[d]);
  v.push_back(d);
}
bool sortbysec(const pair<long long int, long long int> &a,
               const pair<long long int, long long int> &b) {
  return (a.second < b.second);
}
bool palindrome(string s) {
  string t = s;
  reverse((t).begin(), (t).end());
  return (t == s);
}
bool checkpalindrome(string s) {
  for (long long int i = 0; i <= s.length(); i++)
    if (s[i] != s[s.length() - 1 - i]) return false;
  return true;
}
const long long int infms = 2e9;
long long int inversions = 0;
void Merge(long long int a[], long long int start, long long int mid,
           long long int end) {
  long long int n1 = mid - start + 1;
  long long int n2 = end - mid;
  long long int left[n1 + 2];
  long long int right[n2 + 2];
  left[n1 + 1] = infms;
  right[n2 + 1] = infms;
  for (long long int i = 1; i <= n1; i++) left[i] = a[start + i - 1];
  for (long long int i = 1; i <= n2; i++) right[i] = a[mid + i];
  long long int x = 1, y = 1;
  for (long long int k = start; k <= end; k++)
    if (left[x] <= right[y]) {
      a[k] = left[x];
      x++;
    } else {
      inversions += (1 + n1 - x);
      a[k] = right[y];
      y++;
    }
}
void MergeSort(long long int a[], long long int start, long long int end) {
  if (start < end) {
    long long int mid = (start + end) / 2;
    MergeSort(a, start, mid);
    MergeSort(a, mid + 1, end);
    Merge(a, start, mid, end);
  }
}
bool isVowel(char ch) {
  string s = "aeiouAEIOU";
  for (char c : s)
    if (c == ch) return true;
  return false;
}
template <typename T>
void printVec(vector<T> &v) {
  for (auto t : v) cout << t << " ";
  cout << endl;
}
void printArr(long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
}
string toLwr(string s) {
  transform(s.begin(), s.end(), s.begin(), ::tolower);
  return s;
}
string toUpr(string s) {
  transform(s.begin(), s.end(), s.begin(), ::toupper);
  return s;
}
vector<long long int> findFactors(long long int n) {
  vector<long long int> v;
  for (long long int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      if (i * i != n) {
        v.push_back(n / i);
      }
    }
  }
  return v;
}
long long int modpow(long long int a, long long int b, long long int m) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
bool isprime(long long int x) {
  if (x < 2) return false;
  if (x < 4) return true;
  if (!(x & 1)) return false;
  for (long long int i = 3; i * i <= x; i += 2)
    if (x % i == 0) return false;
  return true;
}
const long long int MOD = 1e9 + 7;
const long long int MXX = 1e5 + 69;
long long int fact[MXX], invfact[MXX];
long long int modinv(long long int k) { return modpow(k, MOD - 2, MOD); }
void combinatorics() {
  fact[0] = fact[1] = 1;
  for (long long int i = 2; i < MXX; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= MOD;
  }
  invfact[MXX - 1] = modinv(fact[MXX - 1]);
  for (long long int i = MXX - 2; i >= 0; i--) {
    invfact[i] = invfact[i + 1] * (i + 1);
    invfact[i] %= MOD;
  }
}
long long int nCr(long long int x, long long int y) {
  if (y > x) return 0;
  long long int num = fact[x];
  num *= invfact[y];
  num %= MOD;
  num *= invfact[x - y];
  num %= MOD;
  return num;
}
long long int bitCount(long long n) { return (__builtin_popcountll(n)); }
bool isPowerOf2(long long int n) { return (__builtin_popcountll(n) == 1); }
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int lcm(long long int a, long long int b) {
  return (a / gcd(a, b)) * b;
}
long long int powRec(long long int a, long long int b) {
  if (b == 0) return a;
  long long int res = powRec(a, b / 2);
  if (b % 2)
    return res * res * a;
  else
    return res * res;
}
long long int powitr(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}

### Prompt

Construct a cpp code solution to the problem outlined:

Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

One day Petya was delivered a string s, containing only digits. He needs to find a string that

  * represents a lucky number without leading zeroes,
  * is not empty,
  * is contained in s as a substring the maximum number of times.



Among all the strings for which the three conditions given above are fulfilled, Petya only needs the lexicographically minimum one. Find this string for Petya.

Input

The single line contains a non-empty string s whose length can range from 1 to 50, inclusive. The string only contains digits. The string can contain leading zeroes.

Output

In the only line print the answer to Petya's problem. If the sought string does not exist, print "-1" (without quotes).

Examples

Input

047


Output

4


Input

16


Output

-1


Input

472747


Output

7

Note

The lexicographical comparison of strings is performed by the < operator in the modern programming languages. String x is lexicographically less than string y either if x is a prefix of y, or exists such i (1 ≤ i ≤ min(|x|, |y|)), that xi < yi and for any j (1 ≤ j < i) xj = yj. Here |a| denotes the length of string a.

In the first sample three conditions are fulfilled for strings "4", "7" and "47". The lexicographically minimum one is "4".

In the second sample s has no substrings which are lucky numbers.

In the third sample the three conditions are only fulfilled for string "7".

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const unsigned long long int M = 1000000007;
const long long int mod = 1e9 + 7;
const long long inff = 2e18;
const long long int inf = 2e9;
void dijkstra(long long int s, vector<long long int> &d,
              vector<long long int> &p);
void path(vector<long long int> &v, long long int d);
bool sortbysec(const pair<long long int, long long int> &a,
               const pair<long long int, long long int> &b);
bool palindrome(string s);
bool checkpalindrome(string s);
void MergeSort(long long int a[], long long int start, long long int end);
void Merge(long long int a[], long long int start, long long int mid,
           long long int end);
bool isVowel(char ch);
template <typename T>
void printVec(vector<T> &v);
string toLwr(string s);
string toUpr(string s);
vector<long long int> findFactors(long long int n);
long long int modpow(long long int a, long long int b, long long int m);
bool isprime(long long int x);
void combinatorics();
long long int nCr(long long int x, long long int y);
long long int bitCount(long long n);
bool isPowerOf2(long long int n);
long long int gcd(long long int a, long long int b);
long long int lcm(long long int a, long long int b);
long long int powrec(long long int a, long long int b);
long long int powitr(long long int a, long long int b);
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
void solve() {
  string s;
  cin >> s;
  long long int n;
  n = s.length();
  long long int f = 0, sv = 0;
  for (long long int i = 0; i < n; i++) {
    if (s[i] == '4') f++;
    if (s[i] == '7') sv++;
  }
  if (f == 0 && sv == 0)
    cout << -1 << endl;
  else {
    if (f > sv)
      cout << 4 << endl;
    else if (sv > f)
      cout << 7 << endl;
    else
      cout << 4 << endl;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
const long long int NN = 1e5 + 5;
vector<pair<long long int, long long int>> adj[NN];
vector<long long int> d, p;
void dijkstra(long long int s, vector<long long int> &d,
              vector<long long int> &p) {
  long long int n = NN;
  d.assign(n, inf);
  p.assign(n, -1);
  d[s] = 0;
  priority_queue<pair<long long int, long long int>,
                 vector<pair<long long int, long long int>>,
                 greater<pair<long long int, long long int>>>
      q;
  q.push({0, s});
  while (!q.empty()) {
    long long int v = q.top().second;
    long long int d_v = q.top().first;
    q.pop();
    if (d_v != d[v]) continue;
    for (auto edge : adj[v]) {
      long long int to = edge.first;
      long long int len = edge.second;
      if (d[v] + len < d[to]) {
        d[to] = d[v] + len;
        p[to] = v;
        q.push({d[to], to});
      }
    }
  }
}
void path(vector<long long int> &v, long long int d) {
  if (p[d] != -1) path(v, p[d]);
  v.push_back(d);
}
bool sortbysec(const pair<long long int, long long int> &a,
               const pair<long long int, long long int> &b) {
  return (a.second < b.second);
}
bool palindrome(string s) {
  string t = s;
  reverse((t).begin(), (t).end());
  return (t == s);
}
bool checkpalindrome(string s) {
  for (long long int i = 0; i <= s.length(); i++)
    if (s[i] != s[s.length() - 1 - i]) return false;
  return true;
}
const long long int infms = 2e9;
long long int inversions = 0;
void Merge(long long int a[], long long int start, long long int mid,
           long long int end) {
  long long int n1 = mid - start + 1;
  long long int n2 = end - mid;
  long long int left[n1 + 2];
  long long int right[n2 + 2];
  left[n1 + 1] = infms;
  right[n2 + 1] = infms;
  for (long long int i = 1; i <= n1; i++) left[i] = a[start + i - 1];
  for (long long int i = 1; i <= n2; i++) right[i] = a[mid + i];
  long long int x = 1, y = 1;
  for (long long int k = start; k <= end; k++)
    if (left[x] <= right[y]) {
      a[k] = left[x];
      x++;
    } else {
      inversions += (1 + n1 - x);
      a[k] = right[y];
      y++;
    }
}
void MergeSort(long long int a[], long long int start, long long int end) {
  if (start < end) {
    long long int mid = (start + end) / 2;
    MergeSort(a, start, mid);
    MergeSort(a, mid + 1, end);
    Merge(a, start, mid, end);
  }
}
bool isVowel(char ch) {
  string s = "aeiouAEIOU";
  for (char c : s)
    if (c == ch) return true;
  return false;
}
template <typename T>
void printVec(vector<T> &v) {
  for (auto t : v) cout << t << " ";
  cout << endl;
}
void printArr(long long int a[], long long int n) {
  for (long long int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
}
string toLwr(string s) {
  transform(s.begin(), s.end(), s.begin(), ::tolower);
  return s;
}
string toUpr(string s) {
  transform(s.begin(), s.end(), s.begin(), ::toupper);
  return s;
}
vector<long long int> findFactors(long long int n) {
  vector<long long int> v;
  for (long long int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      if (i * i != n) {
        v.push_back(n / i);
      }
    }
  }
  return v;
}
long long int modpow(long long int a, long long int b, long long int m) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
bool isprime(long long int x) {
  if (x < 2) return false;
  if (x < 4) return true;
  if (!(x & 1)) return false;
  for (long long int i = 3; i * i <= x; i += 2)
    if (x % i == 0) return false;
  return true;
}
const long long int MOD = 1e9 + 7;
const long long int MXX = 1e5 + 69;
long long int fact[MXX], invfact[MXX];
long long int modinv(long long int k) { return modpow(k, MOD - 2, MOD); }
void combinatorics() {
  fact[0] = fact[1] = 1;
  for (long long int i = 2; i < MXX; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= MOD;
  }
  invfact[MXX - 1] = modinv(fact[MXX - 1]);
  for (long long int i = MXX - 2; i >= 0; i--) {
    invfact[i] = invfact[i + 1] * (i + 1);
    invfact[i] %= MOD;
  }
}
long long int nCr(long long int x, long long int y) {
  if (y > x) return 0;
  long long int num = fact[x];
  num *= invfact[y];
  num %= MOD;
  num *= invfact[x - y];
  num %= MOD;
  return num;
}
long long int bitCount(long long n) { return (__builtin_popcountll(n)); }
bool isPowerOf2(long long int n) { return (__builtin_popcountll(n) == 1); }
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int lcm(long long int a, long long int b) {
  return (a / gcd(a, b)) * b;
}
long long int powRec(long long int a, long long int b) {
  if (b == 0) return a;
  long long int res = powRec(a, b / 2);
  if (b % 2)
    return res * res * a;
  else
    return res * res;
}
long long int powitr(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}

```