jiahuimbzuai/CoQuIR huggingface dataset:
//  [python]
import sys

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())


def main():
    ABCD = list(input())
    for ops in range(2**3):
        t = int(ABCD[0])
        ans = ABCD[0]
        for i in range(3):
            if (ops>>i)&1:
                t += int(ABCD[i+1])
                ans += '+'+ABCD[i+1]
            else:
                t -= int(ABCD[i+1])
                ans += '-'+ABCD[i+1]
        if t == 7:
            ans += '=7'
            print(ans)
            return


if __name__ == '__main__':
    main()
//  [python]
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys
S = sys.stdin.readline().rstrip()
A,B,C,D = [int(c) for c in S]

def calc(s,i,ops):
    #print(i,s,ops)
    if i == 4:
        if s == 7:
            print(S[0]+ops[0]+S[1]+ops[1]+S[2]+ops[2]+S[3]+"=7")
            exit(0)
        else:
            return
    calc(s+int(S[i]),i+1,ops+["+"])
    calc(s-int(S[i]),i+1,ops+["-"])

calc(int(S[0]),1,[])
//  [python]
correct = []
def dfs(i, s, stack):
	if i == 4:

		if eval(''.join(stack)) == 7:
			correct.append(''.join(stack) + '=7')
			return True
		else:
			return False

	if dfs(i+1, s,stack + ['+', s[i]]): return True
	if dfs(i+1, s,stack + ['-', s[i]]): return True
	return False
s = raw_input()
dfs(1, s, [s[0]])
print correct[0]
//  [java]

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

import static java.lang.System.in;

public class Main {

    public static int[] intInputs = new int[4];

    static String combination = "";

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));

        char[] inputs = reader.readLine().toCharArray();
        for (int i = 0; i < 4; i++) {
            intInputs[i] = Character.getNumericValue(inputs[i]);
        }
        String suffix = "=7";
        solve(1, intInputs[0], 7, "");

        StringBuilder result = new StringBuilder("" + String.valueOf(intInputs[0]));
        for (int i = 0; i < 3; i++) {
            result
                    .append(combination.charAt(i))
                    .append(String.valueOf(intInputs[i + 1]));
        }

        System.out.println(result + suffix);

    }

    public static void solve(int index, int currentValue, int targetValue, String base) {
        if (index == 4 && currentValue == targetValue) {
            combination = base;
        } else if (index < 4) {
            solve(index + 1, currentValue + intInputs[index], targetValue, base + "+");
            solve(index + 1, currentValue - intInputs[index], targetValue, base + "-");
        }
    }


}
//  [java]

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    FastScanner in;
    PrintWriter out;

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

    void solve() {
        int str = in.nextInt();
        int[] input = new int[4];
        int j = 10;
        for (int i = 3; i >= 0; i--) {
            input[i] = str % j;
            str = str / j;
        }
        String[] opers = new String[]{"+", "-"};
        String result = "";
        out:
        for (int i = 0; i < 2; i++) {
            for (int k = 0; k < 2; k++) {
                for (int l = 0; l < 2; l++) {
                    int num = input[0];
                    if (i == 0) {
                        num += input[1];
                    } else {
                        num -= input[1];
                    }
                    if (k == 0) {
                        num += input[2];
                    } else {
                        num -= input[2];
                    }
                    if (l == 0) {
                        num += input[3];
                    } else {
                        num -= input[3];
                    }
                    if (num == 7) {
                        result = input[0] + opers[i] + input[1] + opers[k] + input[2] + opers[l] + input[3] + "=7";
                    }
                }
            }
        }
        System.out.println(result);

    }


    void run() {
        in = new FastScanner();
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }

    public class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

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

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

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

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }

}
//  [java]
import java.util.Scanner;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class Main {

	private static final Integer SEVEN = 7;

	public static void main(String[] args) throws ScriptException {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] abcd = scanner.next().toCharArray();
			for (int i = 0; i < (1 << abcd.length); i++) {
				if (ok(abcd, i)) {
					System.out.println(toFormula(abcd, i) + "=" + SEVEN);
					return;
				}
			}
		}
	}

	/**
	 * abcdと'+'か'-'を表す二進数で数式を組み立てて、結果が7かどうかを判定
	 * 
	 * @param abcd
	 * @param n    '+'か'-'を表す二進数
	 * @return 結果が7かどうか
	 */
	private static boolean ok(char[] abcd, int n) throws ScriptException {
		ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
		return SEVEN.equals(engine.eval(toFormula(abcd, n)));
	}

	/**
	 * abcdと'+'か'-'を表す二進数で数式を組み立てる
	 * 
	 * @param abcd
	 * @param n    '+'か'-'を表す二進数
	 * @return a?b?c?d の数式
	 */
	private static String toFormula(char[] abcd, int n) {
		StringBuilder result = new StringBuilder();
		for (char c : abcd) {
			result.append(c);
			result.append((1 == (n & 1)) ? '+' : '-');
			n >>= 1;
		}
		// 最後の文字を削除
		result.deleteCharAt(result.length() - 1);
		return result.toString();
	}
}
//  [java]
import java.util.Scanner;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class Main {

	private static final Integer SEVEN = 7;

	public static void main(String[] args) throws ScriptException {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] abcd = scanner.next().toCharArray();
			for (int i = 0; i < pow(2, abcd.length) - 1; i++) {
				if (ok(abcd, i)) {
					System.out.println(toFormula(abcd, i) + "=" + SEVEN);
					return;
				}
			}
		}
	}

	/**
	 * nのmべき乗を返す
	 * 
	 * @param n
	 * @param m
	 * @return nのmべき乗
	 */
	private static int pow(int n, int m) {
		int result = 1;
		while (m > 0) {
			if (1 == (m & 1)) {
				result *= n;
			}
			n *= n;
			m >>= 1;
		}
		return result;
	}

	/**
	 * abcdと'+'か'-'を表す二進数で数式を組み立てて、結果が7かどうかを判定
	 * 
	 * @param abcd
	 * @param n    '+'か'-'を表す二進数
	 * @return 結果が7かどうか
	 */
	private static boolean ok(char[] abcd, int n) throws ScriptException {
		ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
		return SEVEN.equals(engine.eval(toFormula(abcd, n)));
	}

	/**
	 * abcdと'+'か'-'を表す二進数で数式を組み立てる
	 * 
	 * @param abcd
	 * @param n    '+'か'-'を表す二進数
	 * @return a?b?c?d の数式
	 */
	private static String toFormula(char[] abcd, int n) {
		StringBuilder result = new StringBuilder();
		for (char c : abcd) {
			result.append(c);
			result.append((1 == (n & 1)) ? '+' : '-');
			n >>= 1;
		}
		// 最後の文字を削除
		result.deleteCharAt(result.length() - 1);
		return result.toString();
	}
}
//  [java]
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Scanner;

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

    static class CTrainTicket {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int[] a = in.next().chars().map(i -> i - '0').toArray();
            for (int i = 0; i < 8; i++) {
                StringBuilder exp = new StringBuilder(Integer.toString(a[0]));
                int val = a[0];
                for (int j = 0; j < 3; j++) {
                    exp.append((i & 1 << j) > 0 ? "+" : "-");
                    exp.append(a[j + 1]);
                    val += a[j + 1] * ((i & 1 << j) > 0 ? 1 : -1);
                }
                if (val == 7) {
                    out.println(exp.append("=7"));
                    return;
                }
            }
        }

    }
}
//  [cpp]
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define LL long long
using namespace std;
const int d[2] = {1, -1};
char s[4];
int a[4];
int main() {
	int i, j, k;
	scanf("%s", s);
	for(i = 0; i < 4; i++) a[i] = s[i]-'0';
	for(i = 0; i < 2; i++){
		for(j = 0; j < 2; j++){
			for(k = 0; k < 2; k++){
				int t = a[0]+d[i]*a[1]+d[j]*a[2]+d[k]*a[3];
				if(t == 7){
					printf("%d%c%d%c%d%c%d=7\n", a[0], i==0?'+':'-', a[1], j==0?'+':'-', a[2], k==0?'+':'-', a[3]);
					return 0;
				}
			}
		}
	}
	return 0;
}
//  [cpp]
#include <stdio.h>
#include <algorithm>
using namespace std;
using ll = long long;

int main() {
	char ABCD[5];
	scanf("%s", ABCD);

	for (int i = 0; i < 4; i++)
		ABCD[i] = ABCD[i] - '0';

	int res = 0;
	for (int i = 0; i < (0x1 << 3); i++) {
		int sum = ABCD[0];
		for (int j = 0; j < 3; j++) {
			if (i & (0x1 << j))
				sum += ABCD[j + 1];
			else
				sum -= ABCD[j + 1];
		}
		if (sum == 7) {
			res = i;
			break;
		}
	}
	printf("%c%c%c%c%c%c%c=7\n", ABCD[0] + '0', res & 1 ? '+' : '-', ABCD[1] + '0', res & 2 ? '+' : '-', ABCD[2] + '0', res & 4 ? '+' : '-', ABCD[3] + '0');
}
//  [cpp]
#include<cstdio>
using namespace std;
int main()
{
    int a,b,c,d;
    scanf("%d",&a);
    d=a%10;
    a/=10;
    c=a%10;
    a/=10;
    b=a%10;
    a/=10;
    if(a+b+c+d==7)printf("%d+%d+%d+%d=7",a,b,c,d);
    else
    if(a+b+c-d==7)printf("%d+%d+%d-%d=7",a,b,c,d);
    else
    if(a+b-c+d==7)printf("%d+%d-%d+%d=7",a,b,c,d);
    else
    if(a+b-c-d==7)printf("%d+%d-%d-%d=7",a,b,c,d);
    else
    if(a-b+c+d==7)printf("%d-%d+%d+%d=7",a,b,c,d);
    else
    if(a-b+c-d==7)printf("%d-%d+%d-%d=7",a,b,c,d);
    else
    if(a-b-c+d==7)printf("%d-%d-%d+%d=7",a,b,c,d);
    else
    if(a-b-c-d==7)printf("%d-%d-%d-%d=7",a,b,c,d);
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
typedef                 long long ll;
typedef                 unsigned long long ull;
#define mkp             make_pair
#define pii             pair<int,int>
#define piii            pair<pii,int>
#define vi              vector<int>
#define PI              acos(-1)
#define all(v)          v.begin(),v.end()
#define mmset(a,val)    memset(a,val,sizeof(a))
#define sc(a)           scanf("%d",&a)
#define sc2(a,b)        scanf("%d%d",&a,&b)
#define sc3(a,b,c)      scanf("%d%d%d",&a,&b,&c)
#define sc4(a,b,c,d)    scanf("%d%d%d%d",&a,&b,&c,&d)
#define sc5(a,b,c,d,e)  scanf("%d%d%d%d%d",&a,&b,&c,&d,&e)
#define scll(a)         scanf("%I64d",&a)
#define scll2(a,b)      scanf("%I64d%I64d",&a,&b)
#define scll3(a,b,c)    scanf("%lld%lld%lld",&a,&b,&c)
#define scll4(a,b,c,d)  scanf("%I64d%I64d%I64d%I64d",&a,&b,&c,&d)
#define Pr(a)           printf("%d\n",a)
#define Prll(a)         printf("%I64d\n",a)
#define pb(a)           push_back(a)
#define SZ              size()
#define tcs(t)          for(int tc=1;tc<=t;tc++)
#define INF             0x3f3f3f3f
#define hash_val        347
#define popcount        __builtin_popcount
#define MOD             1000000007
#define MX              2005
//int fx[]={-1,-1,0,1,1,1,0,-1};
//int fy[]={0,1,1, 1,0,-1,-1,-1};
int Set(int n,int pos){return n=n|(1<<pos);}
int reset(int n,int pos){return n=n& ~ (1<<pos);}
bool check(int n,int pos){return (bool) (n& (1<<pos));}
ll gcd(ll a,ll b){if(b==0)return a;else return gcd(b,a%b);};
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);};
ll l[105];
int main()
{
             //       freopen("input.txt","r",stdin);
            //  freopen("output.txt","w",stdout);

        int a,b,c,d,e;
        char s[5];
        sc(e);
        d=e%10;
        e/=10;
        c=e%10;
        e/=10;
        b=e%10;
        e/=10;
        a=e;
        if(a+b+c+d==7)
            printf("%d+%d+%d+%d=7\n",a,b,c,d);
        else if(a-b+c+d==7)
            printf("%d-%d+%d+%d=7\n",a,b,c,d);
        else if(a+b-c+d==7)
            printf("%d+%d-%d+%d=7\n",a,b,c,d);
        else if(a+b+c-d==7)
            printf("%d+%d+%d-%d=7\n",a,b,c,d);
            else if(a-b-c+d==7)
            printf("%d-%d-%d+%d=7\n",a,b,c,d);
            else if(a-b-c-d==7)
            printf("%d-%d-%d-%d=7\n",a,b,c,d);
            else if(a+b-c-d==7)
            printf("%d+%d-%d-%d=7\n",a,b,c,d);
            else if(a-b+c-d==7)
            printf("%d-%d+%d-%d=7\n",a,b,c,d);



}
//  [cpp]
#include <iostream>
#include <string>

using namespace std;

int main() {

	string s;
	cin >> s;

	string kk = "+-";

	int a[4] = { 0 };
	for (int i = 0; i < 4; i++) {
		a[i] = s[i] - '0';
	}
	if (a[0] + a[1] + a[2] + a[3] == 7) {
		cout << s[0] << '+' << s[1] << '+' << s[2] << '+' << s[3] << "=7" << endl;
	}
	else if (a[0] + a[1] + a[2] - a[3] == 7) {
		cout << s[0] << '+' << s[1] << '+' << s[2] << '-' << s[3] << "=7" << endl;
	}
	else if (a[0] + a[1] - a[2] + a[3] == 7) {
		cout << s[0] << '+' << s[1] << '-' << s[2] << '+' << s[3] << "=7" << endl;
	}
	else if (a[0] + a[1] - a[2] - a[3] == 7) {
		cout << s[0] << '+' << s[1] << '-' << s[2] << '-' << s[3] << "=7" << endl;
	}
	else if (a[0] - a[1] + a[2] + a[3] == 7) {
		cout << s[0] << '-' << s[1] << '+' << s[2] << '+' << s[3] << "=7" << endl;
	}
	else if (a[0] - a[1] + a[2] - a[3] == 7) {
		cout << s[0] << '-' << s[1] << '+' << s[2] << '-' << s[3] << "=7" << endl;
	}
	else if (a[0] - a[1] - a[2] + a[3] == 7) {
		cout << s[0] << '-' << s[1] << '-' << s[2] << '+' << s[3] << "=7" << endl;
	}
	else if (a[0] - a[1] - a[2] - a[3] == 7) {
		cout << s[0] << '-' << s[1] << '-' << s[2] << '-' << s[3] << "=7" << endl;
	}

	return 0;
}
//  [c]
i=8;main(A,B,C,D){scanf("%1d%1d%1d%1d",&A,&B,&C,&D);while(i--)if(A+(i/4%2?-B:B)+(i/2%2?-C:C)+(i%2?-D:D)==7){char p[]={'+','-'};printf("%d%c%d%c%d%c%d=7\n",A,p[i/4%2],B,p[i/2%2],C,p[i%2],D);break;}}
//  [c]
#include<stdio.h>
#include <stdlib.h>
#include <string.h>
 
 
 
int main()
{
 
    int  N;
    int  N0, N1,N2,N3;
   int f0=0,f1=0,f2=0;
   int ans[8];
   char op0,op1,op2;
   int flag;
  int i;
  // 整数の入力
    scanf("%d", &N);
     N0 = N % 10;
     N1 = (N/10 % 10);
     N2 = (N/100)% 10;
     N3 = N/1000;
 
   ans[0]=N3+N2+N1+N0;
   ans[1]=N3+N2+N1-N0;
   ans[2]=N3+N2-N1+N0;
   ans[3]=N3-N2+N1+N0;
   ans[4]=N3+N2-N1-N0;
   ans[5]=N3-N2-N1+N0;
   ans[6]=N3-N2+N1-N0;
   ans[7]=N3-N2-N1-N0;
  
   for(i=0;i<7;i++)
   {
     if(7 == ans[i]){
       flag = i;
       break;
     }
   }
//        printf("%d\n",flag);
  switch (flag) {
	case 0:
		op0='+';
		op1='+';
		op2='+';
        break;
	case 1:
		op0='+';
		op1='+';
		op2='-';
        break;
	case 2:
		op0='+';
		op1='-';
		op2='+';
        break;
	case 3:
		op0='-';
		op1='+';
		op2='+';
        break;
	case 4:
		op0='+';
		op1='-';
		op2='-';
        break;
	case 5:
		op0='-';
		op1='-';
		op2='+';
        break;
	case 6:
		op0='-';
		op1='+';
		op2='-';
        break;
    case 7:
		op0='-';
		op1='-';
		op2='-';
        break;
	default:
		//printf("others\n");
		break;
}
  
     printf("%d%c%d%c%d%c%d=7\n",N3,op0,N2,op1,N1,op2,N0);
//   if ((f0&f1)||(f1&f2)){
//     printf("Yes\n");
//  }else {
//printf("No\n");
//}
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int s[4];
int a[4];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<4;i++){
		a[i]=n%10;
		n/=10;
	}
	for(int i=0;i<4;i++){
		s[i]=a[3-i];
	}
	if(s[0]+s[1]+s[2]+s[3]==7){ printf("%d+%d+%d+%d=7",s[0],s[1],s[2],s[3]);return 0;}
	if(s[0]+s[1]+s[2]-s[3]==7) {printf("%d+%d+%d-%d=7",s[0],s[1],s[2],s[3]);return 0;}
	if(s[0]+s[1]-s[2]+s[3]==7) {printf("%d+%d-%d+%d=7",s[0],s[1],s[2],s[3]);return 0;}
	if(s[0]+s[1]-s[2]-s[3]==7) {printf("%d+%d-%d-%d=7",s[0],s[1],s[2],s[3]);return 0;}
	if(s[0]-s[1]+s[2]+s[3]==7) {printf("%d-%d+%d+%d=7",s[0],s[1],s[2],s[3]);return 0;}
	if(s[0]-s[1]+s[2]-s[3]==7) {printf("%d-%d+%d-%d=7",s[0],s[1],s[2],s[3]);return 0;}
	if(s[0]-s[1]-s[2]+s[3]==7) {printf("%d-%d-%d+%d=7",s[0],s[1],s[2],s[3]);return 0;}
	if(s[0]-s[1]-s[2]-s[3]==7) {printf("%d-%d-%d-%d=7",s[0],s[1],s[2],s[3]);return 0;}


}
//  [c]
#include <stdio.h>
#define MAX 4
int main(void) {
    int i, j, k, a[4], tmp;
    char s[4], m[3];
    scanf("%s", s);
    
    for(i=0; i<4; i++) {
        a[i] = s[i] - '0';
    }
    
    for(i=0; i<1<<3; i++) {
        tmp=a[0];
        for(k=0; k<3; k++)
            m[k]='\0';
        k=0;
        for(j=0; j<3; j++) {
            if(1&i>>j) {
                tmp += a[j+1];
                m[k] = '+';
                k++;
            }else {
                tmp -= a[j+1];
                m[k] = '-';
                k++;
            }
        }
        if(tmp==7) {
            printf("%d%c%d%c%d%c%d=7\n", a[0], m[0], a[1], m[1], a[2], m[2], a[3]);
            return 0;
        }
    }
}
//  [c]
#include<stdio.h>
#include<string.h>
#include<math.h>

int main(void)
{
    int a,b,c,d,i,j,wa = 0,sa = 0,n;
    scanf("%d",&n);
    a = n / 1000;
    b = (n / 100) % 10;
    c = (n / 10) % 10;
    d = n % 10;
    if(a + b + c + d == 7)
    {
        printf("%d+%d+%d+%d=7\n",a,b,c,d);
    }
    else if (a + b + c - d == 7)
    {
        printf("%d+%d+%d-%d=7\n",a,b,c,d);
    }
    else if (a + b - c + d == 7)
    {
        printf("%d+%d-%d+%d=7\n",a,b,c,d);
    }
    else if (a - b + c + d == 7)
    {
        printf("%d-%d+%d+%d=7\n",a,b,c,d);
    }
    else if (a + b - c - d == 7)
    {
        printf("%d+%d-%d-%d=7\n",a,b,c,d);
    }
    else if (a - b - c - d == 7)
    {
        printf("%d-%d-%d-%d=7\n",a,b,c,d);
    }
    else if (a - b - c + d == 7)
    {
        printf("%d-%d-%d+%d=7\n",a,b,c,d);
    }
    else if (a - b + c - d == 7)
    {
        printf("%d-%d+%d-%d=7\n",a,b,c,d);
    }
    return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>

int main()
{
  int a,b,c,d,x;
  char s[4];
  scanf("%s",s);
  x=atoi(s);
  d=x%10;
  c=(x%100)/10;
  b=(x%1000)/100;
  a=x/1000;
  if(a+b+c+d==7) printf("%d+%d+%d+%d=7",a,b,c,d);
  else if(a+b+c-d==7) printf("%d+%d+%d-%d=7",a,b,c,d);
  else if(a+b-c+d==7) printf("%d+%d-%d+%d=7",a,b,c,d);
  else if(a+b-c-d==7) printf("%d+%d-%d-%d=7",a,b,c,d);
  else if(a-b+c+d==7) printf("%d-%d+%d+%d=7",a,b,c,d);
  else if(a-b+c-d==7) printf("%d-%d+%d-%d=7",a,b,c,d);
  else if(a-b-c+d==7) printf("%d-%d-%d+%d=7",a,b,c,d);
  else if(a-b-c-d==7) printf("%d-%d-%d-%d=7",a,b,c,d);
  return 0;
}
//  [javascript]
function Main(s) {
  var s = s.split("\n")[0].split("");
  var op = ["+","-"];
  for (var bit = 0; bit < (1<<3); bit++) {
    var ops = [];
    for (var i = 0; i < 3; i++) {
      if (bit & (1<<i)) {
        ops.push(op[0]);
      } else {
        ops.push(op[1]);
      }
    }
    var ans = s[0] + ops[0] + s[1] + ops[1] + s[2] + ops[2] + s[3];
    if (eval(ans) === 7) {
      console.log(ans + "=7");
      return;
    }
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
var input = require('fs').readFileSync('/dev/stdin', 'utf8').split(/\n/g);
var s = input[0];
for (var i = 0; i < 8; i++) {
    var exp = s[0] + (i & 4 ? "+" : "-") + s[1] + (i & 2 ? "+" : "-") + s[2] + (i & 1 ? "+" : "-") + s[3];
    if (eval(exp) === 7){
        console.log(exp + "=7")
        process.exit();
    } 
}
//  [javascript]
'use strict'

function main(s) {

  const nums = s.split('\n')[0].split('');
  let ans = '';

  const dfs = (i, str) => {
    if (i === nums.length - 1) {
      str = str + nums[i];
      if (eval(str) === 7) {
        ans = (str + '=7');
      }
      return;
    } else {
      dfs(i + 1, str + nums[i] + '+');
      dfs(i + 1, str + nums[i] + '-');
    }
  }

  dfs(0, '');
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
input = require("fs").readFileSync("/dev/stdin", "utf8").split("\n")
abcd = input[0]
target = 7
ans = ""
dfs = (str, rest)=>{
  if(rest.length === 0){
    if(eval(str) === target){
      ans = str;
    }
  }else{
    dfs(str+"+"+rest[0], rest.substr(1));
    dfs(str+"-"+rest[0], rest.substr(1));
  }
};
dfs(abcd[0], abcd.substr(1));
console.log(ans+"="+target);
//  [javascript]
'use strict'

const calc = (a, b, ops) => {
    if(ops === '+'){
        return a + b
    }
    return a - b
}

const main = (input) => {
    const nums = input.split('').map(v => parseInt(v))
    const ops = ['+', '-']

    for(let i = 0; i < ops.length; i++){
        for(let j = 0; j < ops.length; j++){
            for(let k = 0; k < ops.length; k++){
                let ans = calc(calc(calc(nums[0], nums[1], ops[i]), nums[2], ops[j]), nums[3], ops[k])
                if(ans === 7){
                    console.log(`${nums[0]}${ops[i]}${nums[1]}${ops[j]}${nums[2]}${ops[k]}${nums[3]}=7`)
                    return
                }
            }
        }
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))
//  [javascript]
var lines = []; var X = []; var flag = false;
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var A = Number(lines[0].split("")[0])
    var B = Number(lines[0].split("")[1])
    var C = Number(lines[0].split("")[2])
    var D = Number(lines[0].split("")[3])

    var op = []; var ans = 0;

    // 0: + , 1: -
    for (var i = 0; i < 2; i++) {
        for (var j = 0; j < 2; j++) {
            for (var k = 0; k < 2; k++) {
                if (i === 0) { ans += A + B; op.push("+") }; if (i === 1) { ans += A - B; op.push("-") }
                if (j === 0) { ans += C; op.push("+") }; if (j === 1) { ans -= C; op.push("-") }
                if (k === 0) { ans += D; op.push("+") }; if (k === 1) { ans -= D; op.push("-") }

                if (ans === 7) {
                    console.log(A + op.shift() + B + op.shift() + C + op.shift() + D + "=7");
                    return (0)
                }
                var op = []
                var ans = 0;
            }
        }
    }
});
//  [go]
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var inputStr string
	fmt.Scan(&inputStr)

	input, _ := strconv.Atoi(inputStr)

	a := input / 1000
	input = input % 1000
	b := input / 100
	input = input % 100
	c := input / 10
	input = input % 10
	d := input

	oj, ok, ol := 1, 1, 1
	for i := 0; i < 2; i++ {
		for j := 0; j < 2; j++ {
			oj = oj * -1
			for k := 0; k < 2; k++ {
				ok = ok * -1
				for l := 0; l < 2; l++ {
					ol = ol * -1
					ans := a + b*oj + c*ok + d*ol
					if ans == 7 {
						fmt.Printf("%d%s%d%s%d%s%d=7\n", a, f(oj), b, f(ok), c, f(ol), d)
						return
					}
				}
			}
		}
	}
}

func f(v int) string {
	if v >= 0 {
		return "+"
	} else {
		return "-"
	}
}
//  [go]
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var s string
	fmt.Scan(&s)

	num := make([]int, 4)
	for i := 0; i < 4; i++ {
		num[i], _ = strconv.Atoi(string(s[i]))
	}

	if num[0]+num[1]+num[2]+num[3] == 7 {
		fmt.Println(fmt.Sprintf("%d+%d+%d+%d=7", num[0], num[1], num[2], num[3]))
		return
	} else if num[0]+num[1]+num[2]-num[3] == 7 {
		fmt.Println(fmt.Sprintf("%d+%d+%d-%d=7", num[0], num[1], num[2], num[3]))
		return
	} else if num[0]+num[1]-num[2]+num[3] == 7 {
		fmt.Println(fmt.Sprintf("%d+%d-%d+%d=7", num[0], num[1], num[2], num[3]))
		return
	} else if num[0]+num[1]-num[2]-num[3] == 7 {
		fmt.Println(fmt.Sprintf("%d+%d-%d-%d=7", num[0], num[1], num[2], num[3]))
		return
	} else if num[0]-num[1]+num[2]+num[3] == 7 {
		fmt.Println(fmt.Sprintf("%d-%d+%d+%d=7", num[0], num[1], num[2], num[3]))
		return
	} else if num[0]-num[1]+num[2]-num[3] == 7 {
		fmt.Println(fmt.Sprintf("%d-%d+%d-%d=7", num[0], num[1], num[2], num[3]))
		return
	} else if num[0]-num[1]-num[2]+num[3] == 7 {
		fmt.Println(fmt.Sprintf("%d-%d-%d+%d=7", num[0], num[1], num[2], num[3]))
		return
	} else if num[0]-num[1]-num[2]-num[3] == 7 {
		fmt.Println(fmt.Sprintf("%d-%d-%d-%d=7", num[0], num[1], num[2], num[3]))
		return
	}
}
//  [go]
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var s string
	fmt.Scan(&s)
	a := make([]int, 4)
	for i := 0; i < 4; i++ {
		n, err := strconv.Atoi(string(s[i]))
		if err != nil {
			panic(err)
		}
		a[i] = n
	}
	fmt.Println(solve(a))
}

func solve(a []int) string {
	n := 4
	for bit := 0; bit < 1<<uint(n); bit++ {
		ans := a[0]
		f := fmt.Sprintf("%d", a[0])
		for i := uint(1); i < uint(n); i++ {
			if (bit & (1 << i)) > 0 { // bitのi番目に1が立っているか？
				ans += a[i]
				f += fmt.Sprintf("+%d", a[i])
			} else {
				ans -= a[i]
				f += fmt.Sprintf("-%d", a[i])
			}
		}
		if ans == 7 {
			return fmt.Sprintf("%s=%d", f, ans)
		}
	}
	return ""
}
//  [go]
package main

import (
        "fmt"
)

func solution(s string) string {
        var buf [4]int
        for i := range s {
                buf[i] = int(s[i] - '0')
        }
        out := ""
        for p := 0; p < 1<<3; p++ {
                ans := buf[0]
                var b []byte
                b = append(b, s[0])
                for i := 0; i < 3; i++ {
                        if p>>uint(i)&1 == 0 {
                                b = append(b, '+')
                                b = append(b, s[i+1])
                                ans += buf[i+1]
                        } else {
                                b = append(b, '-')
                                b = append(b, s[i+1])
                                ans -= buf[i+1]
                        }
                }
                if ans == 7 {
                        b = append(b, '=')
                        b = append(b, '7')
                        out = string(b)
                        break
                }
        }
        return out
}

func main() {
        var s string
        fmt.Scan(&s)
        fmt.Println(solution(s))
}
//  [go]
      package main                                              
                                                          
import "fmt"
import "strconv"
                                                          
func find(a []int, x int) int {
        for i, n := range a {           
                if x == n {                               
                        return i                
                }        
        }        
        return len(a)
}                                                         
                             
func main() {                                             
        var S string                                      
        var nums []int  
n := 3 // + or - が入る位置

        fmt.Scanf("%s", &S)

        for i := 0; i < len(S); i++ {
                num, _ := strconv.Atoi(S[i : i+1])
                nums = append(nums, num)
        }

        for bit := 0; bit < (1 << n); bit++ {
                var p []int
                for i := 0; i < n; i++ {
                        if bit&(1<<i) >= 1 {
                                p = append(p, i)
                        }
                }

                var result []string
                total := 0
                for i, num := range nums {
                        f := find(p, i-1)
                        if i == 0 {
                                total += num
                        } else if f < len(p) && p[f] == i-1 {
                                total += num
                                result = append(result, "+")
                        } else {
                                total -= num
                                result = append(result, "-")
                        }
                        result = append(result, strconv.Itoa(num))
                }

                var sentence string

                if total == 7 {
                        for _, re := range result {
                                sentence += re
                        }
                        fmt.Print(sentence + "=7")
                        return
                }
        }
}
//  [ruby]
nums = gets.chomp.split("").map(&:to_i)

(2**3).times do |i|
  sum = nums[0]
  ans = [nums[0]]
  3.times do |j|
    if i[j] == 0
      sum -= nums[j+1]
      ans << "-" + "#{nums[j+1]}"
    else
      sum += nums[j+1]
      ans << "+" + "#{nums[j+1]}"
    end
  end
  if sum == 7
    puts ans.join + "=7"
    break
  end
end
//  [ruby]
nums = gets.chomp.split("").map(&:to_i)
(3 ** 2).times do |i|
  op1 = i[0] == 1 ? "+" : "-"
  op2 = i[1] == 1 ? "+" : "-"
  op3 = i[2] == 1 ? "+" : "-"
  ops = [op1, op2, op3]
  sum = nums.first
  nums[1..-1].each_with_index do |num, index|
    sum += ops[index] == "+" ? num : -num
  end
  if sum == 7
    puts "#{nums[0]}#{op1}#{nums[1]}#{op2}#{nums[2]}#{op3}#{nums[3]}=7"
    exit
  end
end
//  [ruby]
num = gets.chomp
array = [num[0], "op1", num[1], "op2", num[2], "op3", num[3]]
mark = ["op", "op", "op"]
(2 ** 3).times do |i|
  bit = i
  new_mark = []
  mark.each_with_index do |m, j|
    if bit[j] == 1
      m = "+"
    else
      m = "-"
    end
    new_mark << m
  end
  array[1], array[3], array[5] = new_mark[0], new_mark[1], new_mark[2]
  if eval(array.join) == 7
    puts array.join + "=7"
    exit
  end
end
//  [ruby]
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
  gets.chomp.split("").map(&:to_i)
end
nums = gets_i_list

0.upto(2**4 - 1) do |i|
  total = nums[0]
  ops = sprintf("%0*b",3,i).chars
  ops.each_with_index do |op, i|
    if op == "0"
      ops[i] = "+"
    else
      ops[i] = "-"
    end
  end

  ops.each_with_index do |op, i|
    if op == "+"
      total += nums[i+1]
    else
      total -= nums[i+1]
    end

    if total == 7
      puts [nums[0],ops[0],nums[1],ops[1],nums[2],ops[2],nums[3],"=7"].join
      exit
    end
  end
end
//  [ruby]
S = gets.chomp
["+", "-"].repeated_permutation(3) do |t|
  formula = S.chars.zip(t).join
  if eval(formula) == 7
    puts "#{formula}=7"
    exit
  end
end
//  [ruby]
x=Array.new(4)
x=gets.split("").map(&:to_i)

op=Array.new(3)
[0,1].repeated_permutation(3).to_a.each do |bit|
    count=x[0]
    3.times do |i|
        if bit[i]==0
            op[i]="+"
            count+=x[i+1]
        else
            op[i]="-"
            count-=x[i+1]
        end
    end
    if count==7
        puts "#{x[0]}#{op[0]}#{x[1]}#{op[1]}#{x[2]}#{op[2]}#{x[3]}=7"
        return
    end
end
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let  s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

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

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

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

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

fn d2c(num: u32) -> char {
    std::char::from_digit(num, 10).unwrap()
}

fn main() {
    abc079_c();
}

fn abc079_c() {
    input! {
        a: chars
    }
    let nums: Vec<i32> = a.into_iter().map(|c| c as i32 - 48).collect();
    let ans: String = abc079_c_helper(&nums).into_iter().collect();
    println!("{}", ans);
}

fn abc079_c_helper(nums: &Vec<i32>) -> Vec<char> {
    for i in 0..8 {
        let mut sum = nums[0];
        let mut text: Vec<char> = Vec::new();
        text.push(d2c(nums[0] as u32));
        for j in 0..3 {
            if i & (1 << j) == 0 {
                sum += nums[j + 1];
                text.push('+');
            } else {
                sum -= nums[j + 1];
                text.push('-');
            }
            text.push(d2c(nums[j+1] as u32));
        }
        if sum == 7 {
            text.push('=');
            text.push('7');
            return text;
        }
    }

    Vec::new()
}
//  [rust]
// -*- coding:utf-8-unix -*-

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
 
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
 
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
 
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}
 
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
 
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
 
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
 
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
 
 
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
 // ABC086C - Traveling
// https://atcoder.jp/contests/abs/fasks/arc089_a

fn main() {
    /*     input! {
        n: usize,
        mut plan: [(i32, i32, i32); n],  // Vec<(i32, i32, i32)>
    }
 */
    input! {
        s: String,
    }
    for i in 0..(1 << s.len() - 1) {
        let mut result:String = String::new();
        let mut res = 0i32;
        let mut calc = '+';
        for (j,c) in s.chars().enumerate(){
            match calc {
                '+' => res += c.to_digit(10).unwrap() as i32,
                '-' => res -= c.to_digit(10).unwrap() as i32,
                _ => ()
            }
            result.push(c);
            if j  < s.len() - 1  {
                if i & (1 << j) != 0 {
                    result.push('+');
                    calc = '+';
                } else {
                    result.push('-');
                    calc = '-';
                }    
            }
        }
        if res == 7{
            result.push_str("=7");
            println!("{}",result);
            return;
        }
    }
}
//  [rust]
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: String = read();
    let arr: Vec<i32> = s.chars().map(|c| c.to_digit(10).unwrap() as i32).collect();
    for bit in 0..1 << 4 {
        let mut p_or_m = vec!["-"; 3];
        for i in 0..3 {
            if bit & (1 << i) != 0 {
                p_or_m[3 - 1 - i] = "+"
            }
        }
        let mut sum = arr[0];
        let mut ans = String::new();
        for j in 0..3 {
            ans += &arr[j].to_string();
            ans += p_or_m[j];
            if p_or_m[j] == "+" {
                sum += arr[j + 1];
            } else {
                sum -= arr[j + 1];
            }
        }
        ans += &arr[3].to_string();

        if sum == 7 {
            println!("{}=7", ans);
            break;
        }
    }
}
//  [rust]
use whiteread::parse_line;

fn main() {
    let abcd: String = parse_line().unwrap();
    let mut abcd = abcd.chars();
    let a = abcd.next().unwrap().to_digit(10).unwrap() as i32;
    let b = abcd.next().unwrap().to_digit(10).unwrap() as i32;
    let c = abcd.next().unwrap().to_digit(10).unwrap() as i32;
    let d = abcd.next().unwrap().to_digit(10).unwrap() as i32;

    let mut op: Vec<i32> = vec![1, 1, 1];
    'outer: for x in 0..2 {
        let op_b;
        if x == 0 {
            op_b = 1;
        } else {
            op_b = -1;
        }
        for y in 0..2 {
            let op_c;
            if y == 0 {
                op_c = 1;
            } else {
                op_c = -1;
            }
            for z in 0..2 {
                let op_d;
                if z == 0 {
                    op_d = 1;
                } else {
                    op_d = -1;
                }
                if a + b * op_b + c * op_c + d * op_d == 7 {
                    op[0] = op_b;
                    op[1] = op_c;
                    op[2] = op_d;
                    break 'outer;
                }
            }
        }
    }
    let mut op = op.iter().map(|&x| if x == 1 { '+' } else { '-' });
    println!(
        "{}{}{}{}{}{}{}=7",
        a,
        op.next().unwrap(),
        b,
        op.next().unwrap(),
        c,
        op.next().unwrap(),
        d
    );
}
//  [rust]
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		cs: Chars,
	}

	let a = (cs[0] as u8) as isize - 48;
	let b = (cs[1] as u8) as isize - 48;
	let c = (cs[2] as u8) as isize - 48;
	let d = (cs[3] as u8) as isize - 48;

	//println!("{},{},{},{}", a, b, c, d);

	//+++
	if a+b+c+d == 7 {
		println!("{}+{}+{}+{}=7", a, b, c, d);
		return;
	}
	//++-
	if a+b+c-d == 7 {
		println!("{}+{}+{}-{}=7", a, b, c, d);
		return;
	}
	//+-+
	if a+b-c+d == 7 {
		println!("{}+{}-{}+{}=7", a, b, c, d);
		return;
	}
	//+--
	if a+b-c-d == 7 {
		println!("{}+{}-{}-{}=7", a, b, c, d);
		return;
	}
	//-++
	if a-b+c+d == 7 {
		println!("{}-{}+{}+{}=7", a, b, c, d);
		return;
	}
	//-+-
	if a-b+c-d == 7 {
		println!("{}-{}+{}-{}=7", a, b, c, d);
		return;
	}
	//--+
	if a-b-c+d == 7 {
		println!("{}-{}-{}+{}=7", a, b, c, d);
		return;
	}
	//---
	if a-b-c-d == 7 {
		println!("{}-{}-{}-{}=7", a, b, c, d);
		return;
	}
}
//  [rust]
// -*- coding:utf-8-unix -*-

use proconio::input;

fn main() {
    input! {
        abcd: String,
    }

    let vch: Vec<i16> = abcd.chars().map(|c| c.to_digit(10).unwrap() as i16).collect();
    let vb = vec![vch[1], -vch[1]];
    let vc = vec![vch[2], -vch[2]];
    let vd = vec![vch[3], -vch[3]];
    for b in &vb {
        for c in &vc {
            for d in &vd {
                if vch[0] + b + c + d == 7 {
                    println!("{}{:+}{:+}{:+}=7", vch[0], b, c, d);
                    return;
                }
            }
        }
    }
}
//  [swift]
// bit全探索に初挑戦!٩(๑❛ᴗ❛๑)۶
// 2択の選択肢を2進数で表せる?みたいのを前チラッと見ただけなので見様見真似ですらない...(~_~;)
// ちゃんと勉強します!٩( ᐛ )و
let S: [Int] = readLine()!.map { Int(String($0))! }
var res: String = ""

for i in 0..<8 {
    var num2 = String(i, radix: 2)  // i を2進数の文字列に変換
    num2 = String(repeating: "0", count: 3-num2.count) + num2   // 001とかを作るための0埋め (ちょっと無理やり＞＜ )
    res = "\(S[0])"
    var sum: Int = S[0]
    
    for (j, opt) in num2.enumerated() {
        if opt=="0" {   // 0のときに足す
            res += "+\(S[j+1])"
            sum += S[j+1]
        } else {    // 1のときに引く
            res += "-\(S[j+1])"
            sum -= S[j+1]
        }
    }
    if sum==7 { // 7だったら
        print(res+"=7") // (๑•ૅㅁ•๑)
        break
    }
}
//  [swift]
let input = readLine()!.characters.map{String($0)}
let (A, B, C, D) = (Int(input[0])!, Int(input[1])!, Int(input[2])!, Int(input[3])!)
if A+B+C+D == 7 {
    print("\(A)+\(B)+\(C)+\(D)=7")
} else if A+B+C-D == 7 {
    print("\(A)+\(B)+\(C)-\(D)=7")
} else if A+B-C+D == 7 {
    print("\(A)+\(B)-\(C)+\(D)=7")
} else if A+B-C-D == 7 {
    print("\(A)+\(B)-\(C)-\(D)=7")
} else if A-B+C+D == 7 {
    print("\(A)-\(B)+\(C)+\(D)=7")
} else if A-B+C-D == 7 {
    print("\(A)-\(B)+\(C)-\(D)=7")
} else if A-B-C+D == 7 {
    print("\(A)-\(B)-\(C)+\(D)=7")
} else if A-B-C-D == 7 {
    print("\(A)-\(B)-\(C)-\(D)=7")
}
//  [typescript]
{
  const main = (
    input: string
  ): void | string | number | string[] | number[] => {
    const r = _reader(input)
    const s = r.s()
    const a = s.split('').map(Number)

    for (let i = 0; i < 2 ** 3; i++) {
      const d0 = getBit(i, 0)
      const d1 = getBit(i, 1)
      const d2 = getBit(i, 2)

      const k =
        a[0] +
        (d0 ? 1 : -1) * a[1] +
        (d1 ? 1 : -1) * a[2] +
        (d2 ? 1 : -1) * a[3]

      if (k === 7) {
        return (
          s[0] +
          (d0 ? '+' : '-') +
          s[1] +
          (d1 ? '+' : '-') +
          s[2] +
          (d2 ? '+' : '-') +
          s[3] +
          '=7'
        )
      }
    }

    return
  }

  const getBit = (n, i) => (n >> i) & 1

  const _reader = (str: string, i = 0) => {
    const lines = str.trim().split('\n')
    const s = () => lines[i++] || ''
    const n = () => Number(s())

    const mn = (v: string[]) => v.map(Number)
    const sp = (v: string) => v.split(' ')
    const ss = () => sp(s())
    const nn = () => mn(ss())
    const nls = () => mn(lines.slice(i))
    const nnls = () => lines.slice(i).map(v => mn(sp(v)))

    return { lines, s, n, ss, nn, nls, nnls }
  }

  const _getInput = () => require('fs').readFileSync('/dev/stdin', 'utf8')
  const _res = main(_getInput())

  if (typeof _res === 'number' || typeof _res === 'string') console.log(_res)
  if (typeof _res === 'object') console.log(_res.join(' '))
}
//  [typescript]
function*stdinIter(){const t=require("fs").readFileSync("/dev/stdin","utf-8").trim().split(/\n|\s/);yield*t}function readMany(t,e){const i=e||this.iter||(this.iter=stdinIter()),n=[];for(let e=0;e<t;e+=1)n.push(i.next().value);return n};

(() => {
    const [ abcd ] = readMany(1)
    const nums = abcd.split('').map(it => parseInt(it))

    const ops = [ false, false, false ] // false: -, true: +
    for (let i = 0; i < 2 ** ops.length; i += 1) {
        for (let j = 0; j < ops.length; j += 1) {
            ops[j] = (1 << (ops.length - 1 - j)) & i
        }

        let calculated = nums[0]
        for (let j = 0; j < ops.length; j += 1) {
            if (ops[j]) {
                calculated += nums[j + 1]
            } else {
                calculated -= nums[j + 1]
            }
        }

        if (calculated == 7) {
            let answer = nums[0] + ''
            for (let j = 0; j < ops.length; j += 1) {
                if (ops[j]) {
                    answer += '+'
                } else {
                    answer += '-'
                }
                answer += nums[j + 1]
            }
            answer += '=7'
            return console.log(answer)
        }
    }
})()
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);let input_i=-1;const tn=():number=>{input_i++;return Number(input[input_i])};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{input_i++;return String(input[input_i])};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const ceil=(a)=>{return Math.ceil(a)};const asc=(ar:number[])=>{const t=[...ar];return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{const t=[...ar];return t.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1]}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const deduplicate=(a:any[]):any[]=>{return Array.from(new Set(a))};const gcd=(x,y)=>{while(y){[x,y]=[y,x%y]}return x};const sum=(arr)=>{return arr.reduce((a,b)=>a+b);};
const main=()=>{
  let S=ts()
  for(let i=0;i<(1<<3);i++){
    let s=S.split('')
    if(i&1<<0)s[0]+='+'
    else s[0]+='-'
    if(i&1<<1)s[1]+='+'
    else s[1]+='-'
    if(i&1<<2)s[2]+='+'
    else s[2]+='-'
    if(eval(s.join(''))==7){
      to(s.join('')+'=7')
      return
    }
  }
}
main()
//  [typescript]
import * as readline from "readline";

/* ここに処理を書く */
const op = (a: number, b: number, opId: number): number => {
  let res: number;
  switch (opId) {
    case 0:
      return a + b;
    case 1:
      return a - b;
    default:
      return -1;
  }
};
const printOp = (id: number): string => {
  return id === 0 ? "+" : "-";
};
const main = (args: any[]) => {
  const N = args[0];
  const A = Math.floor(N / 1000) % 10,
    B = Math.floor(N / 100) % 10,
    C = Math.floor(N / 10) % 10,
    D = Math.floor(N) % 10;
  // console.log(A, B, C, D);
  for (let op1 = 0; op1 < 2; op1++) {
    for (let op2 = 0; op2 < 2; op2++) {
      for (let op3 = 0; op3 < 2; op3++) {
        if (op(op(op(A, B, op1), C, op2), D, op3) === 7) {
          console.log(
            A + printOp(op1) + B + printOp(op2) + C + printOp(op3) + D + "=7"
          );
          return;
        }
      }
    }
  }
};

/* 標準入力処理 */
const stdin = (main: Function) => {
  const args: any[] = [];
  const reader = readline.createInterface({
    input: process.stdin,
    output: process.stdout
  });
  reader.on("close", function() {
    main(args);
  });
  reader.on("line", function(line: any) {
    if (line === "") {
      reader.close();
    }
    line.split(" ").forEach((arg: any) => {
      args.push(isNaN(arg) ? arg : Number(arg));
    });
  });
};
/* 実行 */
stdin(main);
//  [typescript]
const lines: string[] = [];
const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
reader.on("line", function (line: string) {
  lines.push(line);
});

reader.on("close", function () {
  const input = lines[0].split("").map(Number);

  const paternArray = [1, -1];
  const strArray = ["+", "-"];

  let ans: number[] = [input[0]];
  for (let i = 0; i < paternArray.length; i++) {
    for (let j = 0; j < paternArray.length; j++) {
      for (let k = 0; k < paternArray.length; k++) {
        let sum =
          input[0] +
          input[1] * paternArray[i] +
          input[2] * paternArray[j] +
          input[3] * paternArray[k];

        if (sum === 7) {
          console.log(
            input[0] +
              strArray[i] +
              input[1] +
              strArray[j] +
              input[2] +
              strArray[k] +
              input[3] +
              "=7"
          );
          return;
        }
      }
    }
  }

  console.log();
});