#include <bits/stdc++.h>
#define M_PI    3.14159265358979323846ll
#define ff(i,s,n) for(int i=(s);i<(n);i++)
#define fr(i,s,n) for(int i=(n)-1;i>=(s);i--)
#define FF(i,s,n) for(int i=(s);i<=(n);i++)
#define Fr(i,s,n) for(int i=(n);i>=(s);i--)
#define FR(i,s,n) for(int i=(n);i>=(s);i--)
#define all(a) a.begin(),a.end()
#define tnm typename
#define invd inline int
#define templ1 template<tnm T>
#define btempl templ1 invd
#define ln prln()
#define sp prsp()
using namespace std;
void init(string name){
  string path = "../../../Downloads/"+name+".in";
  string out = name+".out";
  freopen(path.c_str(),"r",stdin);
  freopen(out.c_str(),"w",stdout);
}

invd init(int n){
  char buff[100];
  sprintf(buff,"xx/%d.txt",n);
#ifndef ONLINE_JUDGE
    freopen(buff,"r",stdin);
#endif
}
typedef int64_t ll;typedef unsigned int uint;
invd scan(char&s){int c;while((c=getchar())=='\n'||c==' '||c=='\r');s=c;};
invd pr(ll i){printf("%" PRId64 ,i);}
invd scan(int&i){return scanf("%d",&i);}invd scan(double&i){return scanf("%lf",&i);}invd scan(ll&i){return scanf("%" PRId64 ,&i);}invd pr(const string&s){ff(i,0,s.size())putchar(s[i]);}
invd scan(string&s){int c;while((c=getchar())=='\n'||c==' '||c=='\r');do{switch(c){case'\n':case' ':case'\r':case EOF:return 0;default:s+=c;}}while((c=getchar())!=EOF);return s.size();};
invd scanln(string&s){int c;while((c=getchar())=='\n'||c==' '||c=='\r');do{switch(c){case'\n':case'\r':case EOF:return 0;default:s+=c;}}while((c=getchar())!=EOF);return s.size();};
invd pr(char c){putchar(c);};invd pr(const char*c){while(*c!=0)putchar(*c++);}
invd pr(int i){printf("%d",i);}invd pr(bool b){pr((int)b);}invd pr(double d){printf("%.9lf",d);}invd prln(){putchar('\n');}invd prsp(){putchar(' ');}
btempl scan(char*s){int c;while((c=getchar())){switch(c){case'\n':case'\r':case' ':break;default:*s++=c;}}*s=0;};
template<typename T>invd scan(T&arg) {return arg.scan();}
template<typename T, typename V> invd scan(pair<T,V>&a){scan(a.first),scan(a.second);}
btempl scan(vector<T>&v){for(T&t:v)scan(t);}btempl scan(T*a,int n){while(n--)scan(*a++);}
template<typename T, typename... Args>invd scan(T&first, Args (&... args)) {scan(first),scan(args...);}
template<typename T>invd pr(T arg) {arg.print();}
template<class A, class B> invd pr(pair<A,B> a){pr(a.first),sp,pr(a.second);}
btempl prsp(vector<T>&v){if(v.size())pr(v[0]);ff(i,1,v.size())sp,pr(v[i]);}btempl prsp(T*a,int n){while(n--)pr(*a++),sp;}btempl prln(vector<T>&v){for(const T&t:v)pr(t),ln;}
btempl pr(vector<T>&v){prsp(v);}
invd pr(size_t i){pr((ll)i);}
btempl prln(T*a,int n){while(n--)pr(*a++),ln;}btempl prln(vector<vector<T> >&v){for(vector<T>&t:v)prsp(t),ln;}
template<typename T, typename U>invd prln(T first, U second) {pr(first),ln,pr(second);}
template<typename T, typename... Args>invd prln(T first, Args... args) {pr(first),ln,prln(args...);}
template<typename T, typename... Args>invd pr(T first, Args... args) {pr(first),sp,pr(args...);}
templ1 vector<T>& operator+=(vector<T>& v,T x) {v.push_back(x);return v;}
templ1 vector<T>& operator--(vector<T>& v) {v.pop_back();return v;}templ1 vector<T>& operator--(vector<T>& v,int) {v.pop_back();return v;}
templ1 bool operator!(stack<T>&q) {return !q.empty();}templ1 stack<T>& operator+=(stack<T>& v,T x) {v.push(x);return v;}
templ1 T operator--(stack<T>& v) {v.pop();return v.top();}templ1 T operator--(stack<T>& v,int) {T t=v.top();v.pop();return t;}
templ1 bool operator!(queue<T>&q) {return !q.empty();}templ1 queue<T>& operator+=(queue<T>& v,T x) {v.push(x);return v;}
templ1 T operator--(queue<T>& v) {v.pop();return v.front();}templ1 T operator--(queue<T>& v,int) {T t=v.front();v.pop();return t;}
template<tnm T,tnm U>invd smax(T&a,U b){if(b>a)a=b;}template<tnm T,tnm U>invd smin(T&a,U b){if(b<a)a=b;}
template<tnm T,tnm U>inline T gcd(T a, U b){return __gcd(a,b);}typedef vector<int> vi;typedef vector<vi > vvi;typedef pair<int, int> pii;typedef pair<ll,ll> pll;
int getint(){
  int x;scan(x);return x;
}
#define gi getint()

typedef vector<pii > vpii;
typedef vector<ll > vll;
ll MOD = 1E9+7;
const ll linf=~(1ll<<63);
const int inf=~(1<<31);
const int sk = 1E9;

struct dig{
  char c;
  int s, g;

};

struct problem{
  dig a, b;

  string build(dig a, dig b){
    string res;
    while(a.s){
      if(a.c=='4'){
        while(a.s>b.g)res+=a.c,a.s--;
      }else{
        res+=a.c,a.s--;
        if(b.g==0)while(a.s>0)res+=a.c,a.s--;
      }
      if(b.s)
        a.g--;
      swap(a,b);
    }
    if(a.s==0&&a.g==0&&b.s==0&&b.g==0)return res;
    return "";
  }

  int solve(){
    string ans = build(a,b);
    if(ans.size()==a.s+b.s)return pr(ans);
    ans = build(b,a);
    if(ans.size()==a.s+b.s)return pr(ans);
    return pr(-1);

  }

  problem(){
    int x, y, z, w;scan(x,y,z,w);
    a = {'4',x,z};
    b = {'7',y,w};

  }

};

int main(){
  init(1);
  problem px = {};
  px.solve();
}


/* ****Enigma27**** */
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define    endl        '\n'
#define pll         pair<ll int,ll int>
#define vll          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define rep(i,a,b)   for(ll i=a;ia<b;i++)
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define ios        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,i,j,k=0,l,sum=0,flag=0,ans=0,m,a,b,c,d,t,q;
int c7=0,c4=0;
string s;
int main()
{

    cin>>a>>b>>c>>d;
    if(abs(c-d)>1){
        cout<<-1;return 0;
    }

    for(i=0;i<c;i++) s+="47",c7++,c4++;
    if(c==d) s+="74",c7++,c4++;
    else if(c<d) s="7"+s+"4",c7++,c4++;
    for(i=0;i<s.size();i++){
        if(s[i]=='4'&&c4<a){
            string temp="";
            while(c4<a) temp+="4",c4++;
            s=s.substr(0,i)+temp+s.substr(i,s.size()-i);
            break;
        }
    }
    for(i=0;i<s.size();i++){
        if(s[i]=='7'&&c7<b){
            string temp="";
            while(c7<b) temp+="7",c7++;
            s=s.substr(0,i)+temp+s.substr(i,s.size()-i);
            break;
        }
    }
    if(c7==b&&c4==a) cout<<s;
    else cout<<-1;
    return 0;
}


/* ****Enigma27**** */
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define    endl        '\n'
#define pll         pair<ll int,ll int>
#define vll          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define rep(i,a,b)   for(ll i=a;ia<b;i++)
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define ios        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,i,j,k=0,l,sum=0,flag=0,ans=0,m,a,b,c,d,t,q;
int c7=0,c4=0;
string s;
int main()
{

    cin>>a>>b>>c>>d;
    if(abs(c-d)>1){
        cout<<-1;return 0;
    }

    for(i=0;i<c;i++) s+="47",c7++,c4++;
    if(c==d) s+="74",c7++,c4++;
    else if(c<d) s="7"+s+"4",c7++,c4++;

    for(i=0;i<s.size();i++){
        if(s[i]=='4'&&c4<a){
            string temp="";
            while(c4<a) temp+="4",c4++;
            s=s.substr(0,i)+temp+s.substr(i,s.size()-i);
            break;
        }
    }
    for(i=s.size()-1;i>=0;i--){
        if(s[i]=='7'&&c7<b){
            string temp="";
            while(c7<b) temp+="7",c7++;
            s=s.substr(0,i)+temp+s.substr(i,s.size()-i);
            break;
        }
    }
    if(c7==b&&c4==a) cout<<s;
    else cout<<-1;
    return 0;
}


/* ****Enigma27**** */
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define    endl        '\n'
#define pll         pair<ll int,ll int>
#define vll          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define rep(i,a,b)   for(ll i=a;ia<b;i++)
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define ios        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,i,j,k=0,l,sum=0,flag=0,ans=0,m,a,b,c,d,t,q;
int c7=0,c4=0;
string s;
int main()
{

    cin>>a>>b>>c>>d;
    if(abs(c-d)>1){
        cout<<-1;return 0;
    }

    for(i=0;i<c;i++) s+="47",c7++,c4++;
    if(c==d) if(a>=b) s+="4",c4++;else s="7"+s,c7++;
    else if(c<d) s="7"+s+"4",c7++,c4++;

    for(i=0;i<s.size();i++){
        if(s[i]=='4'&&c4<a){
            string temp="";
            while(c4<a) temp+="4",c4++;
            s=s.substr(0,i)+temp+s.substr(i,s.size()-i);
            break;
        }
    }
    for(i=s.size()-1;i>=0;i--){
        if(s[i]=='7'&&c7<b){
            string temp="";
            while(c7<b) temp+="7",c7++;
            s=s.substr(0,i)+temp+s.substr(i,s.size()-i);
            break;
        }
    }
    if(c7==b&&c4==a) cout<<s;
    else cout<<-1;
    return 0;
}


/* ****Enigma27**** */
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define    endl        '\n'
#define pll         pair<ll int,ll int>
#define vll          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define rep(i,a,b)   for(ll i=a;ia<b;i++)
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define ios        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,i,j,k=0,l,sum=0,flag=0,ans=0,m,a,b,c,d,t,q;
int c7=0,c4=0;
string s;
int main()
{

    cin>>a>>b>>c>>d;
    if(abs(c-d)>1){
        cout<<-1;return 0;
    }

    for(i=0;i<c;i++) s+="47",c7++,c4++;
    if(c==d) if(c4<a) s+="4",c4++;else s="7"+s,c7++;
    else if(c<d) s="7"+s+"4",c7++,c4++;

    for(i=0;i<s.size();i++){
        if(s[i]=='4'&&c4<a){
            string temp="";
            while(c4<a) temp+="4",c4++;
            s=s.substr(0,i)+temp+s.substr(i,s.size()-i);
            break;
        }
    }
    for(i=s.size()-1;i>=0;i--){
        if(s[i]=='7'&&c7<b){
            string temp="";
            while(c7<b) temp+="7",c7++;
            s=s.substr(0,i)+temp+s.substr(i,s.size()-i);
            break;
        }
    }
    if(c7==b&&c4==a) cout<<s;
    else cout<<-1;
    return 0;
}


/* ****Enigma27**** */
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define    endl        '\n'
#define pll         pair<ll int,ll int>
#define vll          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define rep(i,a,b)   for(ll i=a;ia<b;i++)
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define ios        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,i,j,k=0,l,sum=0,flag=0,ans=0,m,a,b,c,d,t,q;
int c7=0,c4=0;
string s;
void check(string s){
    int f=c4,sv=c7,a1=0,b1=0,c1=0,d1=0;
    string ff="",svv="";
    while(f<a) ff+="4",f++;
    while(sv<b) svv+="7",sv++;
    if(s[0]=='4') s=ff+s;
    else if(s.back()=='4') s+=ff;
    if(s[0]=='7') s=svv+s;
    else if(s.back()=='7') s+=svv;
    for(i=0;i<s.size();i++){

        if(s[i]=='4') a1++;
        else b1++;
        if(i!=0){
            if(s[i]=='4'&&s[i-1]=='7') d1++;
            else if(s[i]=='7'&&s[i-1]=='4') c1++;
        }
    }
    if (a1==a&&b1==b&&c1==c&&d1==d){
        cout<<s;
        exit(0);
    }
    return ;
}
int main()
{

    cin>>a>>b>>c>>d;
    if(abs(c-d)>1){
        cout<<-1;return 0;
    }

    for(i=0;i<c;i++) s+="47",c7++,c4++;
    if(c==d) s+="74",c7++,c4++;
    else if(c<d) s="7"+s+"4",c7++,c4++;
    check(s);
    cout<<-1;
    return 0;
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)

#define DEBUG(x) { cout << #x << " = "; cout << (x) << endl; }

#define endl '\n'

#define ll long long int
#define MOD 1000000007
#define MN 300005
#define M_PI 3.14159265358979323846

using namespace std;
typedef pair<int, int> pii;

void checkDefine();
const long double eps = 1e-9;
const long double eps2 = 2e-9;

ll a1, a2, a3, a4;

int main(){
	cin >> a1 >> a2 >> a3 >> a4;
	if(abs(a3-a4) > 1){
		cout << -1; return 0;
	}
	if(a3 == a4){
		ll c1 = 1;
		string res = "";
		FOR(i, 0, a3 - 1){
			res += "47";
			c1++;
		}
		res += "74";
		if(c1 != a1 || c1 != a2){
			cout << "-1"; return 0;
		}
		cout << res;
	}
	else if(a3 > a4){
		ll c1 = 0;
		string res = "";
		FOR(i, 0, a3 - 1){
			res += "47";
			c1++;
		}
		if(c1 != a1){
			cout << -1;  return 0;
		}
		if(c1 > a2){
			cout << -1; return 0;
		}
		FOR(i,0,a2-c1-1){
			res += "7";
		}
		cout << res;
	}
	else {
		ll c1 = 0;
		string res = "";
		FOR(i, 0, a4 - 1){
			res += "74";
			c1++;
		}
		if(c1 != a2){
			cout << -1; return 0;
		}
		if(c1 > a1){
			cout << -1; return 0;
		}
		FOR(i,0,a1-c1-1){
			res += "4";
		}
		cout << res;
	}
	return 0;
}

void checkDefine(){
	ll n, a[MN];
	map<ll, ll> m;
	cin >> n;
	FOR(i, 0, n - 1) {
		cin >> a[i];
		m[a[i]]++;
	}

	string s; cin >> s;
	DEBUG(s);
	DEBUG("------------");
	EACH(it, m){
		cout << it->first << " " << it->second << endl;
	}
	/*Compare sort struct */
	/*
	struct mStruct {
	    ll a, b;
	};
	bool comp(mStruct a, mStruct b) {
	    return a.a + a.b > b.a + b.b;
	}
	*/
	//int ans2 = *max_element(a, a + n);
	//if(s.find("abc") != npos) // found
	//cout << fixed << setprecision(10) << M_PI;
	/*
	5 -1
	5 8 3 1 10
	*/

	/*
	cin >> n >> d;
	FOR(i, 0, n - 1){
		cin >> a[i];
		q.insert(make_pair(a[i], i));
	}
	EACH(it, q){
		cout << it->first << " " << it->second << endl;
	}

	ll pos = q.begin() -> second;
	ll value = a[pos] + d;
	cout << endl;
	cout << value << endl;

	set<pair<ll,ll> >::iterator it;

	// just greater equal than k. (lower_bound)
	it = q.lower_bound(make_pair(value, 0));

	//it = q.upper_bound(make_pair(value, 0));
	if(it != q.end()){
		cout << it->first << " " << it->second;
	}

	value a a a b b b c c c
	index 0 1 2 3 4 5 6 7 8
	bound       l     u
	Where l represents the lower bound of b, and u represents the upper bound of b.
	*/
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)

#define DEBUG(x) { cout << #x << " = "; cout << (x) << endl; }

#define endl '\n'

#define ll long long int
#define MOD 1000000007
#define MN 300005
#define M_PI 3.14159265358979323846

using namespace std;
typedef pair<int, int> pii;

void checkDefine();
const long double eps = 1e-9;
const long double eps2 = 2e-9;

ll a1, a2, a3, a4;

int main(){
	cin >> a1 >> a2 >> a3 >> a4;
	if(abs(a3-a4) > 1){
		cout << -1; return 0;
	}
	a4 -= a3-1;
	a2 -= a3;
	a1 -= a3;
	int mark=0;
	if(a4==2){
		a1--;
		a2--;
		mark=3;
	}else if(a4==1){
		if(a1){
			a1--;
			mark=1;
		}else{
			a2--;
			mark=2;
		}
	}
	if(a1<0||a2<0||a4>2||a4<0)
		puts("-1");
	else{
		if(mark&2)printf("7");
		for(int i=1;i<=a1;++i)printf("4");
		for(int i=1;i<=a3;++i)printf("47");
		for(int i=1;i<=a2;++i)printf("7");
		if(mark&1)printf("4");
	}
	return 0;
}

void checkDefine(){
	ll n, a[MN];
	map<ll, ll> m;
	cin >> n;
	FOR(i, 0, n - 1) {
		cin >> a[i];
		m[a[i]]++;
	}

	string s; cin >> s;
	DEBUG(s);
	DEBUG("------------");
	EACH(it, m){
		cout << it->first << " " << it->second << endl;
	}
	/*Compare sort struct */
	/*
	struct mStruct {
	    ll a, b;
	};
	bool comp(mStruct a, mStruct b) {
	    return a.a + a.b > b.a + b.b;
	}
	*/
	//int ans2 = *max_element(a, a + n);
	//if(s.find("abc") != npos) // found
	//cout << fixed << setprecision(10) << M_PI;
	/*
	5 -1
	5 8 3 1 10
	*/

	/*
	cin >> n >> d;
	FOR(i, 0, n - 1){
		cin >> a[i];
		q.insert(make_pair(a[i], i));
	}
	EACH(it, q){
		cout << it->first << " " << it->second << endl;
	}

	ll pos = q.begin() -> second;
	ll value = a[pos] + d;
	cout << endl;
	cout << value << endl;

	set<pair<ll,ll> >::iterator it;

	// just greater equal than k. (lower_bound)
	it = q.lower_bound(make_pair(value, 0));

	//it = q.upper_bound(make_pair(value, 0));
	if(it != q.end()){
		cout << it->first << " " << it->second;
	}

	value a a a b b b c c c
	index 0 1 2 3 4 5 6 7 8
	bound       l     u
	Where l represents the lower bound of b, and u represents the upper bound of b.
	*/
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)

#define DEBUG(x) { cout << #x << " = "; cout << (x) << endl; }

#define endl '\n'

#define ll long long int
#define MOD 1000000007
#define MN 300005
#define M_PI 3.14159265358979323846

using namespace std;
typedef pair<int, int> pii;

void checkDefine();
const long double eps = 1e-9;
const long double eps2 = 2e-9;

ll a1, a2, a3, a4;

int main(){
	cin >> a1 >> a2 >> a3 >> a4;
	if(abs(a3-a4) > 1){
		cout << -1; return 0;
	}
	if(a3 == a4){
		ll c1 = 1;
		string res = "";
		FOR(i, 0, a3 - 1){
			res += "47";
			c1++;
		}

		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		kq += res;
		FOR(i, 0, a2 - c1 - 1) kq += "7";
		kq += "74";
		cout << kq;
	}
	else if(a3 > a4){
		ll c1 = 0;
		string res = "";
		FOR(i,0,a3-1){
			res += "47";
			c1++;
		}
		// 474747
		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		kq += res;
		FOR(i, 0, a2 - c1 - 1) kq += "7";
		cout << kq;
	}
	else {
		ll c1 = 0;
		string res = "";
		FOR(i,0,a4-1){
			res += "74";
			c1++;
		}
		// 747474
		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		FOR(i, 0, a2 - c1 - 1) kq += "7";
		kq += res;
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		cout << kq;
	}
	return 0;
}

void checkDefine(){
	ll n, a[MN];
	map<ll, ll> m;
	cin >> n;
	FOR(i, 0, n - 1) {
		cin >> a[i];
		m[a[i]]++;
	}

	string s; cin >> s;
	DEBUG(s);
	DEBUG("------------");
	EACH(it, m){
		cout << it->first << " " << it->second << endl;
	}
	/*Compare sort struct */
	/*
	struct mStruct {
	    ll a, b;
	};
	bool comp(mStruct a, mStruct b) {
	    return a.a + a.b > b.a + b.b;
	}
	*/
	//int ans2 = *max_element(a, a + n);
	//if(s.find("abc") != npos) // found
	//cout << fixed << setprecision(10) << M_PI;
	/*
	5 -1
	5 8 3 1 10
	*/

	/*
	cin >> n >> d;
	FOR(i, 0, n - 1){
		cin >> a[i];
		q.insert(make_pair(a[i], i));
	}
	EACH(it, q){
		cout << it->first << " " << it->second << endl;
	}

	ll pos = q.begin() -> second;
	ll value = a[pos] + d;
	cout << endl;
	cout << value << endl;

	set<pair<ll,ll> >::iterator it;

	// just greater equal than k. (lower_bound)
	it = q.lower_bound(make_pair(value, 0));

	//it = q.upper_bound(make_pair(value, 0));
	if(it != q.end()){
		cout << it->first << " " << it->second;
	}

	value a a a b b b c c c
	index 0 1 2 3 4 5 6 7 8
	bound       l     u
	Where l represents the lower bound of b, and u represents the upper bound of b.
	*/
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)

#define DEBUG(x) { cout << #x << " = "; cout << (x) << endl; }

#define endl '\n'

#define ll long long int
#define MOD 1000000007
#define MN 300005
#define M_PI 3.14159265358979323846

using namespace std;
typedef pair<int, int> pii;

void checkDefine();
const long double eps = 1e-9;
const long double eps2 = 2e-9;

ll a1, a2, a3, a4;

int main(){
	cin >> a1 >> a2 >> a3 >> a4;
	if(abs(a3-a4) > 1){
		cout << -1; return 0;
	}
	if(a3 == a4){
		ll c1 = 0;
		string res = "";
		FOR(i, 0, a3 - 1){
			res += "47";
			c1++;
		}

		if(c1 + 1> a1){
			cout << -17; return 0;
		}
		// 4747474
		if(c1 == a2){
			string kq = "";
			FOR(i, 0, a1 - c1 - 2) kq += "4";
			kq += res;
			FOR(i, 0, a2 - c1 - 2) kq += "7";
			kq += "4";
			cout << kq;
		}
		else if(c1 + 1 <= a2){
			string kq = "";
			FOR(i, 0, a1 - c1 - 2) kq += "4";
			kq += res;
			FOR(i, 0, a2 - c1 - 2) kq += "7";
			kq += "74";
			cout << kq;
		}
		else {
			cout << c1 << " " << a2 << endl;
			cout << -18; return 0;
		}

	}
	else if(a3 > a4){
		ll c1 = 0;
		string res = "";
		FOR(i,0,a3-1){
			res += "47";
			c1++;
		}
		// 474747
		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		kq += res;
		FOR(i, 0, a2 - c1 - 1) kq += "7";
		cout << kq;
	}
	else {
		ll c1 = 0;
		string res = "";
		FOR(i,0,a4-1){
			res += "74";
			c1++;
		}
		// 747474
		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		kq += res[0];
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		FOR(i,1,res.size() - 2) kq += res[i];
		FOR(i,0,a2-c1-1) kq += "7";
		kq += res[res.size() - 1];
		cout << kq;
	}
	return 0;
}

void checkDefine(){
	ll n, a[MN];
	map<ll, ll> m;
	cin >> n;
	FOR(i, 0, n - 1) {
		cin >> a[i];
		m[a[i]]++;
	}

	string s; cin >> s;
	DEBUG(s);
	DEBUG("------------");
	EACH(it, m){
		cout << it->first << " " << it->second << endl;
	}
	/*Compare sort struct */
	/*
	struct mStruct {
	    ll a, b;
	};
	bool comp(mStruct a, mStruct b) {
	    return a.a + a.b > b.a + b.b;
	}
	*/
	//int ans2 = *max_element(a, a + n);
	//if(s.find("abc") != npos) // found
	//cout << fixed << setprecision(10) << M_PI;
	/*
	5 -1
	5 8 3 1 10
	*/

	/*
	cin >> n >> d;
	FOR(i, 0, n - 1){
		cin >> a[i];
		q.insert(make_pair(a[i], i));
	}
	EACH(it, q){
		cout << it->first << " " << it->second << endl;
	}

	ll pos = q.begin() -> second;
	ll value = a[pos] + d;
	cout << endl;
	cout << value << endl;

	set<pair<ll,ll> >::iterator it;

	// just greater equal than k. (lower_bound)
	it = q.lower_bound(make_pair(value, 0));

	//it = q.upper_bound(make_pair(value, 0));
	if(it != q.end()){
		cout << it->first << " " << it->second;
	}

	value a a a b b b c c c
	index 0 1 2 3 4 5 6 7 8
	bound       l     u
	Where l represents the lower bound of b, and u represents the upper bound of b.
	*/
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)

#define DEBUG(x) { cout << #x << " = "; cout << (x) << endl; }

#define endl '\n'

#define ll long long int
#define MOD 1000000007
#define MN 300005
#define M_PI 3.14159265358979323846

using namespace std;
typedef pair<int, int> pii;

void checkDefine();
const long double eps = 1e-9;
const long double eps2 = 2e-9;

ll a1, a2, a3, a4;

int main(){
	cin >> a1 >> a2 >> a3 >> a4;
	if(abs(a3-a4) > 1){
		cout << -1; return 0;
	}
	if(a3 == a4){
		ll c1 = 0;
		string res = "";
		FOR(i, 0, a3 - 1){
			res += "47";
			c1++;
		}

		if(c1 + 1> a1){
			cout << -1; return 0;
		}
		// 4747474
		if(c1 == a2){
			string kq = "";
			FOR(i, 0, a1 - c1 - 2) kq += "4";
			kq += res;
			FOR(i, 0, a2 - c1 - 2) kq += "7";
			kq += "4";
			cout << kq;
		}
		else if(c1 + 1 == a2){
			string kq = "";
			FOR(i, 0, a1 - c1 - 2) kq += "4";
			kq += res;
			FOR(i, 0, a2 - c1 - 2) kq += "7";
			kq += "74";
			cout << kq;
		}
		else {
			cout << -1; return 0;
		}

	}
	else if(a3 > a4){
		ll c1 = 0;
		string res = "";
		FOR(i,0,a3-1){
			res += "47";
			c1++;
		}
		// 474747
		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		kq += res;
		FOR(i, 0, a2 - c1 - 1) kq += "7";
		cout << kq;
	}
	else {
		ll c1 = 0;
		string res = "";
		FOR(i,0,a4-1){
			res += "74";
			c1++;
		}
		// 747474
		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		kq += res[0];
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		FOR(i,1,res.size() - 2) kq += res[i];
		FOR(i,0,a2-c1-1) kq += "7";
		kq += res[res.size() - 1];
		cout << kq;
	}
	return 0;
}

void checkDefine(){
	ll n, a[MN];
	map<ll, ll> m;
	cin >> n;
	FOR(i, 0, n - 1) {
		cin >> a[i];
		m[a[i]]++;
	}

	string s; cin >> s;
	DEBUG(s);
	DEBUG("------------");
	EACH(it, m){
		cout << it->first << " " << it->second << endl;
	}
	/*Compare sort struct */
	/*
	struct mStruct {
	    ll a, b;
	};
	bool comp(mStruct a, mStruct b) {
	    return a.a + a.b > b.a + b.b;
	}
	*/
	//int ans2 = *max_element(a, a + n);
	//if(s.find("abc") != npos) // found
	//cout << fixed << setprecision(10) << M_PI;
	/*
	5 -1
	5 8 3 1 10
	*/

	/*
	cin >> n >> d;
	FOR(i, 0, n - 1){
		cin >> a[i];
		q.insert(make_pair(a[i], i));
	}
	EACH(it, q){
		cout << it->first << " " << it->second << endl;
	}

	ll pos = q.begin() -> second;
	ll value = a[pos] + d;
	cout << endl;
	cout << value << endl;

	set<pair<ll,ll> >::iterator it;

	// just greater equal than k. (lower_bound)
	it = q.lower_bound(make_pair(value, 0));

	//it = q.upper_bound(make_pair(value, 0));
	if(it != q.end()){
		cout << it->first << " " << it->second;
	}

	value a a a b b b c c c
	index 0 1 2 3 4 5 6 7 8
	bound       l     u
	Where l represents the lower bound of b, and u represents the upper bound of b.
	*/
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)

#define DEBUG(x) { cout << #x << " = "; cout << (x) << endl; }

#define endl '\n'

#define ll long long int
#define MOD 1000000007
#define MN 300005
#define M_PI 3.14159265358979323846

using namespace std;
typedef pair<int, int> pii;

void checkDefine();
const long double eps = 1e-9;
const long double eps2 = 2e-9;

ll a1, a2, a3, a4;

int main(){
	cin >> a1 >> a2 >> a3 >> a4;
	if(abs(a3-a4) > 1){
		cout << -1; return 0;
	}
	if(a3 == a4){
		ll c1 = 1;
		string res = "";
		FOR(i, 0, a3 - 1){
			res += "47";
			c1++;
		}

		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		kq += res;
		FOR(i, 0, a2 - c1 - 1) kq += "7";
		kq += "74";
		cout << kq;
	}
	else if(a3 > a4){
		ll c1 = 0;
		string res = "";
		FOR(i,0,a3-1){
			res += "47";
			c1++;
		}
		// 474747
		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		kq += res;
		FOR(i, 0, a2 - c1 - 1) kq += "7";
		cout << kq;
	}
	else {
		ll c1 = 0;
		string res = "";
		FOR(i,0,a4-1){
			res += "74";
			c1++;
		}
		// 747474
		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		kq += res[0];
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		FOR(i,1,res.size() - 2) kq += res[i];
		FOR(i,0,a2-c1-1) kq += "7";
		kq += res[res.size() - 1];
		cout << kq;
	}
	return 0;
}

void checkDefine(){
	ll n, a[MN];
	map<ll, ll> m;
	cin >> n;
	FOR(i, 0, n - 1) {
		cin >> a[i];
		m[a[i]]++;
	}

	string s; cin >> s;
	DEBUG(s);
	DEBUG("------------");
	EACH(it, m){
		cout << it->first << " " << it->second << endl;
	}
	/*Compare sort struct */
	/*
	struct mStruct {
	    ll a, b;
	};
	bool comp(mStruct a, mStruct b) {
	    return a.a + a.b > b.a + b.b;
	}
	*/
	//int ans2 = *max_element(a, a + n);
	//if(s.find("abc") != npos) // found
	//cout << fixed << setprecision(10) << M_PI;
	/*
	5 -1
	5 8 3 1 10
	*/

	/*
	cin >> n >> d;
	FOR(i, 0, n - 1){
		cin >> a[i];
		q.insert(make_pair(a[i], i));
	}
	EACH(it, q){
		cout << it->first << " " << it->second << endl;
	}

	ll pos = q.begin() -> second;
	ll value = a[pos] + d;
	cout << endl;
	cout << value << endl;

	set<pair<ll,ll> >::iterator it;

	// just greater equal than k. (lower_bound)
	it = q.lower_bound(make_pair(value, 0));

	//it = q.upper_bound(make_pair(value, 0));
	if(it != q.end()){
		cout << it->first << " " << it->second;
	}

	value a a a b b b c c c
	index 0 1 2 3 4 5 6 7 8
	bound       l     u
	Where l represents the lower bound of b, and u represents the upper bound of b.
	*/
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)

#define DEBUG(x) { cout << #x << " = "; cout << (x) << endl; }

#define endl '\n'

#define ll long long int
#define MOD 1000000007
#define MN 300005
#define M_PI 3.14159265358979323846

using namespace std;
typedef pair<int, int> pii;

void checkDefine();
const long double eps = 1e-9;
const long double eps2 = 2e-9;

ll a1, a2, a3, a4;

int main(){
	cin >> a1 >> a2 >> a3 >> a4;
	if(abs(a3-a4) > 1){
		cout << -1; return 0;
	}
	if(a3 == a4){
		ll c1 = 0;
		string res = "";
		FOR(i, 0, a3 - 1){
			res += "47";
			c1++;
		}

		if(c1 + 1> a1){
			cout << -1; return 0;
		}
		// 4747474
		if(c1 == a2){
			string kq = "";
			FOR(i, 0, a1 - c1 - 2) kq += "4";
			kq += res;
			FOR(i, 0, a2 - c1 - 2) kq += "7";
			kq += "4";
			cout << kq;
		}
		else if(c1 + 1 <= a2){
			string kq = "";
			FOR(i, 0, a1 - c1 - 2) kq += "4";
			kq += res;
			FOR(i, 0, a2 - c1 - 2) kq += "7";
			kq += "74";
			cout << kq;
		}
		else {
			cout << c1 << " " << a2 << endl;
			cout << -1; return 0;
		}

	}
	else if(a3 > a4){
		ll c1 = 0;
		string res = "";
		FOR(i,0,a3-1){
			res += "47";
			c1++;
		}
		// 474747
		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		kq += res;
		FOR(i, 0, a2 - c1 - 1) kq += "7";
		cout << kq;
	}
	else {
		ll c1 = 0;
		string res = "";
		FOR(i,0,a4-1){
			res += "74";
			c1++;
		}
		// 747474
		if(c1 > a1 || c1 > a2){
			cout << -1; return 0;
		}
		string kq = "";
		kq += res[0];
		FOR(i, 0, a1 - c1 - 1) kq += "4";
		FOR(i,1,res.size() - 2) kq += res[i];
		FOR(i,0,a2-c1-1) kq += "7";
		kq += res[res.size() - 1];
		cout << kq;
	}
	return 0;
}

void checkDefine(){
	ll n, a[MN];
	map<ll, ll> m;
	cin >> n;
	FOR(i, 0, n - 1) {
		cin >> a[i];
		m[a[i]]++;
	}

	string s; cin >> s;
	DEBUG(s);
	DEBUG("------------");
	EACH(it, m){
		cout << it->first << " " << it->second << endl;
	}
	/*Compare sort struct */
	/*
	struct mStruct {
	    ll a, b;
	};
	bool comp(mStruct a, mStruct b) {
	    return a.a + a.b > b.a + b.b;
	}
	*/
	//int ans2 = *max_element(a, a + n);
	//if(s.find("abc") != npos) // found
	//cout << fixed << setprecision(10) << M_PI;
	/*
	5 -1
	5 8 3 1 10
	*/

	/*
	cin >> n >> d;
	FOR(i, 0, n - 1){
		cin >> a[i];
		q.insert(make_pair(a[i], i));
	}
	EACH(it, q){
		cout << it->first << " " << it->second << endl;
	}

	ll pos = q.begin() -> second;
	ll value = a[pos] + d;
	cout << endl;
	cout << value << endl;

	set<pair<ll,ll> >::iterator it;

	// just greater equal than k. (lower_bound)
	it = q.lower_bound(make_pair(value, 0));

	//it = q.upper_bound(make_pair(value, 0));
	if(it != q.end()){
		cout << it->first << " " << it->second;
	}

	value a a a b b b c c c
	index 0 1 2 3 4 5 6 7 8
	bound       l     u
	Where l represents the lower bound of b, and u represents the upper bound of b.
	*/
}


/*
���
ģ��ͼ��
��С����
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long LL;
const ll MAXN=1e5+5;
const ll INF=1e6;
ll a1,a2,a3,a4;
bool beyond(ll x,ll y)
{
    if(x>a1||y>a2)
    {
        return true;
    }
    return false;
}
int main()
{
    while(~scanf("%lld %lld %lld %lld",&a1,&a2,&a3,&a4))
    {
        if(fabs(a3-a4)>=2)
        {
            printf("-1\n");
            return 0;
        }
        else if(a3==a4)
        {
            if(!beyond(a3+1,a4))
            {
                a1-=a3+1;
                a2-=a4;
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("47");
                }
                for(ll i=1;i<=a2+1;i++)
                {
                    printf("7");
                }
                printf("4");
            }
            else if(!beyond(a3,a4+1))
            {
                a1-=a3;
                a2-=a4+1;
                printf("7");
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("74");
                }
                while(a2)
                {
                    printf("7");
                    a2--;
                }
                printf("7");
            }
            else
            {
                printf("-1\n");
            }
        }
        else if(a3>a4)
        {
            if(!beyond(a3,a3))
            {
                a1-=a3;
                a2-=a3;
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                printf("7");
                for(ll i=2;i<=a3;i++)
                {
                    printf("47");
                }
                for(ll i=1;i<=a2;i++)
                {
                    printf("7");
                }
            }
            else
            {
                printf("-1");
                return 0;
            }

        }
        else
        {
            if(!beyond(a4,a4))
            {
                a1-=a4;
                a2-=a4;
                printf("7");
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a4-1;i++)
                {
                    printf("74");
                }
                a2++;
                while(a2)
                {
                    printf("7");
                    a2--;
                }
                printf("4");
            }
            else
            {
                printf("-1");
            }
        }
    }
}
/*
2
1 2
1 2
100
*/


/*
���
ģ��ͼ��
��С����
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long LL;
const ll MAXN=1e5+5;
const ll INF=1e6;
ll a1,a2,a3,a4;
bool beyond(ll x,ll y)
{
    if(x>a1||y>a2)
    {
        return true;
    }
    return false;
}
int main()
{
    while(~scanf("%lld %lld %lld %lld",&a1,&a2,&a3,&a4))
    {
        if(fabs(a3-a4)>=2)
        {
            printf("-1\n");
            return 0;
        }
        else if(a3==a4)
        {
            if(!beyond(a3+1,a4))
            {
                a1-=a3+1;
                a2-=a4;
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("47");
                }
                for(ll i=1;i<=a2+1;i++)
                {
                    printf("7");
                }
                printf("4");
            }
            else if(!beyond(a3,a4+1))
            {
                a1-=a3;
                a2-=a4+1;
                printf("7");
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("74");
                }
                while(a2)
                {
                    printf("7");
                    a2--;
                }
                printf("7");
            }
            else
            {
                printf("-1\n");
            }
        }
        else if(a3>a4)
        {
            if(!beyond(a3,a3))
            {
                a1-=a3;
                a2-=a3;
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("47");
                }
                for(ll i=1;i<=a2+1;i++)
                {
                    printf("7");
                }
            }
            else
            {
                printf("-1");
                return 0;
            }

        }
        else
        {
            if(!beyond(a4,a4))
            {
                a1-=a4;
                a2-=a4;
                printf("7");
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a4-1;i++)
                {
                    printf("74");
                }
                a2++;
                while(a2)
                {
                    printf("7");
                    a2--;
                }
                printf("4");
            }
            else
            {
                printf("-1");
            }
        }
    }
}
/*
2
1 2
1 2
100
*/


/*
���
ģ��ͼ��
��С����
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long LL;
const ll MAXN=1e5+5;
const ll INF=1e6;
ll a1,a2,a3,a4;
bool beyond(ll x,ll y)
{
    if(x>a1||y>a2)
    {
        return true;
    }
    return false;
}
int main()
{
    while(~scanf("%lld %lld %lld %lld",&a1,&a2,&a3,&a4))
    {
        if(fabs(a3-a4)>=2)
        {
            printf("-1\n");
            return 0;
        }
        else if(a3==a4)
        {
            if(!beyond(a3+1,a4))
            {
                a1-=a3+1;
                a2-=a4;
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                printf("7");
                for(ll i=2;i<=a3;i++)
                {
                    printf("47");
                }
                for(ll i=1;i<=a2;i++)
                {
                    printf("7");
                }
                printf("4");
            }
            else if(!beyond(a3,a4+1))
            {
                a1-=a3;
                a2-=a4+1;
                printf("7");
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("74");
                }
                while(a2)
                {
                    printf("7");
                    a2--;
                }
                printf("7");
            }
            else
            {
                printf("-1\n");
            }
        }
        else if(a3>a4)
        {
            if(!beyond(a3,a3))
            {
                a1-=a3;
                a2-=a3;
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                printf("7");
                for(ll i=2;i<=a3;i++)
                {
                    printf("47");
                }
                for(ll i=1;i<=a2;i++)
                {
                    printf("7");
                }
            }
            else
            {
                printf("-1");
                return 0;
            }

        }
        else
        {
            if(!beyond(a4,a4))
            {
                a1-=a4;
                a2-=a4;
                printf("7");
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a4-1;i++)
                {
                    printf("74");
                }
                a2++;
                while(a2)
                {
                    printf("7");
                    a2--;
                }
                printf("4");
            }
            else
            {
                printf("-1");
            }
        }
    }
}
/*
2
1 2
1 2
100
*/


/*
���
ģ��ͼ��
��С����
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long LL;
const ll MAXN=1e5+5;
const ll INF=1e6;
ll a1,a2,a3,a4;
bool beyond(ll x,ll y)
{
    if(x>a1||y>a2)
    {
        return true;
    }
    return false;
}
int main()
{
    while(~scanf("%lld %lld %lld %lld",&a1,&a2,&a3,&a4))
    {
        if(fabs(a3-a4)>=2)
        {
            printf("-1\n");
            return 0;
        }
        else if(a3==a4)
        {
            if(!beyond(a3+1,a4))
            {
                a1-=a3+1;
                a2-=a4;
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=1;i<=a2+1;i++)
                {
                    printf("7");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("47");
                }
                printf("4");
            }
            else if(!beyond(a3,a4+1))
            {
                a1-=a3;
                a2-=a4+1;
                for(ll i=1;i<=a2+1;i++)
                {
                    printf("7");
                }
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("74");
                }
                printf("7");
            }
            else
            {
                printf("-1\n");
            }
        }
        else if(a3>a4)
        {
            if(!beyond(a3,a3))
            {
                a1-=a3;
                a2-=a3;
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=1;i<=a2+1;i++)
                {
                    printf("7");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("47");
                }
            }
            else
            {
                printf("-1");
                return 0;
            }

        }
        else
        {
            if(!beyond(a4,a4))
            {
                a1-=a4;
                a2-=a4;
                for(ll i=1;i<=a2+1;i++)
                {
                    printf("7");
                }
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a4;i++)
                {
                    printf("74");
                }
            }
            else
            {
                printf("-1");
            }
        }
    }
}
/*
2
1 2
1 2
100
*/


/*
���
ģ��ͼ��
��С����
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long LL;
const ll MAXN=1e5+5;
const ll INF=1e6;
ll a1,a2,a3,a4;
bool beyond(ll x,ll y)
{
    if(x>a1||y>a2)
    {
        return true;
    }
    return false;
}
int main()
{
    while(~scanf("%lld %lld %lld %lld",&a1,&a2,&a3,&a4))
    {
        if(fabs(a3-a4)>=2)
        {
            printf("-1\n");
            return 0;
        }
        else if(a3==a4)
        {
            if(!beyond(a3+1,a4))
            {
                a1-=a3+1;
                a2-=a4;
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("47");
                }
                for(ll i=1;i<=a2+1;i++)
                {
                    printf("7");
                }
                printf("4");
            }
            else if(!beyond(a3,a4+1))
            {
                a1-=a3;
                a2-=a4+1;
                printf("7");
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("74");
                }
                while(a2)
                {
                    printf("7");
                    a2--;
                }
                printf("7");
            }
            else
            {
                printf("-1\n");
            }
        }
        else if(a3>a4)
        {
            if(!beyond(a3,a3))
            {
                a1-=a3;
                a2-=a3;
                for(ll i=1;i<=a1+1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a3;i++)
                {
                    printf("47");
                }
                for(ll i=1;i<=a2+1;i++)
                {
                    printf("7");
                }
            }
            else
            {
                printf("-1");
                return 0;
            }

        }
        else
        {
            if(!beyond(a4,a4))
            {
                a1-=a4;
                a2-=a4;
                printf("7");
                for(ll i=1;i<=a1;i++)
                {
                    printf("4");
                }
                for(ll i=2;i<=a4-1;i++)
                {
                    printf("74");
                }
                while(a2)
                {
                    printf("7");
                    a2--;
                }
                printf("4");
            }
            else
            {
                printf("-1");
            }
        }
    }
}
/*
2
1 2
1 2
100
*/


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<utility>
#include<cstring>
#include<cmath>
#define LL long long int
#define mod 1000000007
#define vi vector<int>
#define vvi vector < vi >
#define pii pair<int,int>
#define all(c) c.begin(),c.end()
#define sf(x) scanf("%d",&x);
#define sf2(x,y) scanf("%d%d",&x,&y);
#define mem(a,val) memset(a,val,sizeof(a))
#define nl printf("\n");
#define pb push_back
#define mp make_pair
//#define f first
//#define s second
#define cf I64
using namespace std;
void four(int n){for(int i=0;i<n;i++)printf("4");}
void seven(int n){for(int i=0;i<n;i++)printf("7");}
void fourty_seven(int n){for(int i=0;i<n;i++)printf("47");}
void seventy_four(int n){for(int i=0;i<n;i++)printf("74");}
int main()
{   int t,i,j,n,m,ans,sum,a1,a2,a3,a4;
    cin>>a1>>a2>>a3>>a4;
    if(a1>=max(a3,a4)&&a2>=max(a3,a4))
    {   if(a3==a4-1)
        {   four(a1-a3);
            fourty_seven(a3);
            seven(a2-a3);
        }
        else if(a4==a3-1)
        {   seven(a2-a4);
            seventy_four(a4);
            four(a1-a4);
        }
        else if(a3==a4)
        {   if(a1>a3)
            {   four(a1-a3-1);
                fourty_seven(1);
                seven(a2-a3);
                fourty_seven(a3-1);
                four(1);
            }
            else if(a2>a3)
            {   seven(a2-a4-1);
                seventy_four(1);
                four(a1-a3);
                seventy_four(a3-1);
                seven(1);
            }
        }
        else cout<<"-1";
    }
    else
        cout<<"-1";
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<utility>
#include<cstring>
#include<cmath>
#define LL long long int
#define mod 1000000007
#define vi vector<int>
#define vvi vector < vi >
#define pii pair<int,int>
#define all(c) c.begin(),c.end()
#define sf(x) scanf("%d",&x);
#define sf2(x,y) scanf("%d%d",&x,&y);
#define mem(a,val) memset(a,val,sizeof(a))
#define nl printf("\n");
#define pb push_back
#define mp make_pair
//#define f first
//#define s second
#define cf I64
using namespace std;
void four(int n){for(int i=0;i<n;i++)printf("4");}
void seven(int n){for(int i=0;i<n;i++)printf("7");}
void fourty_seven(int n){for(int i=0;i<n;i++)printf("47");}
void seventy_four(int n){for(int i=0;i<n;i++)printf("74");}
int main()
{   int t,i,j,n,m,ans,sum,a1,a2,a3,a4;
    cin>>a1>>a2>>a3>>a4;
    if(a1>=max(a3,a4)&&a2>=max(a3,a4))
    {   if(a3==a4+1)
        {   four(a1-a3);
            fourty_seven(a3);
            seven(a2-a3);
        }
        else if(a4==a3+1)
        {   seven(a2-a4);
            seventy_four(a4);
            four(a1-a4);
        }
        else if(a3==a4)
        {   if(a1>a3)
            {   four(a1-a3-1);
                fourty_seven(1);
                seven(a2-a3);
                fourty_seven(a3-1);
                four(1);
            }
            else if(a2>a3)
            {   seven(a2-a4-1);
                seventy_four(1);
                four(a1-a3);
                seventy_four(a3-1);
                seven(1);
            }
            else cout<<"-1";
        }
        else cout<<"-1";
    }
    else
        cout<<"-1";
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<utility>
#include<cstring>
#include<cmath>
#define LL long long int
#define mod 1000000007
#define vi vector<int>
#define vvi vector < vi >
#define pii pair<int,int>
#define all(c) c.begin(),c.end()
#define sf(x) scanf("%d",&x);
#define sf2(x,y) scanf("%d%d",&x,&y);
#define mem(a,val) memset(a,val,sizeof(a))
#define nl printf("\n");
#define pb push_back
#define mp make_pair
//#define f first
//#define s second
#define cf I64
using namespace std;
void four(int n){for(int i=0;i<n;i++)printf("4");}
void seven(int n){for(int i=0;i<n;i++)printf("7");}
void fourty_seven(int n){for(int i=0;i<n;i++)printf("47");}
void seventy_four(int n){for(int i=0;i<n;i++)printf("74");}
int main()
{   int t,i,j,n,m,ans,sum,a1,a2,a3,a4;
    cin>>a1>>a2>>a3>>a4;
    if(a1>=max(a3,a4)&&a2>=max(a3,a4))
    {   if(a3==a4-1)
        {   four(a1-a3);
            fourty_seven(a3);
            seven(a2-a3);
        }
        else if(a4==a3-1)
        {   seven(a2-a4);
            seventy_four(a4);
            four(a1-a4);
        }
        else if(a3==a4)
        {   if(a1>a3)
            {   four(a1-a3-1);
                fourty_seven(1);
                seven(a2-a3);
                fourty_seven(a3-1);
                four(1);
            }
            else if(a2>a3)
            {   seven(a2-a4-1);
                seventy_four(1);
                four(a1-a3);
                seventy_four(a3-1);
                seven(1);
            }
            else cout<<"-1";
        }
        else cout<<"-1";
    }
    else
        cout<<"-1";
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<utility>
#include<cstring>
#include<cmath>
#define LL long long int
#define mod 1000000007
#define vi vector<int>
#define vvi vector < vi >
#define pii pair<int,int>
#define all(c) c.begin(),c.end()
#define sf(x) scanf("%d",&x);
#define sf2(x,y) scanf("%d%d",&x,&y);
#define mem(a,val) memset(a,val,sizeof(a))
#define nl printf("\n");
#define pb push_back
#define mp make_pair
//#define f first
//#define s second
#define cf I64
using namespace std;
void four(int n){for(int i=0;i<n;i++)printf("4");}
void seven(int n){for(int i=0;i<n;i++)printf("7");}
void fourty_seven(int n){for(int i=0;i<n;i++)printf("47");}
void seventy_four(int n){for(int i=0;i<n;i++)printf("74");}
int main()
{   int t,i,j,n,m,ans,sum,a1,a2,a3,a4;
    cin>>a1>>a2>>a3>>a4;
    if(a1>=max(a3,a4)&&a2>=max(a3,a4))
    {   if(a3==a4+1)
        {   four(a1-a3);
            fourty_seven(a3);
            seven(a2-a3);
        }
        else if(a4==a3+1)
        {   seven(1);
            four(a1-a4+1);
            seventy_four(a4-2);
            seven(a2-a4+1);
            four(1);
        }
        else if(a3==a4)
        {   if(a1>a3)
            {   four(a1-a3-1);
                fourty_seven(a3);
                seven(a2-a3);
                four(1);
            }
            else if(a2>a3&&a1==a3)
            {   seventy_four(a3);
                seven(a2-a3);
            }
            else if(a2>a3)
            {   four(a1-a3);
                fourty_seven(a3);
                seven(a2-a3);
            }
            else cout<<"-1";
        }
        else cout<<"-1";
    }
    else
        cout<<"-1";
    return 0;
}


#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>

#define MP(x, y) std::make_pair(x, y)
#define X first
#define Y second

#define REP(i, n)    for (int i(0), upper_##i(n); i <  upper_##i; ++i)
#define FOR(i, a, b) for (int i(a), upper_##i(b); i <  upper_##i; ++i)
#define BET(i, a, b) for (int i(a), upper_##i(b); i <= upper_##i; ++i)

#define PB(a)  push_back(a)
#define ALL(v) v.begin(), v.end()

#define CLR(a)     memset(a, 0, sizeof(a))
#define COPY(a, b) memcpy(a, b, sizeof(a))
#define FILL(a, b) memset(a, b, sizeof(a))

typedef std::pair<int, int> PII;
typedef std::vector<int> VI;
typedef std::vector<PII> VII;
typedef std::vector<VI> VVI;
typedef std::vector<VII> VVII;

using llong = long long;
constexpr int INF =  0x3f3f3f3f;
constexpr int NINF = 0xc0c0c0c0;
constexpr llong INFLL =  0x3f3f3f3f3f3f3f3fLL;
constexpr llong NINFLL = 0xc0c0c0c0c0c0c0c0LL;

std::string multi_string(int n, const std::string& str)
{
  std::string res;
  REP(i, n) {
    res += str;
  }
  return res;
}

std::string multi_string(int n, const char* cstr)
{ return multi_string(n, std::string(cstr)); }

void string_insert(std::string& str, int pos, const std::string& to_insert)
{
  str = str.substr(0, pos) + to_insert + str.substr(pos, str.length() - pos);
}

void insert4(std::string& str, int cnt4)
{
  string_insert(str, str.find("4"), multi_string(cnt4, "4"));
}

void insert7(std::string& str, int cnt7)
{
  string_insert(str, str.rfind("7"), multi_string(cnt7, "7"));
}

int main(int argc, char const *argv[])
{
  int _4, _7, _47, _74;
  scanf("%d %d %d %d", &_4, &_7, &_47, &_74);
  std::string res;
  int n = _4 + _7;
  if (abs(_47 - _74) >= 2) {
    printf("-1\n");
    return 0;
  }
  if (_47 == _74) {
    if (_7 >= _47 && _4 >= _47 + 1) {
      res += multi_string(_47, "47");
      res += "4";
      insert4(res, _4 - _47 - 1);
      insert7(res, _7 - _47);
    }
    else if (_4 >= _47 && _7 >= _47 + 1) {
      res += multi_string(_74, "74");
      res += "7";
      insert4(res, _4 - _47);
      insert7(res, _7 - _47 - 1);
    }
    else {
      res = "-1";
    }
  }
  else if (_47 == _74 + 1) {
    if (_4 >= _47 && _7 >= _47) {
      res += multi_string(_47, "47");
      insert7(res, _7 - _47);
      insert4(res, _4 - _47);
    }
    else {
      res = "-1";
    }
  }
  else {
    if (_4 >= _74 && _7 >= _74) {
      res += multi_string(_74, "74");
      insert7(res, _7 - _74);
      insert4(res, _4 - _74);
    }
    else {
      res = "-1";
    }
  }
  std::cout << res << std::endl;
  return 0;
}


#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>

#define MP(x, y) std::make_pair(x, y)
#define X first
#define Y second

#define REP(i, n)    for (int i(0), upper_##i(n); i <  upper_##i; ++i)
#define FOR(i, a, b) for (int i(a), upper_##i(b); i <  upper_##i; ++i)
#define BET(i, a, b) for (int i(a), upper_##i(b); i <= upper_##i; ++i)

#define PB(a)  push_back(a)
#define ALL(v) v.begin(), v.end()

#define CLR(a)     memset(a, 0, sizeof(a))
#define COPY(a, b) memcpy(a, b, sizeof(a))
#define FILL(a, b) memset(a, b, sizeof(a))

typedef std::pair<int, int> PII;
typedef std::vector<int> VI;
typedef std::vector<PII> VII;
typedef std::vector<VI> VVI;
typedef std::vector<VII> VVII;

using llong = long long;
constexpr int INF =  0x3f3f3f3f;
constexpr int NINF = 0xc0c0c0c0;
constexpr llong INFLL =  0x3f3f3f3f3f3f3f3fLL;
constexpr llong NINFLL = 0xc0c0c0c0c0c0c0c0LL;

std::string multi_string(int n, const std::string& str)
{
  std::string res;
  REP(i, n) {
    res += str;
  }
  return res;
}

std::string multi_string(int n, const char* cstr)
{ return multi_string(n, std::string(cstr)); }

void string_insert(std::string& str, int pos, const std::string& to_insert)
{
  str = str.substr(0, pos) + to_insert + str.substr(pos, str.length() - pos);
}

void insert4(std::string& str, int cnt4)
{
  string_insert(str, str.find("4"), multi_string(cnt4, "4"));
}

void insert7(std::string& str, int cnt7)
{
  string_insert(str, str.rfind("7"), multi_string(cnt7, "7"));
}

int main(int argc, char const *argv[])
{
  int _4, _7, _47, _74;
  scanf("%d %d %d %d", &_4, &_7, &_47, &_74);
  std::string res;
  int n = _4 + _7;
  if (abs(_47 - _74) >= 2) {
    printf("-1\n");
    return 0;
  }
  if (_47 == _74) {
    if (_7 >= _47 && _4 >= _47 + 1) {
      res += multi_string(_47, "47");
      res += "4";
      insert4(res, _4 - _47 - 1);
      insert7(res, _7 - _47);
    }
    else if (_4 >= _47 && _7 >= _47 + 1) {
      res += multi_string(_74, "74");
      res += "7";
      insert4(res, _4 - _47);
      insert7(res, _7 - _47 - 1);
    }
    else {
      res = "-1";
    }
  }
  else if (_47 == _74 + 1) {
    if (_47 >= _4 && _47 >= _7) {
      res += multi_string(_4 - _47, "4");
      res += multi_string(_47, "47");
      res += multi_string(_47 - _7, "7");
    }
    else {
      res = "-1";
    }
  }
  else {
    if (_74 >= _4 && _74 >= _7) {
      res += multi_string(_7 - _74, "7");
      res += multi_string(_74, "74");
      res += multi_string(_4 - _74, "4");
    }
    else {
      res = "-1";
    }
  }
  std::cout << res << std::endl;
  return 0;
}


#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>

#define MP(x, y) std::make_pair(x, y)
#define X first
#define Y second

#define REP(i, n)    for (int i(0), upper_##i(n); i <  upper_##i; ++i)
#define FOR(i, a, b) for (int i(a), upper_##i(b); i <  upper_##i; ++i)
#define BET(i, a, b) for (int i(a), upper_##i(b); i <= upper_##i; ++i)

#define PB(a)  push_back(a)
#define ALL(v) v.begin(), v.end()

#define CLR(a)     memset(a, 0, sizeof(a))
#define COPY(a, b) memcpy(a, b, sizeof(a))
#define FILL(a, b) memset(a, b, sizeof(a))

typedef std::pair<int, int> PII;
typedef std::vector<int> VI;
typedef std::vector<PII> VII;
typedef std::vector<VI> VVI;
typedef std::vector<VII> VVII;

using llong = long long;
constexpr int INF =  0x3f3f3f3f;
constexpr int NINF = 0xc0c0c0c0;
constexpr llong INFLL =  0x3f3f3f3f3f3f3f3fLL;
constexpr llong NINFLL = 0xc0c0c0c0c0c0c0c0LL;

std::string multi_string(int n, const std::string& str)
{
  std::string res;
  REP(i, n) {
    res += str;
  }
  return res;
}

std::string multi_string(int n, const char* cstr)
{ return multi_string(n, std::string(cstr)); }

void string_insert(std::string& str, int pos, const std::string& to_insert)
{
  str = str.substr(0, pos) + to_insert + str.substr(pos, str.length() - pos);
}

void insert4(std::string& str, int cnt4)
{
  string_insert(str, str.find("4"), multi_string(cnt4, "4"));
}

void insert7(std::string& str, int cnt7)
{
  string_insert(str, str.rfind("7"), multi_string(cnt7, "7"));
}

int main(int argc, char const *argv[])
{
  int _4, _7, _47, _74;
  scanf("%d %d %d %d", &_4, &_7, &_47, &_74);
  std::string res;
  int n = _4 + _7;
  if (abs(_47 - _74) >= 2) {
    printf("-1\n");
    return 0;
  }
  if (_47 == _74) {
    if (_7 >= _47 && _4 >= _47 + 1) {
      res += multi_string(_47, "47");
      res += "4";
      insert4(res, _4 - _47 - 1);
      insert7(res, _7 - _47);
    }
    else if (_4 >= _47 && _7 >= _47 + 1) {
      res += multi_string(_74, "74");
      res += "7";
      insert4(res, _4 - _47);
      insert7(res, _7 - _47 - 1);
    }
    else {
      res = "-1";
    }
  }
  else if (_47 == _74 + 1) {
    if (_4 >= _47 && _7 >= _47) {
      res += multi_string(_4 - _47, "4");
      res += multi_string(_47, "47");
      res += multi_string(_47 - _7, "7");
    }
    else {
      res = "-1";
    }
  }
  else {
    if (_4 >= _74 && _7 >= _74) {
      res += multi_string(_7 - _74, "7");
      res += multi_string(_74, "74");
      res += multi_string(_4 - _74, "4");
    }
    else {
      res = "-1";
    }
  }
  std::cout << res << std::endl;
  return 0;
}


// eddy1021
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long ll;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef pair<LD,LD> Pt;
#define mod9 1000000009ll
#define mod7 1000000007ll
#define INF  1023456789ll
#define INF16 10000000000000000ll
#define FI first
#define SE second
#define X FI
#define Y SE
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define eps 1e-9
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...)
#endif
inline ll getint(){
  ll _x=0,_tmp=1; char _tc=getchar();
  while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
  if( _tc == '-' ) _tc=getchar() , _tmp = -1;
  while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
  return _x*_tmp;
}
ll mypow( ll _a , ll _x , ll _mod ){
  if( _x == 0 ) return 1ll;
  ll _tmp = mypow( _a , _x / 2 , _mod );
  _tmp = ( _tmp * _tmp ) % _mod;
  if( _x & 1 ) _tmp = ( _tmp * _a ) % _mod;
  return _tmp;
}
inline ll add( ll _x , ll _y , ll _mod = mod7 ){
  ll _ = _x + _y;
  if( _ >= _mod ) _ -= _mod;
  return _;
}
inline ll sub( ll _x , ll _y , ll _mod = mod7 ){
  ll _ = _x - _y;
  if( _ < 0 ) _ += _mod;
  return _;
}
inline ll mul( ll _x , ll _y , ll _mod = mod7 ){
  ll _ = _x * _y;
  if( _ >= _mod ) _ %= _mod;
  return _;
}
inline bool equal( D _x ,  D _y ){
  return _x > _y - eps && _x < _y + eps;
}
int __ = 1 , _cs;
/*********default*********/
void build(){

}
#define N 1010101
int a[ 9 ] , c[ N ];
void init(){
  for( int i = 1 ; i <= 4 ; i ++ )
    a[ i ] = getint();
}
void solve(){
  if( a[ 3 ] == 0 ){
    if( a[ 4 ] == 0 ){
      if( a[ 1 ] && a[ 2 ] ){
        puts( "-1" );
        exit( 0 );
      }
      for( int i = 0 ; i < a[ 1 ] ; i ++ )
        putchar( '4' );
      for( int i = 0 ; i < a[ 2 ] ; i ++ )
        putchar( '7' );
      puts( "" );
      exit( 0 );
    }
    if( a[ 4 ] > 1 ){
      puts( "-1" );
      exit( 0 );
    }
    if( a[ 1 ] == 0 || a[ 2 ] == 0 ){
      puts( "-1" );
      exit( 0 );
    }
    for( int i = 0 ; i < a[ 2 ] ; i ++ )
      putchar( '7' );
    for( int i = 0 ; i < a[ 1 ] ; i ++ )
      putchar( '4' );
    puts( "" );
  }else if( a[ 4 ] == 0 ){
    if( a[ 3 ] > 1 ){
      puts( "-1" );
      exit( 0 );
    }
    if( a[ 1 ] == 0 || a[ 2 ] == 0 ){
      puts( "-1" );
      exit( 0 );
    }
    for( int i = 0 ; i < a[ 1 ] ; i ++ )
      putchar( '4' );
    for( int i = 0 ; i < a[ 2 ] ; i ++ )
      putchar( '7' );
    puts( "" );
  }else if( a[ 3 ] == a[ 4 ] + 1 ){
    if( a[ 1 ] < a[ 3 ] || a[ 2 ] < a[ 3 ] ){
      puts( "-1" );
      exit( 0 );
    }
    for( int i = a[ 3 ] ; i < a[ 1 ] ; i ++ )
      putchar( '4' );
    for( int i = 0 ; i < a[ 3 ] ; i ++ )
      printf( "47" );
    for( int i = a[ 3 ] ; i < a[ 2 ] ; i ++ )
      putchar( '7' );
    puts( "" );
  }else if( a[ 4 ] == a[ 3 ] + 1 ){
    if( a[ 1 ] < a[ 4 ] || a[ 2 ] < a[ 4 ] ){
      puts( "-1" );
      exit( 0 );
    }
    putchar( '7' );
    for( int i = a[ 3 ] ; i < a[ 1 ] ; i ++ )
      putchar( '4' );
    for( int i = 1 ; i < a[ 3 ] ; i ++ )
      printf( "74" );
    for( int i = a[ 3 ] ; i < a[ 2 ] ; i ++ )
      putchar( '7' );
    putchar( '4' );
  }else if( a[ 3 ] == a[ 4 ] ){
    if( a[ 1 ] < a[ 3 ] || a[ 2 ] < a[ 3 ] ){
      puts( "-1" );
      exit( 0 );
    }else if( a[ 1 ] == a[ 3 ] ){
      if( a[ 2 ] < a[ 3 ] + 1 ){
        puts( "-1" );
        exit( 0 );
      }
      for( int i = 0 ; i < a[ 3 ] ; i ++ )
        printf( "74" );
      for( int i = a[ 3 ] ; i < a[ 2 ] ; i ++ )
        putchar( '7' );
      puts( "" );
    }else if( a[ 2 ] == a[ 3 ] ){
      if( a[ 1 ] < a[ 3 ] + 1 ){
        puts( "-1" );
        exit( 0 );
      }
      for( int i = a[ 3 ] ; i < a[ 1 ] ; i ++ )
        putchar( '4' );
      for( int i = 0 ; i < a[ 3 ] ; i ++ )
        printf( "74" );
      puts( "" );
    }else{
      for( int i = a[ 3 ] ; i < a[ 1 ] ; i ++ )
        putchar( '4' );
      for( int i = 1 ; i < a[ 3 ] ; i ++ )
        printf( "74" );
      for( int i = a[ 3 ] ; i <= a[ 2 ] ; i ++ )
        putchar( '7' );
      putchar( '4' );
      puts( "" );
    }
  }else{
    puts( "-1" );
    exit( 0 );
  }
}
int main(){
  build();
  //__ = getint();
  while( __ -- ){
    init();
    solve();
  }
}


// eddy1021
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long ll;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef pair<LD,LD> Pt;
#define mod9 1000000009ll
#define mod7 1000000007ll
#define INF  1023456789ll
#define INF16 10000000000000000ll
#define FI first
#define SE second
#define X FI
#define Y SE
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define eps 1e-9
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...)
#endif
inline ll getint(){
  ll _x=0,_tmp=1; char _tc=getchar();
  while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
  if( _tc == '-' ) _tc=getchar() , _tmp = -1;
  while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
  return _x*_tmp;
}
ll mypow( ll _a , ll _x , ll _mod ){
  if( _x == 0 ) return 1ll;
  ll _tmp = mypow( _a , _x / 2 , _mod );
  _tmp = ( _tmp * _tmp ) % _mod;
  if( _x & 1 ) _tmp = ( _tmp * _a ) % _mod;
  return _tmp;
}
inline ll add( ll _x , ll _y , ll _mod = mod7 ){
  ll _ = _x + _y;
  if( _ >= _mod ) _ -= _mod;
  return _;
}
inline ll sub( ll _x , ll _y , ll _mod = mod7 ){
  ll _ = _x - _y;
  if( _ < 0 ) _ += _mod;
  return _;
}
inline ll mul( ll _x , ll _y , ll _mod = mod7 ){
  ll _ = _x * _y;
  if( _ >= _mod ) _ %= _mod;
  return _;
}
inline bool equal( D _x ,  D _y ){
  return _x > _y - eps && _x < _y + eps;
}
int __ = 1 , _cs;
/*********default*********/
void build(){

}
#define N 1010101
int a[ 9 ] , c[ N ];
void init(){
  for( int i = 1 ; i <= 4 ; i ++ )
    a[ i ] = getint();
}
void solve(){
  if( a[ 3 ] == 0 ){
    if( a[ 4 ] == 0 ){
      if( a[ 1 ] && a[ 2 ] ){
        puts( "-1" );
        exit( 0 );
      }
      for( int i = 0 ; i < a[ 1 ] ; i ++ )
        putchar( '4' );
      for( int i = 0 ; i < a[ 2 ] ; i ++ )
        putchar( '7' );
      puts( "" );
      exit( 0 );
    }
    if( a[ 4 ] > 1 ){
      puts( "-1" );
      exit( 0 );
    }
    if( a[ 1 ] == 0 || a[ 2 ] == 0 ){
      puts( "-1" );
      exit( 0 );
    }
    for( int i = 0 ; i < a[ 2 ] ; i ++ )
      putchar( '7' );
    for( int i = 0 ; i < a[ 1 ] ; i ++ )
      putchar( '4' );
    puts( "" );
  }else if( a[ 4 ] == 0 ){
    if( a[ 3 ] > 1 ){
      puts( "-1" );
      exit( 0 );
    }
    if( a[ 1 ] == 0 || a[ 2 ] == 0 ){
      puts( "-1" );
      exit( 0 );
    }
    for( int i = 0 ; i < a[ 1 ] ; i ++ )
      putchar( '4' );
    for( int i = 0 ; i < a[ 2 ] ; i ++ )
      putchar( '7' );
    puts( "" );
  }else if( a[ 3 ] == a[ 4 ] + 1 ){
    if( a[ 1 ] < a[ 3 ] || a[ 2 ] < a[ 3 ] ){
      puts( "-1" );
      exit( 0 );
    }
    for( int i = a[ 3 ] ; i < a[ 1 ] ; i ++ )
      putchar( '4' );
    for( int i = 0 ; i < a[ 3 ] ; i ++ )
      printf( "47" );
    for( int i = a[ 3 ] ; i < a[ 2 ] ; i ++ )
      putchar( '7' );
    puts( "" );
  }else if( a[ 4 ] == a[ 3 ] + 1 ){
    if( a[ 1 ] < a[ 4 ] || a[ 2 ] < a[ 4 ] ){
      puts( "-1" );
      exit( 0 );
    }
    putchar( '7' );
    for( int i = a[ 4 ] ; i < a[ 1 ] ; i ++ )
      putchar( '4' );
    for( int i = 1 ; i < a[ 3 ] ; i ++ )
      printf( "74" );
    for( int i = a[ 4 ] ; i < a[ 2 ] ; i ++ )
      putchar( '7' );
    putchar( '4' );
  }else if( a[ 3 ] == a[ 4 ] ){
    if( a[ 1 ] < a[ 3 ] || a[ 2 ] < a[ 3 ] ){
      puts( "-1" );
      exit( 0 );
    }else if( a[ 1 ] == a[ 3 ] ){
      if( a[ 2 ] < a[ 3 ] + 1 ){
        puts( "-1" );
        exit( 0 );
      }
      for( int i = 0 ; i < a[ 3 ] ; i ++ )
        printf( "74" );
      for( int i = a[ 3 ] ; i < a[ 2 ] ; i ++ )
        putchar( '7' );
      puts( "" );
    }else if( a[ 2 ] == a[ 3 ] ){
      if( a[ 1 ] < a[ 3 ] + 1 ){
        puts( "-1" );
        exit( 0 );
      }
      for( int i = a[ 3 ] ; i < a[ 1 ] ; i ++ )
        putchar( '4' );
      for( int i = 0 ; i < a[ 3 ] ; i ++ )
        printf( "74" );
      puts( "" );
    }else{
      for( int i = a[ 3 ] ; i < a[ 1 ] ; i ++ )
        putchar( '4' );
      for( int i = 1 ; i < a[ 3 ] ; i ++ )
        printf( "74" );
      for( int i = a[ 3 ] ; i <= a[ 2 ] ; i ++ )
        putchar( '7' );
      putchar( '4' );
      puts( "" );
    }
  }else{
    puts( "-1" );
    exit( 0 );
  }
}
int main(){
  build();
  //__ = getint();
  while( __ -- ){
    init();
    solve();
  }
}


#include <bits/stdc++.h>

using namespace std;

bool solve(int c4, int c7, int c47, int c74) {
    if (abs(c47-c74) > 1) return false;
    if (c47 >= c74) {
        int d4 = c47;
        if (c47 == c74) d4++;
        int d7 = c47;
        if (d4 > c4 || d7 > c7) return false;
        while (d4 < c4) {
            cout << '4';
            d4++;
        }
        for (int i = 0; i < c47; i++) cout << "47";
        while (d7 < c7) {
            cout << '7';
            d7++;
        }
        if (c47 == c74) cout << '4';
    }
    else {
        int d7 = c74;
        int d4 = c74;
        if (d4 > c4 || d7 > c7) return false;
        cout << "74";
        while (d4 < c4) {
            cout << '4';
            d4++;
        }
        for (int i = 2; i < c74; i++) cout << "74";
        while (d7 < c7) {
            cout << '7';
            d7++;
        }
        cout << "74";
    }
    return true;
}

int main() {
    int c4, c7, c47, c74;
    cin >> c4 >> c7 >> c47 >> c74;
    if (solve(c4,c7,c47,c74) == false) cout << -1;
    return 0;
}


#include <cmath>
#include <iostream>
using std::cin;
using std::cout;

int main(void) {
    int a1, a2, a3, a4;
    cin >> a1 >> a2 >> a3 >> a4;
    if (abs(a3 - a4) > 1) {
        cout << -1 << std::endl;
        return 0;
    }

    if (a3 - a4 == 1) {
        if (a1 < a3 || a2 < a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3) {
            cout << 7;
            -- a2;
        }
    } else if (a4 - a3 == 1) {
        if (a1 < a4 || a2 < a4) {
            cout << -1 << std::endl;
            return 0;
        }
        cout << 74;
        while (a1-1 > a4) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a4-2; ++ i) cout << 74;
        while (a2-1 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    } else {
        if (a1 <= a3 || a2 <= a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3+1) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3+1) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    }
    cout << std::endl;

    return 0;
}


#include <cmath>
#include <iostream>
using std::cin;
using std::cout;

int main(void) {
    int a1, a2, a3, a4;
    cin >> a1 >> a2 >> a3 >> a4;
    if (abs(a3 - a4) > 1) {
        cout << -1 << std::endl;
        return 0;
    }

    if (a3 - a4 == 1) {
        if (a1 < a3 || a2 < a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3) {
            cout << 7;
            -- a2;
        }
    } else if (a4 - a3 == 1) {
        if (a1 < a4 || a2 < a4) {
            cout << -1 << std::endl;
            return 0;
        }
        cout << 74;
        while (a1 > a4) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a4-2; ++ i) cout << 74;
        while (a2 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    } else {
        if (a1 <= a3 || a2 < a4) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3+1) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 4;
    }
    cout << std::endl;

    return 0;
}


#include <cmath>
#include <iostream>
using std::cin;
using std::cout;

int main(void) {
    int a1, a2, a3, a4;
    cin >> a1 >> a2 >> a3 >> a4;
    if (abs(a3 - a4) > 1) {
        cout << -1 << std::endl;
        return 0;
    }

    if (a3 - a4 == 1) {
        if (a1 < a3 || a2 < a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3) {
            cout << 7;
            -- a2;
        }
    } else if (a4 - a3 == 1) {
        if (a1 < a4 || a2 < a4) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a2 > a4) {
            cout << 7;
            -- a2;
        }
        for (int i = 1; i <= a4; ++ i) cout << 74;
        while (a1 > a4) {
            cout << 4;
            -- a1;
        }
    } else {
        if (a1 <= a3 || a2 <= a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3+1) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3+1) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    }
    cout << std::endl;

    return 0;
}


#include <cmath>
#include <iostream>
using std::cin;
using std::cout;

int main(void) {
    int a1, a2, a3, a4;
    cin >> a1 >> a2 >> a3 >> a4;
    if (abs(a3 - a4) > 1) {
        cout << -1 << std::endl;
        return 0;
    }

    if (a3 - a4 == 1) {
        if (a1 < a3 || a2 < a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3) {
            cout << 7;
            -- a2;
        }
    } else if (a4 - a3 == 1) {
        if (a1 < a4 || a2 < a4) {
            cout << -1 << std::endl;
            return 0;
        }
        cout << 74;
        while (a1-1 > a4) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a4-1; ++ i) cout << 74;
        while (a2-1 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    } else {
        if (a1 <= a3 || a2 <= a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3+1) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3+1) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    }
    cout << std::endl;

    return 0;
}


#include <cmath>
#include <iostream>
using std::cin;
using std::cout;

int main(void) {
    int a1, a2, a3, a4;
    cin >> a1 >> a2 >> a3 >> a4;
    if (abs(a3 - a4) > 1) {
        cout << -1 << std::endl;
        return 0;
    }

    if (a3 - a4 == 1) {
        if (a1 < a3 || a2 < a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3) {
            cout << 7;
            -- a2;
        }
    } else if (a4 - a3 == 1) {
        if (a1 < a4 || a2 < a4) {
            cout << -1 << std::endl;
            return 0;
        }
        cout << 74;
        while (a1 > a4) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a4-2; ++ i) cout << 74;
        while (a2 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    } else {
        if (a1 <= a3 || a2 <= a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3+1) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3+1) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    }
    cout << std::endl;

    return 0;
}


#include <cmath>
#include <iostream>
using std::cin;
using std::cout;

int main(void) {
    int a1, a2, a3, a4;
    cin >> a1 >> a2 >> a3 >> a4;
    if (abs(a3 - a4) > 1) {
        cout << -1 << std::endl;
        return 0;
    }

    if (a3 - a4 == 1) {
        if (a1 < a3 || a2 < a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3) {
            cout << 7;
            -- a2;
        }
    } else if (a4 - a3 == 1) {
        if (a1 < a4 || a2 < a4) {
            cout << -1 << std::endl;
            return 0;
        }
        cout << 74;
        while (a1 > a4) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a4-2; ++ i) cout << 74;
        while (a2 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    } else {
        if (a1 < a3 || a2 < a4) {
            cout << -1 << std::endl;
            return 0;
        }
        if (a1 < a3 + 1) {
            for (int i = 1; i <= a3; ++ i) cout << 74;
            while (a2 > a4) {
                cout << 7;
                -- a2;
            }
            cout << std::endl;
            return 0;
        }
        while (a1 > a3+1) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 4;
    }
    cout << std::endl;

    return 0;
}


#include <cmath>
#include <iostream>
using std::cin;
using std::cout;

int main(void) {
    std::ios::sync_with_stdio(false);
    int a1, a2, a3, a4;
    cin >> a1 >> a2 >> a3 >> a4;
    if (abs(a3 - a4) > 1) {
        cout << -1 << std::endl;
        return 0;
    }

    if (a3 - a4 == 1) {
        if (a1 < a3 || a2 < a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3) {
            cout << 7;
            -- a2;
        }
    } else if (a4 - a3 == 1) {
        if (a1 < a4 || a2 < a4) {
            cout << -1 << std::endl;
            return 0;
        }
        cout << 74;
        while (a1 > a4) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a4-2; ++ i) cout << 74;
        while (a2 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    } else {
        if (a1 < a3 || a2 < a4 || (a1 == a3 && a2 == a4)) {
            cout << -1 << std::endl;
            return 0;
        }
        if (a1 < a3 + 1) {
            for (int i = 1; i <= a3; ++ i) cout << 74;
            while (a2 > a4) {
                cout << 7;
                -- a2;
            }
            cout << std::endl;
            return 0;
        }
        while (a1 > a3+1) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 4;
    }
    cout << std::endl;

    return 0;
}


#include <cmath>
#include <iostream>
using std::cin;
using std::cout;

int main(void) {
    int a1, a2, a3, a4;
    cin >> a1 >> a2 >> a3 >> a4;
    if (abs(a3 - a4) > 1) {
        cout << -1 << std::endl;
        return 0;
    }

    if (a3 - a4 == 1) {
        if (a1 < a3 || a2 < a3) {
            cout << -1 << std::endl;
            return 0;
        }
        while (a1 > a3) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a3) {
            cout << 7;
            -- a2;
        }
    } else if (a4 - a3 == 1) {
        if (a1 < a4 || a2 < a4) {
            cout << -1 << std::endl;
            return 0;
        }
        cout << 74;
        while (a1 > a4) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a4-2; ++ i) cout << 74;
        while (a2 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 74;
    } else {
        if (a1 < a3 || a2 < a4 || (a1 == a3 && a2 == a4)) {
            cout << -1 << std::endl;
            return 0;
        }
        if (a1 < a3 + 1) {
            for (int i = 1; i <= a3; ++ i) cout << 74;
            while (a2 > a4) {
                cout << 7;
                -- a2;
            }
            cout << std::endl;
            return 0;
        }
        while (a1 > a3+1) {
            cout << 4;
            -- a1;
        }
        for (int i = 1; i <= a3; ++ i) cout << 47;
        while (a2 > a4) {
            cout << 7;
            -- a2;
        }
        cout << 4;
    }
    cout << std::endl;

    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define FOR(i,a) for (int i=0;i<(a);++i)
#define FORD(i,a) for (int i=(a)-1;i>=0;i--)
#define FORT(i,a,b) for (int i=(a);i<=(b);++i)
#define FORTD(i,b,a) for (int i=(b);i>=(a);--i)
#define trav(i,v) for (auto i : v)
#define all(v) v.begin(),v.end()
#define ad push_back
#define fr first
#define sc second
#define mpr(a,b) make_pair(a,b)
#define pir pair<int,int>
#define make_unique(v) v.erase(unique(all(v)),v.end())
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define srng mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define y1 EsiHancagorcRepa

const int N=4e5+10;
const ll MOD=1e9+7;
const ll MOD2=998244353;

int w[N];
vector<int> g[N];

int main() {
    fastio;
    srng;
    #ifdef ALEXPC
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if (c>=d+2 || d>=c+2){
        cout<<-1<<endl;
        return 0;
    }
    vector<int> cmp1,cmp2;
    if (c==d){
        if (max(a,b)<c+1 || min(a,b)<c){
            cout<<-1<<endl;
            return 0;
        }
        if (b==c){
            swap(a,b);
            c++;
            cmp1.ad(a-c+1);
            FOR(i,c-1)cmp1.ad(1);
            c--;
            FOR(i,c-1)cmp2.ad(1);
            cmp2.ad(b-c+1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'7';
                FOR(j,cmp2[i])cout<<'4';
            }
            FOR(i,cmp1[c])cout<<'7';
        }
        else{
            c++;
            cmp1.ad(a-c+1);
            FOR(i,c-1)cmp1.ad(1);
            c--;
            FOR(i,c-1)cmp2.ad(1);
            cmp2.ad(b-c+1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'4';
                FOR(j,cmp2[i])cout<<'7';
            }
            FOR(i,cmp1[c])cout<<'4';
        }
    }
    else{
        if (c<d)swap(c,d);
        if (min(a,b)<c){
            cout<<-1<<endl;
            return 0;
        }
        cmp1.ad(a-c+1);
        FOR(i,c-1)cmp1.ad(1);
        FOR(i,c-1)cmp2.ad(1);
        cmp2.ad(b-c+1);
        FOR(i,c){
            FOR(j,cmp1[i])cout<<'4';
            FOR(j,cmp2[i])cout<<'7';
        }
    }
    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define FOR(i,a) for (int i=0;i<(a);++i)
#define FORD(i,a) for (int i=(a)-1;i>=0;i--)
#define FORT(i,a,b) for (int i=(a);i<=(b);++i)
#define FORTD(i,b,a) for (int i=(b);i>=(a);--i)
#define trav(i,v) for (auto i : v)
#define all(v) v.begin(),v.end()
#define ad push_back
#define fr first
#define sc second
#define mpr(a,b) make_pair(a,b)
#define pir pair<int,int>
#define make_unique(v) v.erase(unique(all(v)),v.end())
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define srng mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define y1 EsiHancagorcRepa

const int N=4e5+10;
const ll MOD=1e9+7;
const ll MOD2=998244353;

int w[N];
vector<int> g[N];

int main() {
    fastio;
    srng;
    #ifdef ALEXPC
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if (c>=d+2 || d>=c+2){
        cout<<-1<<endl;
        return 0;
    }
    vector<int> cmp1,cmp2;
    if (c==d){
        if (max(a,b)<c+1 || min(a,b)<c){
            cout<<-1<<endl;
            return 0;
        }
        if (b==c){
            swap(a,b);
            c++;
            FOR(i,c-1)cmp1.ad(1);

            cmp1.ad(a-c+1);
            c--;

            cmp2.ad(b-c+1);
            FOR(i,c-1)cmp2.ad(1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'7';
                FOR(j,cmp2[i])cout<<'4';
            }
            FOR(i,cmp1[c])cout<<'7';
        }
        else{
            c++;
            cmp1.ad(a-c+1);
            FOR(i,c-1)cmp1.ad(1);
            c--;
            FOR(i,c-1)cmp2.ad(1);
            cmp2.ad(b-c+1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'4';
                FOR(j,cmp2[i])cout<<'7';
            }
            FOR(i,cmp1[c])cout<<'4';
        }
    }
    else{
        if (min(a,b)<max(c,d)){
            cout<<-1<<endl;
            return 0;
        }
        if (c>d){
            cmp1.ad(a-c+1);
            FOR(i,c-1)cmp1.ad(1);
            FOR(i,c-1)cmp2.ad(1);
            cmp2.ad(b-c+1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'4';
                FOR(j,cmp2[i])cout<<'7';
            }
        }
        else{
            //cout<<1<<endl;
            c=d;
            swap(a,b);
            FOR(i,c-1)cmp1.ad(1);
            cmp1.ad(a-c+1);
            cmp2.ad(b-c+1);
            FOR(i,c-1)cmp2.ad(1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'7';
                FOR(j,cmp2[i])cout<<'4';
            }
        }
    }
    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define FOR(i,a) for (int i=0;i<(a);++i)
#define FORD(i,a) for (int i=(a)-1;i>=0;i--)
#define FORT(i,a,b) for (int i=(a);i<=(b);++i)
#define FORTD(i,b,a) for (int i=(b);i>=(a);--i)
#define trav(i,v) for (auto i : v)
#define all(v) v.begin(),v.end()
#define ad push_back
#define fr first
#define sc second
#define mpr(a,b) make_pair(a,b)
#define pir pair<int,int>
#define make_unique(v) v.erase(unique(all(v)),v.end())
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define srng mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define y1 EsiHancagorcRepa

const int N=4e5+10;
const ll MOD=1e9+7;
const ll MOD2=998244353;

int w[N];
vector<int> g[N];

int main() {
    fastio;
    srng;
    #ifdef ALEXPC
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if (c>=d+2 || d>=c+2){
        cout<<-1<<endl;
        return 0;
    }
    vector<int> cmp1,cmp2;
    if (c==d){
        if (max(a,b)<c+1 || min(a,b)<c){
            cout<<-1<<endl;
            return 0;
        }
        if (a==c){
            swap(a,b);
            c++;
            FOR(i,c-1)cmp1.ad(1);

            cmp1.ad(a-c+1);
            c--;

            cmp2.ad(b-c+1);
            FOR(i,c-1)cmp2.ad(1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'7';
                FOR(j,cmp2[i])cout<<'4';
            }
            FOR(i,cmp1[c])cout<<'7';
        }
        else{
            c++;
            cmp1.ad(a-c+1);
            FOR(i,c-1)cmp1.ad(1);
            c--;
            FOR(i,c-1)cmp2.ad(1);
            cmp2.ad(b-c+1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'4';
                FOR(j,cmp2[i])cout<<'7';
            }
            FOR(i,cmp1[c])cout<<'4';
        }
    }
    else{
        if (min(a,b)<max(c,d)){
            cout<<-1<<endl;
            return 0;
        }
        if (c>d){
            cmp1.ad(a-c+1);
            FOR(i,c-1)cmp1.ad(1);
            FOR(i,c-1)cmp2.ad(1);
            cmp2.ad(b-c+1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'4';
                FOR(j,cmp2[i])cout<<'7';
            }
        }
        else{
            //cout<<1<<endl;
            c=d;
            swap(a,b);
            FOR(i,c-1)cmp1.ad(1);
            cmp1.ad(a-c+1);
            cmp2.ad(b-c+1);
            FOR(i,c-1)cmp2.ad(1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'7';
                FOR(j,cmp2[i])cout<<'4';
            }
        }
    }
    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define FOR(i,a) for (int i=0;i<(a);++i)
#define FORD(i,a) for (int i=(a)-1;i>=0;i--)
#define FORT(i,a,b) for (int i=(a);i<=(b);++i)
#define FORTD(i,b,a) for (int i=(b);i>=(a);--i)
#define trav(i,v) for (auto i : v)
#define all(v) v.begin(),v.end()
#define ad push_back
#define fr first
#define sc second
#define mpr(a,b) make_pair(a,b)
#define pir pair<int,int>
#define make_unique(v) v.erase(unique(all(v)),v.end())
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define srng mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define y1 EsiHancagorcRepa

const int N=4e5+10;
const ll MOD=1e9+7;
const ll MOD2=998244353;

int w[N];
vector<int> g[N];

int main() {
    fastio;
    srng;
    #ifdef ALEXPC
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if (c>=d+2 || d>=c+2){
        cout<<-1<<endl;
        return 0;
    }
    vector<int> cmp1,cmp2;
    if (c==d){
        if (max(a,b)<c+1 || min(a,b)<c){
            cout<<-1<<endl;
            return 0;
        }
        if (a==c){
            swap(a,b);
            c++;
            cmp1.ad(a-c+1);
            FOR(i,c-1)cmp1.ad(1);
            c--;
            FOR(i,c-1)cmp2.ad(1);
            cmp2.ad(b-c+1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'7';
                FOR(j,cmp2[i])cout<<'4';
            }
            FOR(i,cmp1[c])cout<<'7';
        }
        else{
            c++;
            cmp1.ad(a-c+1);
            FOR(i,c-1)cmp1.ad(1);
            c--;
            FOR(i,c-1)cmp2.ad(1);
            cmp2.ad(b-c+1);
            FOR(i,c){
                FOR(j,cmp1[i])cout<<'4';
                FOR(j,cmp2[i])cout<<'7';
            }
            FOR(i,cmp1[c])cout<<'4';
        }
    }
    else{
        if (c<d)swap(c,d);
        if (min(a,b)<c){
            cout<<-1<<endl;
            return 0;
        }
        cmp1.ad(a-c+1);
        FOR(i,c-1)cmp1.ad(1);
        FOR(i,c-1)cmp2.ad(1);
        cmp2.ad(b-c+1);
        FOR(i,c){
            FOR(j,cmp1[i])cout<<'4';
            FOR(j,cmp2[i])cout<<'7';
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a,b,c,d;
const int sz=2e6+9;
char ans[sz];
int mag[sz];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    scanf("%d %d %d %d",&a,&b,&c,&d);
    n=a+b;
    if(!c&&!d){
        if(a&&b) printf("-1");
        else if(a){
            while(a--) printf("4");
        }else{
            while(b--) printf("7");
        }
        return 0;
    }
    if(max(c,d)-min(c,d)>1){
        printf("-1");
        return 0;
    }
    int needed_a=max(c,d);
    int needed_b=max(c,d);
    if(c==d) needed_a++;
    if(a<needed_a||b<needed_b){
        printf("-1");
        return 0;
    }
    if(c==d+1||c==d){
        for(int i=0;i<c;i++){
            if(i==0){
                int k=a-needed_a;
                while(k--) printf("4");
                printf("47");
                if(i==c-1){
                    int k=b-needed_b;
                    while(k--) printf("7");
                }
            }else if(i==c-1){
                printf("47");
                int k=b-needed_b;
                while(k--) printf("7");
            }else printf("47");
        }
        if(c==d) printf("4");
        return 0;
    }
    for(int i=0;i<d;i++){
        if(i==0){
            if(i==d-1){
                int k=b-needed_b;
                while(k--) printf("7");
            }
            int k=a-needed_a;
            printf("74");
            while(k--) printf("4");
        }else if(i==d-1){
            int k=b-needed_b;
            while(k--) printf("7");
            printf("74");
        }else printf("74");
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a,b,c,d;
const int sz=2e6+9;
char ans[sz];
int mag[sz];

void solve(){
    int n4,n7;
    n4=c+1;
    n7=c;
    int e4=a-n4;
    int e7=b-n7;
    if(n4<=a&&n7<=b){
        while(e4--) printf("4");
        for(int i=0;i<c;i++){
            if(i==c-1){
                printf("47");
                while(e7--) printf("7");
            }else printf("47");
        }
        printf("4");
        return ;
    }
    n4--;
    n7++;
    e4=a-n4;
    e7=b-n7;
    if(n4>a||n7>b){
        printf("-1");
        return ;
    }
    for(int i=0;i<c;i++){
        if(i==0){
            printf("74");
            while(e4--) printf("4");
        }else printf("74");
    }
    printf("7");
    while(e7--) printf("7");
    return ;
}

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    scanf("%d %d %d %d",&a,&b,&c,&d);
    n=a+b;
    if(!c&&!d){
        if(a&&b) printf("-1");
        else if(a){
            while(a--) printf("4");
        }else{
            while(b--) printf("7");
        }
        return 0;
    }
    if(max(c,d)-min(c,d)>1){
        printf("-1");
        return 0;
    }
    int needed_a=max(c,d);
    int needed_b=max(c,d);
    if(c==d){
        solve();
        return 0;
    }
    if(a<needed_a||b<needed_b){
        printf("-1");
        return 0;
    }
    if(c==d+1){
        for(int i=0;i<c;i++){
            if(i==0){
                int k=a-needed_a;
                while(k--) printf("4");
                printf("47");
                if(i==c-1){
                    int k=b-needed_b;
                    while(k--) printf("7");
                }
            }else if(i==c-1){
                printf("47");
                int k=b-needed_b;
                while(k--) printf("7");
            }else printf("47");
        }
        if(c==d) printf("4");
        return 0;
    }
    for(int i=0;i<d;i++){
        if(i==0){
            if(i==d-1){
                int k=b-needed_b;
                while(k--) printf("7");
            }
            int k=a-needed_a;
            printf("74");
            while(k--) printf("4");
        }else if(i==d-1){
            int k=b-needed_b;
            while(k--) printf("7");
            printf("74");
        }else printf("74");
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a,b,c,d;
const int sz=2e6+9;
char ans[sz];
int mag[sz];

void solve(){
    int n4,n7;
    n4=c+1;
    n7=c;
    int e4=a-n4;
    int e7=b-n7;
    if(n4<=a&&n7<=b){
        while(e4--) printf("4");
        for(int i=0;i<c;i++){
            if(i==c-1){
                printf("47");
                while(e7--) printf("7");
            }else printf("47");
        }
        printf("4");
        return ;
    }
    n4--;
    n7++;
    e4=a-n4;
    e7=b-n7;
    if(n4>a||n7>b){
        printf("-1");
        return ;
    }
    for(int i=0;i<c;i++){
        if(i==0){
            printf("74");
            while(e4--) printf("4");
        }else printf("74");
    }
    while(e7--) printf("7");
    return ;
}

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    scanf("%d %d %d %d",&a,&b,&c,&d);
    n=a+b;
    if(!c&&!d){
        if(a&&b) printf("-1");
        else if(a){
            while(a--) printf("4");
        }else{
            while(b--) printf("7");
        }
        return 0;
    }
    if(max(c,d)-min(c,d)>1){
        printf("-1");
        return 0;
    }
    int needed_a=max(c,d);
    int needed_b=max(c,d);
    if(c==d){
        solve();
        return 0;
    }
    if(a<needed_a||b<needed_b){
        printf("-1");
        return 0;
    }
    if(c==d+1){
        for(int i=0;i<c;i++){
            if(i==0){
                int k=a-needed_a;
                while(k--) printf("4");
                printf("47");
                if(i==c-1){
                    int k=b-needed_b;
                    while(k--) printf("7");
                }
            }else if(i==c-1){
                printf("47");
                int k=b-needed_b;
                while(k--) printf("7");
            }else printf("47");
        }
        if(c==d) printf("4");
        return 0;
    }
    for(int i=0;i<d;i++){
        if(i==0){
            if(i==d-1){
                int k=b-needed_b;
                while(k--) printf("7");
            }
            int k=a-needed_a;
            printf("74");
            while(k--) printf("4");
        }else if(i==d-1){
            int k=b-needed_b;
            while(k--) printf("7");
            printf("74");
        }else printf("74");
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define ss(x) scanf("%s",x)
#define mod 1000000007
#define bitcount __builtin_popcountll
#define ll long long
#define pb push_back
#define pi pair<int,int>
#define pii pair<pi,int>
#define mp make_pair
int main()
{
	int i,j,k;
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	vector<char>v;
	if(abs(c-d)>1)
		printf("-1\n");
	else
	{
		if(c==d)
		{
			int x=a-c;
			int y=b-c;
			if(x<0||y<0||x+y<1)
			{
				printf("-1\n");
				return 0;
			}
			if(a>b)
			{
				while(x--)
					printf("4");
				while(c!=1)
				{
					printf("74");
					c--;
				}
				while(y--)
					printf("7");
				printf("74");
			}
			else
			{
				printf("7");
				y--;
				while(x--)
					printf("4");
				printf("47");
				c--;
				while(c--)
					printf("47");
				while(y--)
					printf("7");
			}
		}
		else if(c>d)
		{
			int x=a-c;
			int y=b-c;
			if(x<0||y<0)
			{
				printf("-1\n");
				return 0;
			}
			while(x--)
				printf("4");
			while(c--)
				printf("47");
			while(y--)
				printf("7");
		}
		else
		{
			int x=a-d;
			int y=b-d;
			if(x<0||y<0)
			{
				printf("-1\n");
				return 0;
			}
			if(d==2)
			{
				printf("7");
				while(x--)
					printf("4");
				printf("47");
				while(y--)
					printf("7");
				printf("4");
			}
			else
			{
				printf("74");
				while(x--)
					printf("4");
				d--;
				while(d!=1)
				{
					d--;
					printf("74");
				}
				while(y--)
					printf("7");
				printf("74");
			}
		}
	}
	return 0;
}