Language: C++

#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

int main()
{
    string a, b;
    cin >> a >> b;
    rep(i, a.size())
    {
        int flag = 0;
        rep(j, b.size() && (i + j) < a.size())
        {
            if (a[i + j] == b[j] || a[i + j] == '?')
            {
                if (flag == 1 || j == 0)
                    flag = 1;
            }
            else
            {
                flag = 0;
                break;
            }
        }
        //マッチした
        if (flag == 1)
        {
            rep(j, b.size())
            {
                a[i + j] = b[j];
            }
            rep(j, a.size())
            {
                if (a[j] == '?')
                    a[j] = 'a';
            }
            cout << a << endl;
            return 0;
        }
        cout << "UNRESTORABLE" << endl;
        return 0;
        vector<data> a(n + 1);
        a[0].t = 0;
        a[0].x = 0;
        a[0].y = 0;
        REP(i, 1, n + 1)
        {
            cin >> a[i].t >> a[i].x >> a[i].y;
        }
        int flag = 0;
        rep(i, a.size() - 1)
        {
            int timediff = a[i + 1].t - a[i].t;
            int disdiff = abs(a[i + 1].x - a[i].x) + abs(a[i + 1].y - a[i].y);
            if (timediff >= disdiff && (timediff - disdiff) % 2 == 0)
            {
                flag = 0;
            }
            else
            {
                cout << "No" << endl;
                return 0;
            }
        }
        cout << "Yes" << endl;
        return 0;
    

Compiler output:
a.cc: In function 'int main()':
a.cc:50:20: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
   50 |         vector<data> a(n + 1);
      |                    ^
a.cc:50:20: note:   expected a type, got 'std::data'
a.cc:50:20: error: template argument 2 is invalid
a.cc:50:24: error: 'n' was not declared in this scope
   50 |         vector<data> a(n + 1);
      |                        ^
a.cc:51:10: error: invalid types 'int[int]' for array subscript
   51 |         a[0].t = 0;
      |          ^
a.cc:52:10: error: invalid types 'int[int]' for array subscript
   52 |         a[0].x = 0;
      |          ^
a.cc:53:10: error: invalid types 'int[int]' for array subscript
   53 |         a[0].y = 0;
      |          ^
a.cc:56:21: error: invalid types 'int[int]' for array subscript
   56 |             cin >> a[i].t >> a[i].x >> a[i].y;
      |                     ^
a.cc:56:31: error: invalid types 'int[int]' for array subscript
   56 |             cin >> a[i].t >> a[i].x >> a[i].y;
      |                               ^
a.cc:56:41: error: invalid types 'int[int]' for array subscript
   56 |             cin >> a[i].t >> a[i].x >> a[i].y;
      |                                         ^
a.cc:58:13: error: redeclaration of 'int flag'
   58 |         int flag = 0;
      |             ^~~~
a.cc:19:13: note: 'int flag' previously declared here
   19 |         int flag = 0;
      |             ^~~~
a.cc:59:18: error: request for member 'size' in 'a', which is of non-class type 'int'
   59 |         rep(i, a.size() - 1)
      |                  ^~~~
a.cc:2:42: note: in definition of macro 'REP'
    2 | #define REP(i, s, n) for (int i = s; i < n; ++i)
      |                                          ^
a.cc:59:9: note: in expansion of macro 'rep'
   59 |         rep(i, a.size() - 1)
      |         ^~~
a.cc:61:29: error: invalid types 'int[int]' for array subscript
   61 |             int timediff = a[i + 1].t - a[i].t;
      |                             ^
a.cc:61:42: error: invalid types 'int[int]' for array subscript
   61 |             int timediff = a[i + 1].t - a[i].t;
      |                                          ^
a.cc:62:32: error: invalid types 'int[int]' for array subscript
   62 |             int disdiff = abs(a[i + 1].x - a[i].x) + abs(a[i + 1].y - a[i].y);
      |                                ^
a.cc:62:45: error: invalid types 'int[int]' for array subscript
   62 |             int disdiff = abs(a[i + 1].x - a[i].x) + abs(a[i + 1].y - a[i].y);
      |                                             ^
a.cc:62:59: error: invalid types 'int[int]' for array subscript
   62 |             int disdiff = abs(a[i + 1].x - a[i].x) + abs(a[i + 1].y - a[i].y);
      |                                                           ^
a.cc:62:72: error: invalid types 'int[int]' for array subscript
   62 |             int disdiff = abs(a[i + 1].x - a[i].x) + abs(a[i + 1].y - a[i].y);
      |                                                                        ^
a.cc:74:18: error: expected '}' at end of input
   74 |         return 0;
      |                  ^
a.cc:18:5: note: to match this '{'
   18 |     {
      |     ^
a.cc:74:18: error: expected '}' at end of input
   74 |         return 0;
      |                  ^
a.cc:14:1: note: to match this '{'
   14 | {
      | ^