#include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define pii pair<int, int>
#define mii map<int, int>
#define pis pair<int, string>
#define vi vector<int>
#define int long long

#define endl "\n"
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

using namespace std;

const int inf = 1e16;
const int mod = 1e9 + 7;
const int Max = 1e5 + 5;
int pow(int a, int b)
{
    int res = 1;
    while(b > 0) {
        if(b & 1) {
            res = (res * a) % mod;
        }
        a = (a * a) % mod;

        b >>= 1;
    }
    return res;
}
vector<bool> is_prime(Max, true);
void sieve()
{
    is_prime[0] = false;
    is_prime[1] = false;
    for(int i = 2; i * i < Max; i++) {
        if(is_prime[i]) {
            for(int j = i * i; j < Max; j += i) {
                is_prime[j] = false;
            }
        }
    }
}

int32_t main()
{
    IOS;
    int t;
    t = 1;
//    cin >> t;
    while(t--) {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int z=c*d-b;
        if(z<=0){
            cout<<-1<<endl;
            continue;
        }
        int ans=(a+z-1)/z;
        cout<<ans<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
#define SIZE(x) ll(x.size())
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
typedef pair<int, int> P;
int main()
{
    int T;
    cin >> T;

    rep(i, T) {
        int N;
        string S1, S2, S3;
        cin >> N >> S1 >> S2 >> S3;
        string ans = "1";
        rep(i, N) ans += "0";
        rep(i, N) ans += "1";
        cout << ans << endl;
    }
    return 0;
}